Sunday, August 26, 2012

Useful KSHs

a=-300
b=400
c=`expr $a \* $b`
if ( $c >= 0 )
then
echo "Postim\n"
else
echo "negative\n"
fi

---------------------
# this will move and archive the file

echo "starting    `date %y%m%d    `"

from="/local/app/bdsapp/src/TD/some.txt"

to="/local/app/bdsapp/src/TD/FTPed"

mv $from $to`date +%d-%b-%Y`

x=$?

echo "status is $x"

exit 0

-*------------------

#!/bin/sh

a=0
while [ "$a" -lt 10 ]    # this is loop1
do
   echo "A is now "$a
   a=`expr $a + 1`
done

###### Try Zone
#yyyy=2009
#mm=01
#dd=01;

#for mm in

#echo File is $mm;


#done
.----------------------


No comments:

Post a Comment