Great Deal! Get Instant $10 FREE in Account on First Order + 10% Cashback on Every Order Order Now

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 »

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 XXXXXXXXXXScript 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
anch 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 Day Mar 12, 2022

Solution

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

eak
;;
even)
echo "You chose: " $st

eak
;;
...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here