Help answer threads with 0 replies.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 12-08-2008, 03:43 PM   #1
Registered: Nov 2007
Location: GMT -5, who wants to know
Distribution: Gentoo, Debian, BSD, Slack
Posts: 119

Rep: Reputation: 15
Scripts run fine on *NIX/csh, but fail on Linux/tcsh?

All, I'm trying to pick my own brain here with the following:

This script runs fine under Solaris/HP-UX/etc using csh, but under Linux/tcsh, I get the following:

: Command not found.

That's: Colon, Command not found.

Please pay careful attention to the 'case' statements which appear to use a lot of colons.

Any idea what's causing the script to bail in Linux?

Any assistance, greatly appreciated.

Old 12-09-2008, 07:58 AM   #2
LQ Guru
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978
It is really strange, since the null command (colon) is available both in bash and in tcsh. Can you copy and paste here the exact error message from the terminal? It should tell about the related line number. Also try to add the -vx option in the sha-bang (as suggested in the second line of the script). This should give you a trace of the executed commands, so that you can easily debug the script.
Old 12-09-2008, 08:11 AM   #3
Registered: May 2001
Posts: 29,359
Blog Entries: 55

Rep: Reputation: 3546Reputation: 3546Reputation: 3546Reputation: 3546Reputation: 3546Reputation: 3546Reputation: 3546Reputation: 3546Reputation: 3546Reputation: 3546Reputation: 3546
Odd. With tcsh-6.14-12.el5 running 'tcsh b1f30.tcsh all' I don't get that error at all?..
Old 12-09-2008, 08:44 AM   #4
Sergei Steshenko
Senior Member
Registered: May 2005
Posts: 4,481

Rep: Reputation: 454Reputation: 454Reputation: 454Reputation: 454Reputation: 454
Just don't write in tcsh/csh

I once was bitten this way: the scripts I was responsible for (I wasn't the original author) worked just fine in-house, so I had enough confidence to deploy them on customer site.

They failed there, but not always - sometimes. I investigated this - the failure were due to certain tcsh versions.

Of course, in-house the version was different, otherwise I would have caught it. An on customer different machine had different tcsh versions.

Better choose a POSIX-compliant shell, or Perl.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
USB Devices Fail To Mount - They Worked Fine Yesterday rrrssssss SUSE / openSUSE 22 09-25-2007 01:04 PM
shell confusion..what is diff between bash, ksh, csh, tcsh..?? servnov Linux - Newbie 7 11-18-2004 08:28 PM
Shell scripts in tcsh not working on Suse 9.1 rtflynn Linux - Newbie 4 09-02-2004 07:56 PM
looking for csh or tcsh help 1ernie Linux - Software 1 04-12-2004 05:43 PM
tcsh/csh problem kicker Linux - Newbie 0 05-01-2002 03:30 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:49 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration