PDA

View Full Version : Select Multiple Objects by name?


AtrusDni
06-30-2007, 12:11 AM
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!

trancor
06-30-2007, 03:55 AM
string $list[]=`ls "sphere*" "box*"`;

just put them one after another

AtrusDni
07-01-2007, 10:32 PM
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!

CGTalk Moderation
07-01-2007, 10:32 PM
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.