Question
A.Type the following commands using a text editor and save it as a yourname .sh (Example: ahmad.sh). echo Hello world > helloworld.jar mkdir cars; mkdir
A.Type the following commands using a text editor and save it as a yourname.sh (Example: ahmad.sh).
echo Hello world > helloworld.jar mkdir cars; mkdir dates; mkdir fruits drinks cd cars; echo Honda Accord > accord.c cp accord.c civic.c; echo proton > proton.c; cd ../dates; date > dateoftheday cat dateoftheday > appointment cd ../fruits; echo apple > apple.txt; cat apple.txt > orange.txt cd ../drinks; cp ../cars/*.* .; cp ../fruits/*.* .; cp ../*.jar . |
Execute the script and draw a tree structure that contains created directories and files. The parent node of the directory begin with $HOME or ($fedora) directory.[4 marks]
Print screen the script that you type;
Then draw the tree
B. Write an interactive bash script that will read a type of file extension, display all those files, and count the number of files (the script file must be in cars directory). To validate your script, display c program files, and enter *.c as the input to the bash script.[4 marks]
#/bin/bash
complete the code
print screen the bash script here and run
|
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started