Select Multiple Objects by name?


#1

Hey guys, I am trying to use the ls command, and I have different lists of objects, for ex:

sphere1 sphere2 sphere3 sphere4 box1 box2 box3 box4

I know I can go through and do a ls "box*" or ls "sphere*", then go through a for loop and delete them, but is there a way to do the ls command all in one line? so something like ls "box*, sphere*"? Any ideas would be appreciated. Thanks!


#2

string $list[]=ls "sphere*" "box*";

just put them one after another


#3

Kevin! Thanks a ton, it works like a charm. For some reason I kept trying “sphere*, box*”, but i never tried seperating the two into their own quotes. Thanks for your help!


#4

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.