LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices

Reply
 
Search this Thread
Old 12-08-2008, 03:43 PM   #1
b1f30
Member
 
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:

http://www.mibbit.com/pb/v56XTU

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.

Cheers.
 
Old 12-09-2008, 07:58 AM   #2
colucix
Moderator
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,508

Rep: Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957
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
unSpawn
Moderator
 
Registered: May 2001
Posts: 27,449
Blog Entries: 54

Rep: Reputation: 2892Reputation: 2892Reputation: 2892Reputation: 2892Reputation: 2892Reputation: 2892Reputation: 2892Reputation: 2892Reputation: 2892Reputation: 2892Reputation: 2892
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: 453Reputation: 453Reputation: 453Reputation: 453Reputation: 453
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.
 
  


Reply


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/Novell 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


All times are GMT -5. The time now is 04:48 PM.

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