Pages

Tuesday, March 19, 2013

Write a script to check the givn number is positive or negative?


$vi pos_neg.sh
echo “enter a number: “
read n
if [ $n gt 0 ]
then
echo “entered number : positive number”
else
echo “entered number : negative number”
fi
:wq

No comments:

Post a Comment