Hi, im taking a basic course in UNIX programing and I dont get any of it. Im hav
ID: 3529957 • Letter: H
Question
Hi, im taking a basic course in UNIX programing and I dont get any of it. Im having trouble with this hw. Write a script named range which will print all the integers between a lower and maximum value that the user should provide as arguments. For example: $ range 5 13 5 6 7 8 9 10 11 12 13 $ $ range 22 17 22 21 20 19 18 17 $ Your script should take exactly two arguments. In a different case, it should inform the user about the correct usage and quit. $ range 6 Usage: range $ Notice that if the first argument is less than the second, the numbers are printed in ascending order. In the opposite case, they are printed in descending order.Explanation / Answer
read a,b if [ $a -gt $b ] then while [ $a -ne $b ] do echo $a a=`expr $a-1` done fi if [$a -lt $b ] then while [ $a -ne $b ] do echo $a a=`expr $a+1` done fi
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.