Bourne Shell

This page is relevant to all Bourne Shell derivatives. This includes:
  • Bourne Shell (sh)
  • Bourne Again Shell (bash)
  • Korn Shell (ksh)
  • Z Shell (zsh)
  • Almquist Shell (ash)
  • Debian Almquist Shell (dash)
Includes: if, select, case
Includes: tail, vim, sed, grep, awk, q

Version

bash --version

On AIX you cannot readily see the version of ksh but you can see the version of the installed bos.rte.shell package...

lslpp -L | grep ksh

Shell Prompt

The prompt is defined by the $PS1 environment variable

Which Shell is being used?

ps -p $$

The Different Shells


/bin/sh is the "default" shell and is assumed to be POSIX compliant. In Linux /bin/sh is often symbolically linked to bash but this should not be assumed. i.e. don't start your script with #!/bin/sh and then use bash specific features as you are likely to be caught out. For example, recent versions of Ubuntu link /bin/sh to a POSIX compliant lightweight shell variant call dash rather than bash.

Z Shell (zsh)

Bibliography