how to make csh leave quotes on args

karl_kleinpaste at cis.ohio-state.edu karl_kleinpaste at cis.ohio-state.edu
Tue Sep 25 04:21:18 AEST 1990


hunter at oakhill.uucp writes:
   Does anyone know how to force csh to leave the quotes on args
   and pass them down to a command?

You have to quote the quoting.  Either
	set string = '"this is an argument"'
where single-quotes preserve everything literally, or if you have a
grotesque fascination for backslashes,
	set string = \"this\ is\ an\ argument\"
where backslash forces the following character to be interpreted as an
ordinary character.

Double quotes preserve whitespace in a string and prevent globbing
(that is, wildcard matching of *?[]) but permit interpolation of
variables; single quotes cause no interpretation at all.

--karl



More information about the Comp.unix.shell mailing list