I'd like to brush up on my knowledge of Shell scripting with Bash for a job interview Monday.
What would the preferred book be for someone with an existing knowledge looking to review the topic?
I'd like to brush up on my knowledge of Shell scripting with Bash for a job interview Monday.
What would the preferred book be for someone with an existing knowledge looking to review the topic?
bash Cookbook, by Carl Albing, JP Vossen & Cameron Newham
O'Reilly ISBN 10: 0-596-52678-4
The best reference for someone with some experience would be BashGuide by Lhunath.
It teaches current best practices for modern Bash shells:
[[ $var ]]
vs [ $var ]
or test $var
{ command1 && command2; } || command3
cmd <<< foo
vs echo foo | cmd
var=foobar; echo ${var//o/O}
=> fOObar
for i in {1..10}
(instead of using seq
or jot
)if grep foo file
vs if [[ $(grep foo file) -eq 0 ]]
It would be wise to avoid the often-referenced Advanced Bash Scripting guide; most of the examples there are misleading or antiquated.
BashPitfalls and BashFAQ are also particularly helpful if you are already very familiar with POSIX Bourne shell scripting.
Finally, if you're not averse to concise documentation, go straight to my favorite source: man bash
. It's quite readable if you've been using a shell for some time. And if you need to maintain compatibility with older versions of bash, Chet Ramey keeps a version history here: http://tiswww.case.edu/php/chet/bash/CHANGES
There's nothing like going directly to the Bash maintainer.
Here's his FAQ.
And an online version of the info file.
I used this as a reference book when I learned BASH scripting. I thought it was extremely useful, even after the learning period
I usually wouldn't suggest man pages, however in this case typing 'man bash' not a bad option especially worth a quick read before you do a technical test. I'd also recommend the o'reilly sed & awk book (http://www.amazon.com/sed-awk-2nd-Arnold-Robbins/dp/1565922255), as I guess if you're working in bash, awk will be frequently used. Also http://www.vectorsite.net/tsawk.html is a good place a start with awk.