1. Find where is the bash program located on your system and which version is it?...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
1. Find where is the bash program located on your system and which version is it? 2. Write a script using your favorite editor. The script should display the path to your home directory. Use the cat command to display that script. 3. Add comments in that script and display it to the terminal again. 4. Add information for the users of your script. 5. Change permissions on your script so that you can run it. 6. Run the script in normal mode and in debug mode. It should run without errors. 7. Make errors in your script: see what happens if you misspell commands. Check what the debug comments say about this. 8. Use an if/then/elif/else write a script named 'days.sh' that prints the number of days in the current month. Display it on the terminal by using the cat command then run it to make sure that it works correctly. 9. Write an interactive script that asks for the user's age. If it is equal to or higher than 21, print a message saying that this user is allowed to drink alcohol. If the user's age is below 21, print a message telling the user how many years he or she has to wait before legally being allowed to drink. Display your script on the terminal using the cat command. Run the script and give inputs 15, then 30. 10. Write a script that takes exactly one argument, a directory name. If the number of arguments is more or less than one, print a usage message. If the argument is not a directory, print another message. For the given directory, print the three biggest files and the three files that were most recently modified. Display your script on the terminal using the cat command. Test your script using arguments that cover two user error cases mentioned above. Then run your script with /usr/sbin as the input. 1. Find where is the bash program located on your system and which version is it? 2. Write a script using your favorite editor. The script should display the path to your home directory. Use the cat command to display that script. 3. Add comments in that script and display it to the terminal again. 4. Add information for the users of your script. 5. Change permissions on your script so that you can run it. 6. Run the script in normal mode and in debug mode. It should run without errors. 7. Make errors in your script: see what happens if you misspell commands. Check what the debug comments say about this. 8. Use an if/then/elif/else write a script named 'days.sh' that prints the number of days in the current month. Display it on the terminal by using the cat command then run it to make sure that it works correctly. 9. Write an interactive script that asks for the user's age. If it is equal to or higher than 21, print a message saying that this user is allowed to drink alcohol. If the user's age is below 21, print a message telling the user how many years he or she has to wait before legally being allowed to drink. Display your script on the terminal using the cat command. Run the script and give inputs 15, then 30. 10. Write a script that takes exactly one argument, a directory name. If the number of arguments is more or less than one, print a usage message. If the argument is not a directory, print another message. For the given directory, print the three biggest files and the three files that were most recently modified. Display your script on the terminal using the cat command. Test your script using arguments that cover two user error cases mentioned above. Then run your script with /usr/sbin as the input.
Expert Answer:
Related Book For
Posted Date:
Students also viewed these accounting questions
-
Check what the debug comments say about this. 8. Use an if/then/elif/else write a script named 'days.sh' that prints the number of days in the current month. Display it on the terminal by using the...
-
In Exercises, partition the given matrix so that you can apply one of the formulas from Exercises, and then calculate the inverse using that formula. a. b. 0001 0010 0132 1021 -4V2 V2 0 0
-
In a dream, you find that you can run at superhuman speeds, but there is also a resistant force that reduces your speed by one-half for each second that passes. Assume that the laws of physics still...
-
Use the Chain Rule to evaluate the partial derivative at the point specified. /u and /v at (u, v) = (1,1), where f(x, y, z) = x + yz, x = u + v, y = u + v, z , Z = uv
-
For the given functions f (x), let x0 = 1, x1 = 1.25, and x2 = 1.6. Construct interpolation polynomials of degree at most one and at most two to approximate f (1.4), and find the absolute error. a. f...
-
For the object whose motion is plotted in Fig. 2-2, find, as best you can, its instantaneous velocity at the following times: (a) 1.0 s, (b) 4.0 s, and (c) 10 s. Displacement along the y-axis (m) 12...
-
Setting the right price for a product is an important business decision. If the product is priced too high, the demand could be very low. Set the price too low, demand may be high, but we are...
-
Olive A/S, incorporated with an authorised capital consisting of one million ordinary shares of ¬1 each, employs 646 persons, of whom 428 work at the factor y and the rest at the head office. The...
-
A recently declared a dividend of $1.75, which is expected to growth at a constant 3.6%. If you could purchase the shares for $32.00, what rate of return could you earn?
-
Consider your school (university or college) as a production system in which the final product is a graduate. For this system: a. Define quality from the producers and customers perspectives. b....
-
The audited accounts of Possibility Limited at December 31, 2021, shows a profit of $4,200,000 after charging the following: Additional information: A. B. Depreciation Legal Fees Donations Bad Debts...
-
1. Tony stark is trying to talk pepper Potts into attending an event with him. Pepper does not want to attend because she feels that she and will be much older than most of the younger crowd...
-
Fickle Sickles collects 15,000 checks per 365-day year with average amount $170 and total delay 5 days. A lockbox system would reduce that delay to 3 days, and it would also reduce FISI's check...
-
- Fine office company produces two products P100 and P200. - Sales price per P100 is 660. - sales price per P200 is 759. There are 800 units from P100 in finished goods inventory at the end of 2020...
-
Let Y,..., Yn be independent reandom variables eath with the distribution N(, 0). Let (b) Show that S Y = 1 == n n i=1 (a) What is the distribution of Y? Y and S2 1 n-1 72 i-1 n-1 [C=1(Yi-) - n( )]....
-
Determine the oxidation states for each of the following elements or ions. Zn: +2 S-: -2 S: -2 Fe+: +2
-
Please tell me what type of the analysis is if the analysis wants to know which customer purchased over $5000 last year but bought nothing this year.
-
Interest Compounded Annually. When P dollars is invested at interest rate i, compounded annually, for t years, the investment grows to A dollars, where A = P(1 + i) t . Trevor's parents deposit $7800...
-
Figure is a digraph representing a food web in a small ecosystem. A directed edge from a to b indicates that a has b as a source of food. Construct the adjacency matrix A for this digraph and use it...
-
In Exercises, use the Gauss-Jordan method to find the inverse of the given matrix (if it exists). a. b. c. 1 3 0 2
-
In Exercises 1 and 2, the columns of Q were obtained by applying the Gram-Schmidt Process to the columns of A. Find the upper triangular matrix R such that A = QR. 1. 2. 2-3 23 13 13 2.3 23 3 872...
-
In what specific ways does the skeleton of a biped reflect its form of locomotion?
-
What is the difference between polygyny and polyandry?
-
Why do we say that male and female social animals have different reproductive agenda but the same underlying goal?
Study smarter with the SolutionInn App