Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between bash,ksh,tcsh and zsh

Tags:

linux

shell

posix

Consider the following shell code:

unset foo
echo "${foo-'}'}"

The result depends on which shell is used:

  • bash: '}'
  • ksh: ''}
  • tcsh: Missing }.
  • zsh: ''}

Which shell(s) behave(s) according to the POSIX standard?

like image 507
l00p Avatar asked Oct 26 '17 10:10

l00p


People also ask

What is the difference between Bash and zsh?

Bash uses backslash escapes. Zsh uses percentage escapes. Bash doesn't have an inline wildcard expansion. Zsh has a built-in wildcard expansion.

What is difference between ksh and Bash?

Bash stands for Bourne Again Shell which is a clone of Bourne shell. It is licensed under GNU so it is open source and is available for free for the general public whereas KSH stands for Korn shell which was developed by David Korn which merges the features of many shells like Bourne shell, C shell, TC shell, etc.

What is ksh and zsh?

ksh tend to be the default or at least the standard compliant shell on many Unix like Solaris, AIX, HP-UX while zsh is often only an optional shell that needs to be installed separately.

What is better tcsh or Bash?

Tcsh: different shell and environment variables can have same name! Tcsh: why is there a ' path ' shell variable? Bash: file descriptors can be used! (Ba)sh: scripts are everywhere and are considered better!


1 Answers

A POSIX-compliant shell should output:

''}
like image 153
user1934428 Avatar answered Sep 30 '22 16:09

user1934428