Reference no: EM132193732
Question :
Write a Bash script to print information about filespace objects.
The script is to take a list of file system objects on the command line.
If there are no arguments to the script, it should treat the list as being the directory ‘.'.
For each object in the list, I want you to call the function below with the object as the argument.
I want you to write a function taking a single argument.
• if the argument is a regular file, you are to print the name of the file, its size, and the type of the contents as reported by the file command. [The commands cut or sed may be useful.
• if the argument is a symbolic link, print the name, "symbolic link " and the name of the linked-to file [look at the output of "ls -l"]
• if the argument is a directory, do the same things on the objects in the directory (where the file name is to include the directory name) [recursion]
• if the argument is anything else, print the name and "unknown".