UNIX Part 2: Write a single shell script hello.sh which can finish the list of t
ID: 3591484 • Letter: U
Question
UNIX
Part 2: Write a single shell script hello.sh which can finish the list of tasks as below: 1. Greet user. E.g. Welcome to computer science society 2. Contain a comment section with your name, and email address. 3. Print the date. 4. Print the number of directories in /home. 5. Print the value of variables PATH, USER and SHELL. 6. Print your disk usage (df) 7. Print Please, could you loan me $25.00? 8. Print ifx= 2, x * x=4, x / 2=1 9. List all the .sh files with c at the beginning of the file name in current working directory. 10. Tell the user Good bye and the current hour (see manual page of date command refer to the webpage at http://www.thegeekstuff.com/2013/05/date-command-examples Include the content of hello.sh in your answer sheet. Besides, please also upload hello.sh as a separated file.Explanation / Answer
echo "Welcome to computer society"
#name-john smith, email-abc@xyz.com
echo " the current date is";
date;
echo 'number of directories in home path is'
tree /home -d | awk 'END{print}';
echo $PATH;
echo $USER;
echo $SHELL;
echo" the disk usage is "
echo "please could you loan me $25.00"
df;
if [X=2]
then
echo "X*X=4"
echo "X/2=1"
fi;
echo "please could you loan me $25.00";
find $pwd -type f -name "*.sh"|find $pwd -type f -name "c*";
echo "Good Bye"
date +%H
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.