View Single Post
Old 21st August 2008
anomie's Avatar
anomie anomie is offline
Local
 
Join Date: Apr 2008
Location: Texas
Posts: 445
Default

Quote:
Originally Posted by Meta_Ridley
... ignorant Linux users, especially those who create software meant to be used on other Unix and Unix-like OSs, assume that the user will have bash installed and it will be in /bin/bash.
I'll admit to having made that mistake repeatedly myself years ago. My first intro to the unix-like world was Linux; it makes sense that one would initially believe that other unixes follow suit with their shell choices. Once I started playing around with Free/NetBSD and HP-UX I realized that semi-portable scripts would have to be written in sh.

As lvlamb has pointed out in a few different threads, /bin/sh is a symlink to /bin/bash on Linux boxes, and bash(1) says:
Quote:
If bash is invoked with the name sh, it tries to mimic the startup
behavior of historical versions of sh as closely as possible, while
conforming to the POSIX standard as well.
"Ignorant" probably is the correct word in this context. Given the proper information, most people will attempt to do the right thing. Now that I know what I know, I generally write shell scripts - even on Linux boxes - to use sh.
__________________
Kill your t.v.
Reply With Quote