I am currently using the bash shell but am a bit confused about man entries. For example the man entry for source (man source):

DESCRIPTION
  sh
     The exec command specified by the arguments is  executed  in...

  csh
     exec executes command in place of the current  she...

  ksh
     With the exec built-in, if arg is give...

There are entries for several shells but not for the bash shell. I know that bash stands for Bourne Again SHell so does this imply that the description for sh is the one that applies to bash?

Thanks

link|improve this question

Recall that sh is the Bourne shell, and bash is the Bourne-again shell. – eleven81 Feb 16 '10 at 14:33
feedback

3 Answers

up vote 1 down vote accepted

That man-page looks like it comes from a Unix (rather than Linux) system, like Solaris.

On Solaris, /bin/sh is the original Bourne shell, which lacks history, completion or the more advanced parameter substition that you'd find in ksh, POSIX and Bash shells. Also , command substitution can only be done with backticks, and not with $(command).

(Though if you have /usr/xpg4/bin earlier in your PATH, running 'sh' will get you the POSIX-compatible shell instead.)

As profjim says, use man bash for details of Bash syntax.

link|improve this answer
feedback

On many distros, sh is a link to bash, so yes running sh will give you bash, however it will be running in a restricted, sh-compatible mode. You can't rely on this without checking, though. sh might instead be a link to dash, or to its own binary.

For bash references, do man bash. Also look at the Bash Reference Manual and the Advanced Bash Scripting Guide.

link|improve this answer
feedback

If you're looking for help on a specific bash builtin, usually

help [builtin_name]

is what you want.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.