Write a bash scriptfc sh that counts files inside directory


Problem

Write a" BASH scriptfc. sh that counts files inside a given directory. fc. sh should take either zero or one argument only. If provided, the argument should be a legal path to a directory. If no argument is given, the script should count the files in the current directory. Note: The script should not operate recursively, i.e. it is not supposed to count files inside (sub)directories found in the directory being explored. Also, hidden files should not be counted. The script should conform to the output shown in Listing 4; it should print messages (in square brackets) about directories not being found, the argument not being a directory, and the PWD being used. Observe how it also lists the number of files in a directory by following the symbolic link to it. Listing 4: File count script interaction on Polaris 2$fc.sh dir2 final ans: 2 $fc.sh/1ib/final ans: 2$ fs./lib/ algs4.jar stdlib.jar $fc.sh/1ib/final ans: 2 Note: If the argument provided is not a legal directory, the script should exit with code 1. If an incorrect number of arguments is provided, the script should exit with code 2. In readme. txt, paste the following commands and the results of running them on Polaris: 1. fc.sh /etc 2. fc.sh/usr/bin/ 3. fc.sh /11b 4. fc.sh temp 2359823 Deliverable: fc. sh, readme. txt.

Request for Solution File

Ask an Expert for Answer!!
Computer Engineering: Write a bash scriptfc sh that counts files inside directory
Reference No:- TGS03298133

Expected delivery within 24 Hours