
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN: 9780133594140
Author: James Kurose, Keith Ross
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Question

Transcribed Image Text:Write a shell script that prompts user to enter a negative integer. If the user enters a positive integer or 0,
the shell script will continuously prompt the user to enter a negative integer until a negative integer is
entered and read. The shell will then print the accepted negative integer to the terminal. [
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by stepSolved in 3 steps with 2 images

Knowledge Booster
Similar questions
- Write a shell script that prompts the user for a grade between 0 and 100. The shellscript should calculate the corresponding letter for this grade based on the followingcriteria:0–49 = F50–59 =D60–69 = C70–79= B80–100 = AEnsure that the shell script continues to prompt the user for grades until the userchooses to exit the shell script.arrow_forwardQUESTION 3: Execute the given program in MARS and answer the following short questions. .text main: li $a0,5 jal func1 li $v0,1 syscall j func3 func1: addiu $sp, $sp, -8 sw $ra, 4($sp) sw $a0, 0($sp) addi $a0,$a0,5 jal func2 Iw $a0, 0($sp) Iw $ra, 4($sp) jr $ra func2: addi $a0,$a0,5 jr $ra func3: li $v0,10 syscall i. What do we need to decrement $sp by 8 in the instruction addiu $sp, $sp,-8? ii. What is the value of $a0 at the end of func2? At the end of program, the value of $a0 is 5 (printed on screen). Why? iii. func1 is supposed to free-up stack before it returns back to the caller. Write down the instruction we must use to free-up stack. iv. The program will not terminate properly if we remove the instruction Iw $ra, 4($sp). Why? v. Make changes in this program to use jalr instead of jal. Write down your changes here.arrow_forwardIn terminal Bob enters below: A="Hello" B="CST8207" echo $AB -What would be the output? АВ Hello CST8207 O Nothing HelloBarrow_forward
- Write a script to prompt the user for his/her name (name) and an integer (num). Create a menu with 4 options that loops until the user enters 4 to quit. Options 1-3 call functions odd(num), calculation(name, num), and printname(name, num). Anything but the integers 1-4 output Invalid input and re display the menu. odd(num) prints the odd numbers from 1 to num inclusive (10 numbers on a line) calculation(name, num) returns the length of name times num printname(name, num) prints name num times use if __name__ == '__main__': to include everything but the functions so zybooks can test each function individuallyarrow_forwardQ1. A script that can be used as a calculator with four major operations, i.e. “+-/*”. The script reads two integers and one operator from command-line argument and prints out the result. For instance: ./calculator.sh 32 – 20 Answer: 12arrow_forwardUsing the default IDLE shell for Python, please create the following program: (I am not using the terminal app to write this code.) Write a python program that asks the user for a number in the range of 1 through 7. The program should display the corresponding day of the week, where: 1 = Monday 2 = Tuesday 3 = Wednesday 4 = Thursday 5 = Friday 6 = Saturday 7 = Sunday The program should display an error message if the user enters a number that is outside the range of 1 through 7.arrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- 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

Computer Networking: A Top-Down Approach (7th Edi...
Computer Engineering
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:PEARSON

Computer Organization and Design MIPS Edition, Fi...
Computer Engineering
ISBN:9780124077263
Author:David A. Patterson, John L. Hennessy
Publisher:Elsevier Science

Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:9781337569330
Author:Jill West, Tamara Dean, Jean Andrews
Publisher:Cengage Learning

Concepts of Database Management
Computer Engineering
ISBN:9781337093422
Author:Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:Cengage Learning

Prelude to Programming
Computer Engineering
ISBN:9780133750423
Author:VENIT, Stewart
Publisher:Pearson Education

Sc Business Data Communications and Networking, T...
Computer Engineering
ISBN:9781119368830
Author:FITZGERALD
Publisher:WILEY