Question: use nano editor Write a shell script called fileInfo.sh that: - Accepts a filename as an argument. If a filename is not given, exit with

use nano editor use nano editor Write a shell script called fileInfo.sh that: - Accepts

Write a shell script called fileInfo.sh that: - Accepts a filename as an argument. If a filename is not given, exit with an error message. - Outputs the type of the contents of the file (hint: use file, but you may need one of the parameters) -Outputs first line and the last line of the file. Example output: $ ./fileInfo.sh usage: /fileInfo.sh $./fileInfo.sh /home/useri/.bashrc The file /home/user1/.bashrc contains: ASCII text Here is the first line: # -/.bashrc: executed by bash(1) for non-login shells. Here is the last line: export PATH=$PATH:/home/user1/.local/bin For the first/last lines, your output may differ slightly than this example

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!