This book is excellent:
Sams Teach Yourself Shell Programming in 24 Hours (2nd Edition)
It received good reviews. Here's my personal review from Amazon.com:
This is probably one of the best books by Sams that I've read. If you want to start shell programming, you've picked up the perfect book, even if you're new to Unix. It starts off by first getting you familiar with the basic Unix commands: ls, pwd, cp, mv, cat, etc. and telling you the basics of Unix and Shells. Then it goes over file systems and modifying attributes. Later when you're comfortable, it holds your hand through the shell programming syntax, logic, substititution, regular expressions, and essential tools such as awk and sed. This book contains other gems and snippets that have helped me through many projects. Overall good buy
If you want to learn Perl, I suggest "Beginning Perl by Simon Cozens, Peter Wainwright."
I prefer Wrox books over O'Reilly because Wrox tends to be more down to earth and friendlier when learning the material. O'Reilly books on the other hand, aren't as so... however they make good references. Also, most of the time Wrox books have more pages for the same price and are more visual (Wrox books contain more screenshots). In all the O'Reilly books that I've seen, most of it is text, and use very little diagrams.