View Single Post
  #8   (View Single Post)  
Old 1st December 2008
lvlamb's Avatar
lvlamb lvlamb is offline
Real Name: Louis V. Lambrecht
Spam Deminer
 
Join Date: May 2008
Location: .be
Posts: 221
Default

BIG caveat: a default shell can be many.
On my OpenBSD system:
Code:
ls -al /bin | grep sh
-r-xr-xr-x   1 root  bin    355024 Oct 29 21:23 csh
-r-xr-xr-x   3 root  bin    403536 Oct 29 21:24 ksh
-r-xr-xr-x   3 root  bin    403536 Oct 29 21:24 rksh
-r-xr-xr-x   3 root  bin    403536 Oct 29 21:24 sh
-r-xr-xr-x   5 root  bin    138768 Oct 29 21:24 sha1
So, same code for the three sh, ksh, rksh
As, formerly in Linux sh/bash.

Now, scripts lin Linux starting with #!/bin/sh usually invoked the bash interpreter with the POSIX flag set.
This is changing on Debians (Lenny, Ubuntu) as the #!/bin/sh now invokes the dash (Debian Almquist shell).
http://packages.debian.org/search?ar...0&keywords=ash

I *assume* (assumptions are the mother of all f*ck-ups) that an OpenBSD rksh would (with some flags set in the code) invoke ksh (which is Public Domain ksh, not the 1993 AT&T ksh as on FreeBSD's ksh) with the restricted shell:
Quote:
The rksh or ksh -r command opens the Restricted Korn Shell. The behavior of these commands is identical to those of the ksh command, except that the following actions are not allowed:

* Change the current working directory
* Set the value of the SHELL, ENV, or PATH variables
* Specify the pathname of a command containing a / (slash)
* Redirect output of a command with > (right caret), >| (right caret, pipe symbol), <> (left caret, right caret), or >> (two right carets).
http://publib.boulder.ibm.com/infoce...cmds4/rksh.htm
Not excatly knowing what involing /bin/sh in OpenBSD would result in.


So, consider that under *any* operating system, the base shell is *undefined* at best, unless you know all the switches of your local installed variant.

Amazes me as, as for the fdisk, these are basic pieces of programing which makes your system work or break. And the less pieces which are takem into account, or at the least plainly *understood*.
__________________
da more I know I know I know nuttin'
Reply With Quote