for i in `ls -1r`; do
sh $i;
done;
It runs all shell scripts in the current directory. It translates out to this:
for every file 'i' in the current directory
call "sh i" (where i is the name of the file)
so, if you had a directory that had the following files:
bar.sh
e.sh
foo.sh
x.sh
it would execute
Code:
sh x.sh
sh foo.sh
sh e.sh
sh bar.sh
The -1r argument simply tells ls to list the files in reverse order, one per line.