jot it up


While reading through UNIX powertools tonight, I came across jot. This nifty little utility will print a sequence of numbers, which can be used to iterate through a loop:

for i in `jot 5`; do
    echo $i
done

Using jot in this way is typically faster than other mechanisms (e.g., i=expr $i+1), and is easier to read IMHO. Jot it up yizos!

This article was posted by Matty on 2006-01-28 00:08:00 -0400 -0400