Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

4 . For a script file to run in a Linux shell, what permissions must the file have? Write down the command and options needed

4. For a script file to run in a Linux shell, what permissions must the file have?
Write down the command and options needed in your assignment.
5. Once a script has the permissions set, what are the three separate ways that would allow you to run that script? Which way allows you to debug your script?
Scripting Develop scripts using the following problem sets. Be sure to use comments in your scripts. It may be helpful to first write out the step by step process that you need to solve the problem BEFORE attempting to write the scripts. There are examples in the PowerPoint lecture.
6. Create a script that asks the user for a file and then appends the date to the file the user has entered. Let the user know if the file can or cannot be written too. Also, if the file does not exist create the file and write the date in the newly created file. Lastly display to the user the file, including a statement letting them know that the file has changed.
(Hint: remember the f and w when evaluating a file in an if statement)
7. Create a script that takes two numbers as input from the user, and then asks the user if they would like to add or subtract the two numbers (use a case statement). Then print out the result in a friendly message to the screen. Be sure to let the user know if they choose an option that was not on the menu. (Hint: when evaluating the inputted values from the user, they must be represented as numerical data types.) Now modify your case statement so the user can use either an upper or lower case letter in the menu. That is if the user types a or A both will allow the case statement to run the add selection. (Hint: use | as the or operator)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions