Fargusson.Alan wrote:
The problem is that bash takes cooked_list as a single token in the case statement. It matches the entire list of systems, and not each member of the list. I don't know of any way around this. You will probably need to do another for loop on raw_list and check for a match in the loop.
This is where eval comes in handy: larry$ bash -c 'set -x; list="a|b|c"; t=a; eval "case $t in ( $list ) echo one;; b ) echo two;; esac' + list='a|b|c' + t=a + eval 'case a in ( a|b|c ) echo one;; b ) echo two;; esac' ++ case a in ++ echo one one (although James would still have the problem of one system name being a subset of another system name.) -- Carnegie Institution - At the Frontiers of Science Larry Ploetz Systems Administrator Carnegie Institution of Washington Department of Plant Biology, TAIR 650 325 1521 x 296 [EMAIL PROTECTED] ---------------------------------------------------------------------- For LINUX-390 subscribe / signoff / archive access instructions, send email to [EMAIL PROTECTED] with the message: INFO LINUX-390 or visit http://www.marist.edu/htbin/wlvindex?LINUX-390