I am writing a shell script in csh, and one of its functions is to execute a Perl script that takes in arguments.
The csh script itself takes in command line arguments (stored as space-separated values in $*), and I pass this to the Perl script.
My issue is that when I run:
perl myscript.pl --args $*
the Perl script only gets the first argument in $*. However, if I run echo $* from within the csh script, it correctly prints out all the arguments.
There can be any number of arguments passed (thus I cannot store my arguments in static variables and pass them through).
Does anyone know why this is happening and how I can fix this?
You need to quote
$*in your csh script:Here is
myscript.pl:Here is how I call it: