Section 9 – Lab Work part 1 Challenge Lab To complete this challenge lab, write a script, using an “if” statement or “case” statement to solve the challenges below. NOTE: You MUST name your scripts as...

1 answer below »
j


Section 9 – Lab Work part 1 Challenge Lab To complete this challenge lab, write a script, using an “if” statement or “case” statement to solve the challenges below. NOTE: You MUST name your scripts as specified below! NOTE: You MUST complete at least 3 of the 5 scripts. Once you have completed the scripts, use Filezilla to transfer them and upload them into Moodle. 1. Write a script that will ask the user for 1 number, between 1 and 100. Test to see if the number is within the boundaries and let the user know if it is out of bounds. Script name: section9.1.1.sh 2. Write a script that will take one numeric argument from the command line (argument/parameter) and look to see if the number is greater than 1000. If the number is greater than 1000, tell the user. If the number is less than 1000 tell the user that the number is less than 1000. Script name: section9.1.2.sh 3. Write a script that will ask the user for one of four words, even, odd, zero, negative. Evaluate the word and branch based on the word, telling the user exactly the word they choose. If they did not enter an approved word, let the user know. Script name: section9.1.3.sh 4. Using the script from challenge question 3, take into account the possibility that the user could enter all uppercase letters, or an uppercase first letters and the remaining lowercase. Script name: section9.1.4.sh 5. Write a script that will evaluate the number of command line parameters given. If the user did not give any parameters, let the user know, otherwise let the user know the number that were given, and what the parameters were. Script name: section9.1.5.sh
Answered Same DayMar 12, 2022

Answer To: Section 9 – Lab Work part 1 Challenge Lab To complete this challenge lab, write a script, using an...

Neha answered on Mar 13 2022
114 Votes
Question 1
#!/bin/bash
echo "Enter a number between 1 and 100: "
read num
if (num>=1 && num<=100
);
then
echo "You entered:"$num
else
echo "Number is out of bounds!"
fi
Question 2
#!/bin/bash
echo "Enter a number less than 1000: "
read num
if (num>=1000);
then
echo $num" is greater than 1000"
else
echo $num" is less than 1000"
fi
Question 3
#!/bin/bash
echo "Enter any of these words: words, even, odd, zero, negative"
while :
do
read str
case $str in
words)
echo "You chose: " $str
break
;;
even)
echo "You chose: " $str
break
;;
...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here