tags:

views:

535

answers:

10

Hi, can anyone suggest me a book about linux shell programming?

Dazza

A: 

Which shell ? Standard POSIX sh one? Bash? Zsh? I'd recommend a book on POSIX shell because it is standard and it is better IMHO to use only standard features unless forced to.

See that one

Keltia
+14  A: 

For Linux you usually mean Bash.

The Advanced Bash Guide is really good: Link

Adam Hawes
A: 

This posting has quite a lot of links to Unix and Linux resources - in particular, the books by Mark Sobell go into shell programming in some depth.

ConcernedOfTunbridgeWells
A: 

pick Mastering Unix Shell Scripting if you need something more advanced, or if you prefer Korn shell (ksh93)

webwesen
A: 

If your using Bash, "Bash Cookbook" by O'Reilly is great

Kyle G
+2  A: 
Bill the Lizard
A: 

Bash (as programming language) is a specific one.

For example, did you ever wonder why there is no lint for bash code? :)

When learning bash, an important goal is to learn how to avoid pitfalls.

Bash Pitfalls will give you an idea about what I mean.

Anonymous
A: 

Bash is a good shell to learn. Several good references have been given. Bash is the default shell on linux, and is widely available on Unix...but it is not universal.

When learning shell programming, posix-sh remains the most portable variant to learn. In general, posix-sh scripts will run in bourne shell, bash, and ksh without modification. Because of that, posix-sh is (or perhaps "should be") preferred for doing any kind of system administration scripting.

I happen to like a few more creature comforts in my interactive shell, so I use the Korn Shell. Korn shell is almost the same as a posix-shell, so I can write shell scripts without having to translate syntax from my interactive shell to the script. The Korn Shell is the book I used to learn ksh, and continue to use for reference when the need arises.

I second the recommendation for Essential System Administration. This book contains a lot of examples of good shell scripts to accomplish common system administration tasks. The examples show some differences between the major flavors of Unix, but tend to stick to portable posix shell code.

semiuseless