From charlesreid1

Revision as of 08:44, 4 October 2010 by Admin (talk | contribs) (→‎Tricks)

Bash Guide

Startup Process

Dot Files

Tricks

Looping

Looping in bash is really simple, and convenient - you can use other unix commands (most obviously "ls") to create lists, and then loop over each element of those lists. For example, if I want to print out the name of every file in my home directory (granted, not very useful, but this is just an example), I can do this:

for i in `/bin/ls -1 $HOME`; do
    echo $i
done

Math