4.2 quirks...
argv at ucb-vax.ARPA
argv at ucb-vax.ARPA
Wed Apr 10 23:38:58 AEST 1985
% mkdir foo
% chmod 000 foo
% cd foo
foo: no such file or directory
% WHAT?
no match.
% touch bar
% chmod 777 bar
% bar
at this point, my .csrhc is being sourced... and after that, it sits there..
shouldn't it only exec a csh if the first char is a #? That's what it says
in OUR manual.
Next fun item:
#!/bin/csh -f
echo -n "Go: "
set foo = $<
if ($foo =~ *\ *) echo true
echo done
This simple little ditty is supposed to check to see if there exists
a space in the variable "foo" that got it's value from the keyboard.
If there is no space, everything is fine -- it doesn't satisfy the
expression. If there IS a space, we get:
if: expression syntax.
fooey.
I found I had to enclose $foo in double quotes in order for the
expression to work. And it does.
Can someone please explain to me what shell script does with strings
so that this is necessary?
Dan Heller (aka Frank)
------------------------------------------------------------------------------
UCSC Computing Center Consultant
(Looking for a UNIX/C hacking Job - nudge nudge wink wink)
UUCP: ucbvax!ucscc!argv {ihnp4,sun,cbosgd,decwrl}!qubix!ucscc!argv
ARPA: argv%ucscc.uucp at ucb-vax.arpa
CSnet: c.argv at ucsc.csnet
(say no more, say no more)
-------------------------------------------------------------------------------
More information about the Comp.unix.wizards
mailing list