O'Reilly logo

Linux® Command Line and Shell Scripting Bible by Richard Blum

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Appendix C. Comparing Shells

With the wealth of shells available in the Linux environment, sometimes it's hard to decide which shell best suits your needs. Other times you're limited to using a specific shell and need to determine which features that you use in shell scripts in your default shell are available in the new shell and which ones aren't supported. This appendix provides a quick comparison between the features of the different shells that are commonly used in the Linux environment.

Variables

Each shell supports environment and user-defined variables, but they differ on just how they support variables. This section describes the things you need to watch out for when working with variables in your shell scripts.

Environment variables

The bash, dash, ksh93, and zsh shells all use all uppercase letters for environment variables. The zsh shell provides both upper- and lower-case environment variables for the common variables, so if you refer to upper-case environment variables in your script, they'll work just fine in the zsh shell.

Unfortunately, the tcsh shell uses lower-case variables for special shell variables. However, it does provide a limited number of upper-case environment variables that match some of the basic Bourne shell environment variables to provide limited compatibility. If your shell script relies heavily on bash shell environment variables, you'll want to check to make sure that those variables are available in the tcsh shell.

One thing to watch out for is that ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required