Appendix B. If You Use a Different Shell
This book assumes your login shell is bash
, but if it’s not,
Table B-1 may help you adapt the book’s examples for other
shells. The checkmark symbol ✓ indicates compatibility—the given feature is similar enough to bash
’s that examples in the
book should run correctly. However, the feature’s behavior may differ
from bash
’s in other ways. Read any footnotes carefully.
Note
Regardless of which shell is your login shell, scripts that begin with
#!/bin/bash
are processed by bash
.
To experiment with another shell installed on your system, simply run
it by name (e.g., ksh
) and press Ctrl-D when finished. To change your
login shell, read man chsh
.
bash feature | dash | fish | ksh | tcsh | zsh |
---|---|---|---|---|---|
|
✓ |
✓, but |
✓ |
No equals sign: |
✓ |
Backgrounding with |
✓ |
✓ |
✓ |
✓ |
✓ |
|
|
|
|
|
|
|
|
|
|
|
|
|
/bin/dash |
/bin/fish |
/bin/ksh |
/bin/tcsh |
/bin/zsh |
|
|||||
Brace expansion with |
Use |
Only |
✓ |
Use |
✓ |
|
✓ |
✓ |
✓ |
✓ |
✓ |
|
✓ |
✓ |
✓ |
✓ |
✓ |
|
✓ |
|
✓ |
|
✓ |
Command substitution with |
✓ |
Use |
✓ |
Use backquotes |
✓ |
Command substitution with backquotes |
✓ |
Use |
✓ |
✓ |
✓ |
Command-line editing with arrow keys |
✓ |
✓a |
✓ |
✓ |
|
Command-line ... |
Get Efficient Linux at the Command Line now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.