Silly Scripts

Posted on Dec 24, 2009

It’s always been the case that small shell scripts are one of the things that makes using Unix a joy. Here’s last week’s invention, called num:

{% highlight sh %} #!/bin/sh

ln -s num 2

ln -s num 3

ln -s num 4

count=basename $0

loop=0 while [ $loop -lt $count ]; do eval $* loop=expr $loop + 1 done {% endhighlight %}