I’ve been wanting to learn to write shell scripts for a while now. I always seem to find myself needing or wanting to download multiple files in sequence without having to sit in front of the computer screen for half an hour doing so. I have previous programming experience with Java, but never got around to shell scripting. Now I have. Here’s a simple example of what I’ve done.
# My first shell script
for (( c=0; c<=100; c++ ))
do echo "LOOPY $c!" >> /home/file.txt
This creates a text file with LOOPY 1! and 2 and 3 and so forth. This is particularly handy to do with URLs, since wget can download files in sequence from a text file:
wget -i /home/file.txt
Yeah. It’s handy. I’ll be putting up a post about LaTeX too, which I’ve been working with for the past 24 hours now.