On 17:58 29 Apr 2002, christopher j bottaro <[EMAIL PROTECTED]> wrote: | i've been reading about advanced bash scripting on some webpage, but i can't | seem to find what i'm looking for. | | is there an easy way to tell if a var is in a list (a list like in a for loop | list)? is there a keyword that does what continue does in c? | | i wanna get this sudo (sp?) code working... | | EXCLUDE_LIST = "dir1 dir2 dir3" | for DIR in `ls -d */` ; do | if [ $DIR in $EXCLUDE_LIST ] ; then | continue; | fi | echo $DIR | done
case " $EXCLUDE_LIST " in *" $DIR "*) echo in list ;; esac -- Cameron Simpson, DoD#743 [EMAIL PROTECTED] http://www.zip.com.au/~cs/ Indeed! But do not reject these teachings as false because I am crazy. The reason that I am crazy is because they are true. - Malaclypse the Younger _______________________________________________ Redhat-list mailing list [EMAIL PROTECTED] https://listman.redhat.com/mailman/listinfo/redhat-list