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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
11-09-2005, 11:49 AM
|
#1
|
|
LQ Newbie
Registered: Nov 2005
Location: Philadelphia, Pa
Posts: 7
Rep:
|
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
|
|
|
|
11-09-2005, 11:51 AM
|
#2
|
|
Moderator
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 42,711
|
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.
|
|
|
|
11-09-2005, 11:55 AM
|
#3
|
|
LQ Newbie
Registered: Nov 2005
Location: Philadelphia, Pa
Posts: 7
Original Poster
Rep:
|
So the sh is newer, better, more compatabile or all three?
- MT
|
|
|
|
11-09-2005, 12:00 PM
|
#4
|
|
Member
Registered: Apr 2005
Location: Perth, Western Australia
Distribution: Debian
Posts: 233
Rep:
|
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.
|
|
|
|
11-09-2005, 12:03 PM
|
#5
|
|
LQ Newbie
Registered: Nov 2005
Location: Philadelphia, Pa
Posts: 7
Original Poster
Rep:
|
Cool... thanks for the help.
- MT
|
|
|
|
11-09-2005, 12:10 PM
|
#6
|
|
Guru
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298
Rep:
|
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.
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 01:38 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|