Command line argument in Cshell script
leo at philmds.UUCP
leo at philmds.UUCP
Thu Jun 9 00:16:29 AEST 1988
In article <497 at slb-sdr.UUCP> saito at slb-sdr.UUCP (Naoki Saito) writes:
> Hello, I wrote a C-shell script to automate the task as follows:
[stuff deleted]
>plot3d z=$TEMP -P $argv[2-] | sunplot
[stuff deleted]
>
> This works fine unless I use command line arguments of strings which
>contain space, e.g.,
[stuff deleted]
I'm not a csh expert (use a Bourne sh variant myself) but I think I can
see the problem. When you start the script, you correctly quote the string
argument that contains spaces. So the script gets it in its $argv[2]. However,
when you execute the plot3d command from within the script, you do not quote
it. Why not? I think the csh now offers the words of the strings as separate
arguments to plot3d. Quote them too (in sh you would need "" so that the
value of $argv[2] is used).
Leo.
More information about the Comp.unix.questions
mailing list