Bash shell script to check a given number is positive or negative
kw.sh
#!/bin/bashecho"———————————————————————————————————————————"echo"Script to check a given number is +ve or -ve "echo"———————————————————————————————————————————"echo"Enter the number \c";read a
b=0
if[$a-gt$b];then
echo"Entered number is positive"elif[$a-eq$b];then
echo"Entered number is zero"else
echo"Entered number is negative"fi
echo"———————————————————————————————————————————"
Output
kodingwindow@kw:~$ bash kw.sh
———————————————————————————————————————————
Script to check a given number is +ve or -ve
———————————————————————————————————————————
Enter the number -50
Entered number is negative
———————————————————————————————————————————
kodingwindow@kw:~$ sh kw.sh
———————————————————————————————————————————
Script to check a given number is +ve or -ve
———————————————————————————————————————————
Enter the number 0
Entered number is zero
———————————————————————————————————————————
kodingwindow@kw:~$
Dear User, Thank you for visitng Kodingwindow. If you are interested in technical articles, latest technologies, and our journey further, please follow us on LinkedIn.
Dear User, We are grateful for your interest in the Kodingwindow Android app. We intend to soon make it available on the Google Play Store. Currently, Android versions 10 and up require manual apk installations. Would you like to get the app?