tcsh script: quote and spaces problems

Rob Lahaye lahaye at users.sourceforge.net
Thu Jul 31 18:42:08 PDT 2003



Hello,

I've been trying to include the quote (") characters and spaces into a tcsh script
variable; for already two days I've been trying various ways doing this to no avail!
I'm about to think that it is impossible.

For example:

------------------------
#!/bin/tcsh

set flag="-f "t  ""
------------------------


This obviously doesn't work because of too many quotes involved; but what does work
to achieve this? There are two problems here:
   1) flag should contain the two internal quotes of "t  "
   2) the "t  " contains two spaces.


When I use
   set flag='-f "t  "'

the two spaces are automagically (?) reduced to only one space!!

The latter seems to be a general problem:

   set flag="f     "

wil result in flag containing only "f ".


Any solutions for this problem with quotes and spaces in tcsh script?
Or is tcsh not suitable for this kind of things?

Thanks,
Rob.





More information about the freebsd-questions mailing list