
Mar 30, 2009

A sequential for loop in bash script is accomplished in the following example:
for i in {1..100}
do
# Do something here
echo "${i}"
done
This example iterates from 1 to 100 (inclusive) and prints the index number.
Note: This only works in modern versions of bash (3.x+).

Mar 23, 2009

It is possible to empty the trash in OS X from the command line by running the following command in the terminal:
rm -Rf ~/.Trash/*
This command permanently removes all the files you have placed in your OS X trash bin.

Mar 14, 2009
A fast bash based solution for executing a find on a directory with a lot of files that you want to log to a file:
find /my/data/ -name '*.xml' -type f -fprint my_xml_files.txt
This example looks in the /my/data/ directory for all files with the xml extension and then writes the results to the my_xml_files.txt file.