I found something insteresting when I tested passing arguments into my scripts.
My scripts is as below.
% cat passarg.env
#!/bin/csh
echo "passarg: argv[1] = $argv[1] argv[2] = $argv[2]"
passarg1.env $*
% cat passarg1.env
#!/bin/csh
echo "passarg1: argv[1] = $argv[1] argvp[2]=$argv[2]"
set str = "test passing arguments"
source passarg2.env "$str"
% cat passarg2.env
#!/bin/csh
echo "passarg2: argv[1] = $argv[1]"
When I test my scripts on Solaris 8. The results showed as following.
% passarg.env abc cde
passarg: argv[1] = abc argv[2] = cde
passarg1: argv[1] = abc argvp[2]=cde
passarg2: argv[1] = abc
But when I tested it on RHEL 6.5 the results showed as below.
% passarg.env abc cde
passarg: argv[1] = abc argv[2] = cde
passarg1: argv[1] = abc argvp[2]=cde
passarg2: argv[1] = test passing arguments
Ideally, the Linux results should be correct.
Unfortunately, I don't know how to check Solaris built-in csh version
I only found tcsh package info as below.
% pkginfo -l SUNWtcsh
PKGINST: SUNWtcsh
NAME: Tenex C-shell (tcsh)
CATEGORY: system
ARCH: sparc
VERSION: 11.8.0,REV=2000.01.08.18.12
BASEDIR: /
VENDOR: Sun Microsystems, Inc.
DESC: Tenex C-shell (tcsh)
PSTAMP: on28-patch20040130230639
INSTDATE: Sep 19 2007 16:10
HOTLINE: Please contact your local service provider
STATUS: completely installed
FILES: 7 installed pathnames
5 shared pathnames
5 directories
1 executables
1034 blocks used (approx)
I kept wondering this should be a bug of Solaris 8 C-shell.
Does anybody have idea?
Except upgrading C-shell version, is there any workaround to solve this issue?
Thanks.