Showing posts with label shell programming. Show all posts
Showing posts with label shell programming. Show all posts
Wednesday, November 18, 2009
Monday, November 2, 2009
shell programming
for:
for (( i = 0; i < 10; i++ )) #pay attention to the spaces!!!
do
echo ${i}
done
if:
a=3
if [ $a -lt 2 ] ; # the ;
then
echo $a;
fi
add:
a=3
b=4
c=$(( a + b )) #with $(( )), no $ is needed
echo $c
Some other possibilities to do addition: let key word!
for (( i = 0; i < 10; i++ )) #pay attention to the spaces!!!
do
echo ${i}
done
if:
a=3
if [ $a -lt 2 ] ; # the ;
then
echo $a;
fi
add:
a=3
b=4
c=$(( a + b )) #with $(( )), no $ is needed
echo $c
Some other possibilities to do addition: let key word!
let count=count+1
let "count+=1"
let "count++"
Subscribe to:
Posts (Atom)