Command line argument in Cshell script

Naoki Saito saito at slb-sdr.UUCP
Fri Jun 3 08:34:15 AEST 1988


	Hello, I wrote a C-shell script to automate the task as follows:
=======================================================================
#
# Shell script for the plot3d for field files.
#
# Usage: p3d <filename> [parameters for plot3d]
#

set TEMP=/tmp/z
if (-e $TEMP) 	\rm $TEMP

chkf -b -d $argv[1] > $TEMP
plot3d z=$TEMP -P $argv[2-] | sunplot
	
if (-e $TEMP) 	\rm $TEMP

exit
=======================================================================

	This works fine unless I use command line arguments of strings which
contain space, e.g.,
(1) p3d fname tl="This_is_wrong" ---> OK
(2) p3d fname tl="This is wrong" ---> Failed

This means that in the case of (1) $argv[2] is considered as tl="This_is_wrong"
but in (2) $argv[2] becomes tl="This.
	How can I pass the space containing arguments? Does anybody out there
have solution for this?

Regards,




-- 
Naoki Saito (saito at sdr.slb.com)
Schlumberger-Doll Research



More information about the Comp.unix.wizards mailing list