Question

Question I This question carries 20% of the marks for this assignment. You are asked to...

Question I

This question carries 20% of the marks for this assignment.

You are asked to develop a set of bash shell script:

  1. Write a script that asks for the user's salary per month. If it is less or equals to 800, print a message saying that you need to get another job to increase your income, what you earn is the Minim living cost. If the user's salary is higher than 800 and below 2000, print a message telling the user that your income is just right to cover your expenses. [10 marks]
  2. Write a script that takes exactly one argument, a file name. If the number of arguments is more or less than one, print a usage message. If the argument is not a file name, print another message. For the given file, print on the screen its content. [5 marks]
  3. Write a script that does the following [5 marks]
  • Display the name of the script being executed.
  • Display the second, third and fifth argument given to the script.
  • Display the total number of arguments passed to the script.
  • Print all the values of the remaining arguments.
  • Print the number of arguments

Homework Answers

Answer #1

2)

3)

comment if any doubts

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
NOTE: I just need the answer for question 5 and 6. I already knew the question...
NOTE: I just need the answer for question 5 and 6. I already knew the question 1-4, and wrote down all the requirements for clarification. In this assignment, you are required to write a Bash script, call it assignment2.sh. Your Bash script has to accept at least four input arguments, and must: 1) Print to the user a set of instructions explaining how the PATH variable can be used in Bash. 2) Save the manual of the 'awk' command in...
In UNIX .Write a bash script that takes a list of usernames as its command line...
In UNIX .Write a bash script that takes a list of usernames as its command line arguments and displays on the screen, for each user name, a message of the form Number of times that logged into this machine is where is to be replaced by the number of recors that the last command output that match exactly. For example, if i enter command logincount mark it should output something like number of times that sweiss logged into this machin...
Bash script Suppose you are working as a prof or TA and your students have an...
Bash script Suppose you are working as a prof or TA and your students have an assignment which requires them each to hand in exactly one file. You've got a directory with all of the submitted files in it, and no other files. You're also lucky enough to have a script that will do all the work of marking a submission; it will take the name of a submission file as its only parameter and will print out a single...
Subject: Shell Scripting Practice A File: practice-script-a Create File practice-script-a that: 1. Accepts any number of...
Subject: Shell Scripting Practice A File: practice-script-a Create File practice-script-a that: 1. Accepts any number of userids on the command line 2. For each userid, display the userid, PID, CPU time, and current command for each process owned by that userid Your output should look similar to this example: practice-script-a doug.jones User: doug.jones PID: 8748 TIME: 00:00:00 COMMAND: /usr/lib/systemd/systemd --user User: doug.jones PID: 8749 TIME: 00:00:00 COMMAND: (sd-pam)    User: doug.jones PID: 8750 TIME: 00:00:00 COMMAND: sshd: doug.jones@pts/5 User: doug.jones...
You are working for a company that offers driver licence training and you have been asked...
You are working for a company that offers driver licence training and you have been asked to write a script that asks your clients how old they are. If he/she is 16 years old display the message "Please visit our company to take the test!" If he/she is 15 years old display the message "Please take the training with us to learn how to drive!" If he/she enters any other answer display the message. "Please visit out website to see...
write a script named print_lines.sh that uses head and tail together to print out a specific...
write a script named print_lines.sh that uses head and tail together to print out a specific set of lines from a file. The script should take three arguments: the line number to start at, the line number to stop at, and the file to use. Here's an example run: [user@localhost ~]$ print_lines.sh 7 10 /etc/passwd shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown halt:x:7:0:halt:/sbin:/sbin/halt mail:x:8:12:mail:/var/spool/mail:/sbin/nologin operator:x:11:0:operator:/root:/sbin/nologin [user@localhost ~]$ In this example, the script prints line 7 through 10 (inclusive) of the /etc/passwd file. Your script must do...
PLEASE DO QUICK LINUX ASSIGNMENT PLEASE ILL THUMBS UP You need to paste the command and...
PLEASE DO QUICK LINUX ASSIGNMENT PLEASE ILL THUMBS UP You need to paste the command and the output in a word document and submit it. Part1: 1. Log in to Linux using your user account name and password. 2. If you logged in using a graphical login screen, open a terminal window by clicking on the icon in the lower left corner of the desktop to open the main menu, then selecting System Tools, then Terminal. A terminal window opens....
I cannot upload the needed text files to this question for your benefit of double checking...
I cannot upload the needed text files to this question for your benefit of double checking your solution, but I need help on this multi part question. Thanks! Write a Python program that will open the ‘steam.csv’ file. Your program should load the data as col- umns corresponding to the variable names located in the first row (You can hard code this – i.e open the file and use the names in the first row as variable names). You should...
Consider you have opened MS Word to write your assignment in File1, you write your name...
Consider you have opened MS Word to write your assignment in File1, you write your name and registration no. and now to copy questions you need to open Question File to copy questions from that file in to File 1. After copying Questions you have started typing answers. After completing the assignment File 1, you wants to print the document for which you need communication service routine as well. Considering the above scenario, is there any interrupts/system calls occurred? If...
Save your select statements as a script. Place the semicolon at the end of each SQL...
Save your select statements as a script. Place the semicolon at the end of each SQL statement. Please number your select statements from 1 to 8 in your script and comment out each number. Include your name and student number as a comment at the top of your script. The name of the script has to be Assignment1_JohnSmith. Instead of JohnSmith use your First Name and Last Name. Upload your script trough Blackboard. Use SQL Developer to create the My...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT