`;` problems in *sh

David Fenyes dfenyes at thesis1.med.uth.tmc.edu
Tue Apr 16 08:49:40 AEST 1991


In article <1991Apr15.212340.13745 at agate.berkeley.edu> smoot at cs.berkeley.edu writes:
>Why does:
>csh> `echo "ls ; ls"` 
>fail?  
>(Generates:
>     ; not found
>     ls not found
>)
>

The string returned by `` is interpreted as:

"ls" ";" "ls".  This makes ';' and 'ls' args to  /bin/ls.

Variable and command substitution should work within the quotes,
but shell special characters will not be recognized.

try

eval `echo "ls ; ls"`

and it will work as you desire.

--
David Fenyes                                 dfenyes at thesis1.hsch.utexas.edu
University of Texas Medical School           Houston, Texas



More information about the Comp.unix.shell mailing list