From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,dcbab91dabb334da,start X-Google-Attributes: gidfee84,public X-Google-ArrivalTime: 1994-10-25 12:04:49 PST Path: nntp.gmd.de!xlink.net!howland.reston.ans.net!europa.eng.gtefsd.com!news.umbc.edu!haven.umd.edu!cs.umd.edu!mojo.eng.umd.edu!brians.umd.edu!bhunt From: bhunt@brians.umd.edu (Brian R. Hunt) Newsgroups: comp.unix.osf.osf1 Subject: csh bug w/ "$*" Date: 25 Oct 94 16:24:42 GMT Organization: Project GLUE, University of Maryland, College Park, MD Message-ID: NNTP-Posting-Host: brians.umd.edu We're running DEC OSF/1 V1.3 (Rev. 111) on a DEC 3000/600, and find in a csh script, referring to the argument list as "$*" pollutes the arguments in a way I don't understand--the pollution has to do with whether or not backslashes and quotes are expanded in varius contexts. The pollution does not occur when the supposedly equivalent "$argv[*]" is used. Consider the following shell script "zzz": #!/bin/csh -f set var1="$1" set var2="$argv[*]" set var3="$1" set var4="$*" set var5="$1" set echo $var1 $var2 $var3 $var4 $var5 eval "$var1" eval "$var2" eval "$var3" eval "$var4" eval "$var5" With the command line zzz "a'b'\c" the output (minus the irrelevant part of the output from the "set" command) is: var1 a'b'\c var2 a'b'\c var3 a'b'\c var4 a'b'\c var5 a'b'\c a'b'\c a'b'\c a'b'\c abc abc abc: Command not found. abc: Command not found. abc: Command not found. a'b'\c: Command not found. a'b'\c: Command not found. Whatever the difference between variables 1-3 (defined before "$*" is used) and variables 4-5 (defined in terms of or after "$*"), it doesn't show up in the output of "set", but when the variables are used by echo or eval it becomes clear there is some difference. I don't have this problem with tcsh or with any other brand of csh I've tried. Obviously I can work around this using "$argv[*]", just thought someone out there should know... -- Brian R. Hunt bhunt@glue.umd.edu