Question

Q2) Write a shell script program to read a number then checks the number using the...

Q2) Write a shell script program to read a number then checks the number using the following:

If the number is =100 print (number is equal to 100)

If the number is>100 print( number is less than 100)

If the number is<100 print( number is greater than 100)

0 0
Add a comment Improve this question Transcribed image text
Answer #1

vi editor code in shell script.

echo Enter a number read >x if [ $x -eq 100 ] then echo number is equal to 100 elif I $x -1t 100 ] then echo number is l

Output

[root@loc alhost ~]# ./file.sh Enter a number 20 number is less than 100 [root@loc alhost ~]# ./file.sh Enter a number 100 nu

Add a comment
Know the answer?
Add Answer to:
Q2) Write a shell script program to read a number then checks the number using the...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT