Xref: utzoo comp.unix.questions:7571 comp.unix.wizards:9317 Path: utzoo!utgpu!water!watmath!clyde!bellcore!faline!thumper!ulysses!andante!princeton!udel!rochester!bbn!uwmcsd1!marque!uunet!mcvax!unido!sbsvax!greim From: greim@sbsvax.UUCP Newsgroups: comp.unix.questions,comp.unix.wizards Subject: Re: command line argument in Cshell scripts Keywords: command line argument, Cshell, string, spaces Message-ID: <515@sbsvax.UUCP> Date: 8 Jun 88 13:04:10 GMT Followup-To: comp.unix.questions Organization: Universitaet des Saarlandes, Saarbruecken, West Germany Lines: 41 In <497@slb-sdr.UUCP: Naoki Saito writes : : Hello, I wrote a C-shell script to automate the task as follows: :======================================================================= :# :# Shell script for the plot3d for field files. :# :# Usage: p3d [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? : Try plot3d z=$TEMP -P "$argv[2-]" | sunplot The manual csh(1) says under heading "command substitution" : Within `"`s, only newlines force new words; blanks and tabs are preserved. Michael