I am trying to get away from hard coded server names in a script using case for 
valid name check

This works but is not good because as soon as you add a new server to the NFS 
mountpoint list the script this is from has to be changed.

case $target_system in
  abinodji | calhoun | itasca | nokomis | pepin | phalen | vadnais | bemidji | 
millpond | mudlake | terrapin | hadley | hyland ) parm_1="valid";;
esac


So I tried several variants of this:

space=" "
delim=" | "
raw_list=`ls /clamscan/servers`     #read list of mountpoints
cooked_list=$(echo $raw_list | sed -e "s:$space:$delim:g") #replace space with 
case-happy delimiters
echo "Raw list = "$raw_list
echo "cooked list = "$cooked_list
case $target_system in
  $cooked_list ) parm_1="valid" ;;
esac

But even though the display of 'cooked_list' seems to be what I want it to be, 
this never returns a match.

Anyone see where I missed the turnip truck on this?

----------------------------------------------------------------------
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

Reply via email to