Question: Task 3.4 Challenge Exercises (15 Points) a. Write Script to see current date, time, username, and current directory. b.Take the script from Task 2.5 and
Task 3.4 Challenge Exercises (15 Points)
a. Write Script to see current date, time, username, and current directory.
b.Take the script from Task 2.5 and write it so it does not create a file if no input is received.
c. In this exercise, you will create a script based on case statement.
d. Write a Shell using for loop to print three strings.
e. Write a bash Script to reverse a given positive integer.
The following is the script fro 2.5:
Task2.5: Write a script that will ask the user for to input a file name and then create the file and echo to the screen that the file name inputted had been created
1. Open a new file script creafile.sh using vi editor
2. Type the following lines
#!/bin/bash echo enter a file name: read FILENAME touch $FILENAME echo $FILENAME has been created
3. Add the execute permission
4. Run the script #./creafile.sh
5. Enter the file name you want to create
6. Check whether file is created
show input and output for every step, as well as screen shots. I been using the terminal to run the code
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
