Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Question about tcsh and unmatched.

901 views
Skip to first unread message

DaLoverhino

unread,
Apr 14, 2009, 3:07:46 PM4/14/09
to
Hello. I have a question about tcsh.

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.

OldSchool

unread,
Apr 14, 2009, 4:04:30 PM4/14/09
to

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

Doug Freyburger

unread,
Apr 14, 2009, 4:51:46 PM4/14/09
to

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.

DaLoverhino

unread,
Apr 15, 2009, 3:04:49 PM4/15/09
to

Hello thanks for all the help guys. here's what I've found.

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.

Barry Margolin

unread,
Apr 15, 2009, 8:53:56 PM4/15/09
to
In article
<911bf20a-8e7c-44f0...@e7g2000vbe.googlegroups.com>,
DaLoverhino <DaLov...@hotmail.com> wrote:

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 ***

0 new messages