LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-10-2008, 03:14 AM   #1
morfeus80
Member
 
Registered: Mar 2006
Distribution: OpenSUSE 10.3
Posts: 53

Rep: Reputation: 15
shell type


Hallo,
I'm trying to execute a file sh, but I have a problem because when I type in my shell
sh nome.sh
I have an error message because it can't find the 'setenv' command.
I looked in a forum and I have found that it happens because I'm using a bash shell, instead my sh file is for a csh shell.
So, how can I execute that file?
 
Old 03-10-2008, 03:23 AM   #2
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
By running it like "sh nome.sh" you are explicitly saying to run the script using bash in sh compatibility mode. Instead either use "csh nome.sh" or use "./nome.sh" and rely on the slash-bang line to change the shell used.

While the extension isn't important in Linux, using sh is confusing. Change the extension to .csh. Look in /etc/profile.d; you may find a number of .sh and .csh files. The .sh files are bash scripts while the .csh files are csh scripts.
 
Old 03-10-2008, 03:24 AM   #3
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Fedora38
Posts: 6,147

Rep: Reputation: 435Reputation: 435Reputation: 435Reputation: 435Reputation: 435
Do you have csh installed? which csh
Then try csh /path/to/nome.sh
 
Old 03-10-2008, 03:46 AM   #4
morfeus80
Member
 
Registered: Mar 2006
Distribution: OpenSUSE 10.3
Posts: 53

Original Poster
Rep: Reputation: 15
Thanks,

I've installed the csh shell, but now I've this error:

./bin/ansa_linux_glibc23: Command not found.

Last edited by morfeus80; 03-10-2008 at 03:47 AM.
 
Old 03-10-2008, 08:14 AM   #5
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
ANSA CAE software??
To make a './' command you will have to 'cd' into that directory.
There is a reference to a '${ANSA_EXEC_DIR}bin/ansa_linux$...' command in chapter 15
here: http://www.virtualgl.org/vgldoc/2_0_1final/
 
Old 03-10-2008, 11:28 AM   #6
morfeus80
Member
 
Registered: Mar 2006
Distribution: OpenSUSE 10.3
Posts: 53

Original Poster
Rep: Reputation: 15
I am not an expert so I don't know what you mean when you say:

Quote:
Originally Posted by knudfl View Post
ANSA CAE software??
To make a './' command you will have to 'cd' into that directory.
Can you explain, please?
 
Old 03-10-2008, 12:33 PM   #7
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
http://www.ee.surrey.ac.uk/Teaching/Unix/
quote from tutorial 1:
'The current directory (.)
In UNIX, (.) means the current directory, so typing
% cd .
[NOTE: there is a space between cd and the dot]
means stay where you are (the unixstuff directory).'
More questions? Please inform which application you are using.
 
Old 03-11-2008, 04:00 AM   #8
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
I think that SuSE has the csh shell already installed. If not, install it from the package manager.

Try the "chsh" command to change your current shell. (see "man chsh")
Also, did you look at the first line in the script you are trying to run? That will verify whether the script used the chsh.

Last edited by jschiwal; 03-11-2008 at 04:40 AM.
 
  


Reply



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
how to write such type of loop in shell George2 Programming 4 09-14-2007 06:15 AM
understand variable type in shell script qrshat Programming 5 09-09-2006 02:12 AM
shell type vs copy paste gr00ve Linux - General 8 03-31-2006 02:38 PM
how to run a shell script type program redragon7964 Linux - Newbie 1 04-06-2004 02:03 AM
Shell-Script check if $xx is of type integer d-fens Programming 5 07-11-2003 08:38 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:32 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration