LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 06-12-2003, 11:43 AM   #1
hamiltonj
LQ Newbie
 
Registered: Jun 2003
Posts: 1

Rep: Reputation: 0
Choosing a shell..


Hi all,

I have just installed SuSE 7.2 Linux with a view to using it as a test platform for my shell scripts which would run on a production HP-UX box.

Unfortunately I have only now discovered the porting issues relating to UNIX shell scripts.

In order to try and get the things working I have been trying to use a Bourne Shell (something I read somewhere suggested this was the most portable- plus this is what is used on the HP-UX box where the scripts were originally devised).

Unfortunately the /bin/sh entry looks like this:

/bin/sh -> /bin/bash

What does this mean??? From my C I guess this indicates that /bin/sh is just a pointer to /bin/bash? Is that right?

I read somewhere else that the /bin/ash shell is a 'Linux substitute' for the Bourne shell, but setting #! /bin/ash at the start of my shell script gives a 'file not found' error??

Any hints or tips??

TIA
James.
 
Old 06-12-2003, 11:50 AM   #2
tcaptain
LQ Addict
 
Registered: Jul 2002
Location: Montreal
Distribution: Gentoo 2004 from stage 1 baby!
Posts: 1,403

Rep: Reputation: 45
never heard of ash...

but otherwise when you see /bin/sh->/bin/bash that's a symlink to the file /bin/bash....so yeah, conceptually its like a pointer..when you run /bin/sh, you're actually running /bin/bash instead.

IIRC Bash stands for Bourne Again SHell...so I'm figuring THAT'S a bourne shell subsitute/enhancement in linux...
 
Old 06-12-2003, 12:09 PM   #3
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
Re: Choosing a shell..

Quote:
Originally posted by hamiltonj
I read somewhere else that the /bin/ash shell is a 'Linux substitute' for the Bourne shell, but setting #! /bin/ash at the start of my shell script gives a 'file not found' error??
Is it installed? Do you have a ash located in /bin ? Most likely by the error you don't have the ash shell installed.
 
Old 06-12-2003, 03:17 PM   #4
Artimus
Member
 
Registered: Feb 2003
Location: Wisconsin
Distribution: Slackware
Posts: 188

Rep: Reputation: 30
When /bin/bash is called as /bin/sh, it runs in kind of a compatibility mode, which basically emulates bourne

Secondly, ash is a seperate shell that you can install. If it says file not found, you obviously don't have it installed.

EDIT: Also, I think it should be #!/bin/ash and not #! /bin/ash. Spaces can make big differences. Even if it does work, I have yet to see a script where they put a space in it.

Last edited by Artimus; 06-12-2003 at 03:19 PM.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
need help choosing a distro Homer69 Linux - Newbie 17 11-11-2005 02:52 PM
'sh' shell - Actually calls legacy Bourne shell, or uses system default? Dtsazza Linux - Software 1 10-28-2005 09:20 AM
Choosing a Distro raspera Linux - Newbie 5 08-02-2005 04:16 PM
Choosing distro leonidg Linux - Distributions 4 03-24-2005 04:48 AM
Help choosing (there's to many) SevenForever Linux - Newbie 9 04-11-2004 04:13 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 12:45 AM.

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