Trying to write a basic shell script of the below question using GITBASH. Every time l try to run the code l get a syntax error, need help om how to fix this. below is the code.
Find the even multiples of any number chosen by the user in a given range – the user
should specify the multiples of which number they want to print and a minimum and maximum
value. The multiples printed should be within the [minimum, maximum] range. For example, if
the user choses the number 7 and would like to print all even multiples in the [15, 60] range, the
program should print all the even multiples that are bigger than or equal to 15 (minimum), but
smaller than or equal to 60 (maximum). The program should keep a count of how many numbers
were printed and should output that count, as well as the numbers. The output then, for the
example given, should be 28, 42, 56, and the count should be 3.
#.sh code
echo "Enter the number to find multiples:"
read num
echo "Enter the minimum and maximum range of values to display: "
read min max
echo
count=0 #initialize index to 0
for (( i=$min; i <= $max; i+=2 ))
do
echo result[$count]=$i # If the i value is divisible by the number given and i is even then i is stored in result array
((count++)) #Increment count value by 1
((i++)) #increment i value by 1
echo "Multiples in given range[$min,$max] : ${result[@]}" #Display the Multiples in the given range
echo "Count of multiples is $count" #Display the count of multiples in the given range
done
Step by stepSolved in 2 steps
- Regex. Using only the \D command with the “one or more” regex character appended and the “EXACTLY 5 character” {5} with the regex for digits, parse the following text string completely. You may need to use multiple character matches for the final solution. I didn't watch 80210 but I heard that it was a fun show.arrow_forwardWhich of the following is correct? O nlgn = 0(n) O 3n = 0(2") O nlgn = m(n) O 1000n2 = 0(n2)arrow_forwardNEED HELP WITH PYTHON CODE. ALSO, PLEASE PROVIDE DETAILS SEPARATELY ON HOW AND WHAT DID U USE TO GET UR CODE DONE.arrow_forward
- User Satisfaction team wants to send monthly summaries for each user. They need the following details with the user ID: The last day of the month when the users traveled most recently One week after the last day of the month when the users traveled most recently You need to return a three-column output with USER_ID, LAST_TRAVEL_MONTH and NOTIFICATION. LAST_TRAVEL_MONTH should be calculated using the MAX of the LAST_DAY of the TRAVEL_END_TIME field. Similarly, NOTIFICATION should be calculated with DATE_ADD function to add one week.arrow_forwardwith UNIX shellarrow_forward
- Computer Networking: A Top-Down Approach (7th Edi...Computer EngineeringISBN:9780133594140Author:James Kurose, Keith RossPublisher:PEARSONComputer Organization and Design MIPS Edition, Fi...Computer EngineeringISBN:9780124077263Author:David A. Patterson, John L. HennessyPublisher:Elsevier ScienceNetwork+ Guide to Networks (MindTap Course List)Computer EngineeringISBN:9781337569330Author:Jill West, Tamara Dean, Jean AndrewsPublisher:Cengage Learning
- Concepts of Database ManagementComputer EngineeringISBN:9781337093422Author:Joy L. Starks, Philip J. Pratt, Mary Z. LastPublisher:Cengage LearningPrelude to ProgrammingComputer EngineeringISBN:9780133750423Author:VENIT, StewartPublisher:Pearson EducationSc Business Data Communications and Networking, T...Computer EngineeringISBN:9781119368830Author:FITZGERALDPublisher:WILEY