I have a script which I run:
csh> ./myscript.csh
Unmatched ".
myscript.csh has the following first line:
#!/bin/tcsh
If I remove everything else from the script, and just type that in I
get the error above.
Now, from the prompt I type this:
csh> tcsh
Unmatched ".
Now, I can do the following that seem to work:
csh> source .login
csh> source .cshrc
Both work.
now I do:
csh> which csh
/bin/csh
csh> which tcsh
/bin/tcsh
csh> ls -l `which csh`
[can't copy output, but it shows the file as a 130k binary]
csh> ls -l `which tcsh`
[can't copy output, but it shows the file as a 306k binary]
I don't know enough about tcsh to know why I'm getting Unmatched ".
Can anyone give me some helpful pointers? Thanks.
shot in the dark as I haven't touched csh in years or tcsh ever...
is there a .tschrc file and does it have a mismatch? what happens if
you type:
/bin/tcsh -X
If it also happens with csh scripts then check out /etc/csh.cshrc
and /etc/csh.login which are run by both shells. Because
"which" is actually a csh script they should be okay.
If it only happens with tcsh then the unmatched double tick
has to be in a tcsh specific set-up file like ~/.tcshrc . Make
sure it's a file not a symbolic link, that it's 755, that it contains
at least one valid tcsh command.
I stuck to csh for many years until ksh was everywhere. I
have finally switch to ksh on most non-Linux systems and
bash on Linux ones.
Recall, when I type at the unix prompt:
csh> tcsh
Unmatched ".
I want to figure out why tcsh is doing this so, using some of your
suggestions I did this:
csh> tcsh -VX
if ( $path" !~ */opt/sfw/bin*) set path = ($path /opt/sfw/bin)
Unmatched ".
Now it was just a matter of using truss to figure out where this file
comes from, and I found the culprit in
/etc/.cshrc:
if($path" !~ */opt/sfw/bin*) set path = ($path /opt/sfw/bin)
if($path" !~ */usr/local/bin*) set path = ($path /usr/local/bin)
if($path" !~ */usr/sbin*) set path = ($path /usr/sbin)
if($path" !~ */usr/ccs/bin*) set path = ($path /usr/ccs/bin)
It looks like $path is not enclosed in the if clause. Right? Well,
the bigger question is, why would this syntax be wrong? I would like
to change it, but could it affect anything else? I'm not a unix
admin, and the guy who owns this machine is not a unix admin either.
I'm just helping out.
thanks.
It's a simple syntax error, it needs to be fixed.
It's possible that there are other things later in the script that
people have been depending on not happening, but it's unlikely.
--
Barry Margolin, bar...@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***