Question: 1. Write a Bash script which uses the following utilities to display information (date, whoami, pwd, echo). The output of this information should be accompanied

1. Write a Bash script which uses the following utilities to display information (date, whoami, pwd, echo). The output of this information should be accompanied by headings, such as The date is:

2. Write a Bash script which displays the path to the home directory of a user when an actual user name is used as an argument and displays No such user when a fictitious user name is used as an argument.

3. Write a Bash script that takes the name of a file or directory as an argument and reports if the file is a directory, regular file or other. The script should also report if the user has read, write and execute permission on the file or directory.

4. Write a Bash script reads a list of numbers of any length from standard input and then outputs the sum of those numbers.

5. Write a Bash script that removes all zero length ordinary files in the current directory by default and other directory if provided as an optional argument. Ensure that erroneous directories provided are handled with appropriate error handling and/or messages. Show the output for two scenarios.

6. Write a Bash script that changes the file extension of all the files in a directory having a certain extension, such as .png or .gif. The script takes two command line arguments: old_extension and new_extension.

7. Write a Bash script takes as an argument a word for which to seek the definition. The script reads dictionary.txt and then displays the requested definition. If you don't still have a copy of dictionary.txt in your ~/data directory, please ask the instructor for a new one. Display the results of running your script, such as: ./word_def.sh byzantine

8. Using a Bash script, complete class project 6, option I. Your Bash script may contain other tools, such as awk and sed.

9. Write a Bash script that searches a directory .Trash and removes files and directories older than 30 days. Show how you would have cron run this script daily.

10. Write a Bash script that updates the SPY.txt file from Yahoo Finance: http://finance.yahoo.com/q/hp?s=SPY+Historical+Prices . Include in your script comments describing how to have cron run the script daily at a 5:30 PM. Test your crontab entry with any time.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!