This: (put it off into a little test script of its own) parm_1="invalid" target_system="hadley" space=" " delim=" | " raw_list=$(/bin/ls /clamscan/servers) cooked_list=$(echo $raw_list | sed -e "s:$space:$delim:g") echo "Raw list = "$raw_list echo "cooked list = "$cooked_list case $target_system in $cooked_list ) parm_1="valid" ;; esac
echo "Parm_1 =" $parm_1 produces: Raw list = abinodji aitken albert bemidji calhoun hadley hyland itasca millpond mudlake nokomis pepin pequot phalen terrapin vadnais cooked list = abinodji | aitken | albert | bemidji | calhoun | hadley | hyland | itasca | millpond | mudlake | nokomis | pepin | pequot | phalen | terrapin | vadnais Parm_1 = invalid Mark Post <[EMAIL PROTECTED]> Sent by: Linux on 390 Port <LINUX-390@VM.MARIST.EDU> To LINUX-390@VM.MARIST.EDU cc 09/06/2007 04:07 PM Subject Re: I am missing something basic with bash scripting. Please respond to Linux on 390 Port <LINUX-390@VM.MARIST.EDU> >>> On Thu, Sep 6, 2007 at 4:53 PM, in message <[EMAIL PROTECTED]>, James Melin <[EMAIL PROTECTED]> wrote: -snip- > raw_list=`ls /clamscan/servers` #read list of mountpoints -snip- > 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? I'm guessing that if you subsitute /bin/ls instead of just "ls" (and change the whole thing to $(/bin/ls /clamscan/servers) to satisfy Adam) that thing will work better. I think you're likely getting trailing "/"es on the end of the names, but that's not how you're passing in target_system. Mark Post ---------------------------------------------------------------------- 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 ---------------------------------------------------------------------- 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