Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
23 views1 page

U 8

The script prompts the user to enter a number and checks whether it is positive, negative, or zero. It uses conditional statements to evaluate the input and outputs the corresponding result. The script demonstrates functionality with sample outputs for various inputs.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views1 page

U 8

The script prompts the user to enter a number and checks whether it is positive, negative, or zero. It uses conditional statements to evaluate the input and outputs the corresponding result. The script demonstrates functionality with sample outputs for various inputs.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

--script to accept a number and check the given no is +ve or -ve

echo "enter"
read n
if [ $n -eq 0 ]
then
echo "=0"
elif [ $n -gt 0 ]
then
echo "+ve"
else
echo "-ve"
fi
--o/p
[chandra@localhost ~]$ sh u
enter
2
+ve
[chandra@localhost ~]$ sh u
enter
0
=0
[chandra@localhost ~]$ sh u
enter
-5
-ve

You might also like