Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Speaking of sh and bash...' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Speaking of sh and bash...
Authored by: red6rick on May 12, '04 08:08:10PM

If you read the man page for bash, you'll find that it behaves differently when invoked as "sh" than when invoked as "bash". The behavior in "sh" invocation closely mimics the original sh.



[ Reply to This | # ]
Speaking of sh and bash...
Authored by: cynikal on May 13, '04 07:27:02PM

*sigh*.. fyi, i've rtfm before, have you?

if you paid more attention to what I wrote:

==<cynikal@cynsys>-<ttyp2>-<1919:50>==
--[~]-- $ sh
sh-2.05b$ ls -ld $(pwd)
drwxr-xr-x 49 cynikal cynikal 1666 13 May 00:32 /Users/cynikal/

this is NOT SH SYNTAX!!! it's BASH ONLY syntax.. with sh, only ls -ld `pwd` should work!

My original point is that people don't bother checking their scripts compatibility on systems with real sh's such as Solaris.. and please don't point me to /usr/xpg4/bin/sh, i don't want to have to modify all these broken scripts.



[ Reply to This | # ]
Speaking of sh and bash...
Authored by: LC on May 16, '04 04:13:59PM

I recall AIX utilizing a ksh as sh; I recall HP-UX providing restricted and Bourne or sh-Posix modes.
I believe that the Posix specs probably define what sh is required to do and that it's not specifically Bourne.
What era are we concerned with ... UNIX95, UNIX98, X/Open etc. Larry.



[ Reply to This | # ]