Unix Scripting
Need assistance in completing a Unix Scripting assignment. The assignment asks to write 3 scripts
- Write a script that tests for a command line argument, i.e. $1. If it is not provided, prompt the user to enter a value. Test the user input. If it is blank prompt the user at most two more times (3 times total). If the input is blank all three times, exit the script with the error, ”No input supplied by user”. Otherwise, exit the script with the output, “The user entered {userInput}, length: {length of userInput}”
- Write a script that simulates a game of chance. Start the user with 25 units. Prompt the user to [P]lay or [Q]uit. If the user chooses [Q]uit, exit the script and output the user’s current total. If the user chooses [P]lay, deduct 1 unit from the user’s total and generate a random number between -5 and 5. Adjust the user’s total by that value. If the user’s value goes to zero or below, output “Sorry, game over.”, and exit; otherwise, output the result, the user’s new total and prompt the user to [P]lay or [Q]uit.
- Write a script that takes an absolute directory path as its argument. The script should examine that directory and count the number of child directories, the number of regular files, and the number of regular files that are executable. It should output the following:
Results for directory: {dir}
Number of child directories: {subdirs}
Number of regular files: {regfiles}
Number of executable files: {exfiles}
13 years ago
10
Answer(1)![blurred-text]()
![]()
Purchase the answer to view it

- unix.script.zip
- unix.script-v2.zip
Bids(0)
other Questions(10)
- The average annual return on an Index from 1996 to 2005 was 13.20 percent. The average annual T-bill yield during the same period was 3.55 percent. What was the market risk premium during these ten years? (Round your answer to 2 decimal place.)
- Static and Dynamic Characters Lord of the Files
- ***********FOR WIZZARD ONLY**********
- 3x+11=5
- Does anyone have BIO 100A Online Home Lab Report: Part I ????
- why is matt so determined in the sign of the beavers
- Discreet Homework-Done
- Personality Disorders—Fact or Fiction?
- animals have characteristics such as ?
- How do I balance thees problums out? [] Ca+[]O2 » CaO, []N2+[]H2 » NH3,