Real World Shell Scripting

Media_httpac22001comp_zkkcf
Just to prove to you that shell scripts do come in handy as a way to save time and make a boring job into somethin more fun, here is a little script called wikify.sh that I used today to manipulate a file containing a list of papers into an unordered list for inserting into a wiki page. The papers were of the following form:
ito2008digital.youth.pdf
and I wanted them to be like this instead:
* [[ito2008digital.youth]]
Which involves cutting of the .pdf ending and putting two whitespaces a star and double square brackets around the filename. Because there were more than a thousand papers in the list I obviously didn't want to do this by hand, which would have been both time consuming and boring, instead I used this:
Posted
 

Bash Quoting

Media_httpac22001comp_tkfqr
I found a couple of articles over at the Linux Journal that will give you a bit more understanding of the wonders of quoting in Bash. The first article will probably be of more use to you as it deals with the basic of quotes in scripts whereas the second article deals more with the intricacies of quoting within scripts, in their example, scripting interaction with a MySQL database.
Posted