BASH Programming

March 1, 2007 by hejian

Conditionals

if [ ! -d $DESTDIR ]; then
mkdir $DESTDIR
fi

Loop
for:

for i in $(ls); do
echo item: $i
done

while:

while [ 1 ]; do
……
done

Test return value

if [ $? -ne 0 ]; then

Leave a Reply

You must be logged in to post a comment.

Wordpress template made by HeJian