LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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
 
LinkBack Search this Thread
Old 11-09-2005, 11:49 AM   #1
mTorbin
LQ Newbie
 
Registered: Nov 2005
Location: Philadelphia, Pa
Posts: 7

Rep: Reputation: 0
What is the difference between #!/bin/bash and #!/bin/sh?


This is in reference to cron jobs. I'm going to attempt to write my own cron into cron.monthly and some files use the /bash and others use /sh. Which one do I need and where? What is the difference?

Thanks,

- MT
 
Old 11-09-2005, 11:51 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,344

Rep: Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945
they are just different shell interpreters, but they are very very close. you can use either and you'll be fine, but stick with sh for more compatability with other shells.
 
Old 11-09-2005, 11:55 AM   #3
mTorbin
LQ Newbie
 
Registered: Nov 2005
Location: Philadelphia, Pa
Posts: 7

Original Poster
Rep: Reputation: 0
So the sh is newer, better, more compatabile or all three?

- MT
 
Old 11-09-2005, 12:00 PM   #4
Ynot Irucrem
Member
 
Registered: Apr 2005
Location: Perth, Western Australia
Distribution: Debian
Posts: 233

Rep: Reputation: 30
bash has more features, and includes everything provided by sh, hence sh is faster, but most distros got rid of sh completely and made /bin/sh a symlink to /bin/bash, so there won't be a difference.
 
Old 11-09-2005, 12:03 PM   #5
mTorbin
LQ Newbie
 
Registered: Nov 2005
Location: Philadelphia, Pa
Posts: 7

Original Poster
Rep: Reputation: 0
Cool... thanks for the help.

- MT
 
Old 11-09-2005, 12:10 PM   #6
reddazz
Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 73
Quote:
Originally posted by mTorbin
So the sh is newer, better, more compatabile or all three?

- MT
sh is the original bourne shell so is older than bash, On most Linux distros /bin/sh is actually a symlink to /bin/bash.
 
  


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Error when starting up snort: bash:!/bin/sh/usr/local/bin/snort :Eent not found cynthia_thomas Linux - Software 1 11-11-2005 02:59 PM
/tools/bin/env: /tools/bin/bash: No such file or directory DaZjorz Linux From Scratch 21 07-27-2005 07:11 AM
Change /bin/bash to /bin/zsh Smokey Slackware 12 07-14-2004 01:06 AM
why did bash 2.05b install delete /bin/bash & "/bin/sh -> bash"? johnpipe Linux - Software 2 06-06-2004 06:42 PM
bin/bash:usr/bin/lpr NO SUCH FILE OR DIRECTORY Adibe_Hamm Linux - Newbie 3 10-14-2003 02:30 AM


All times are GMT -5. The time now is 08:55 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