• if the object 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.
• if the object is a symbolic link, print the name, "symbolic link " and the name of
the linked-to file
• if the object is a directory, do the same things on the objects in the directory (where
the file name is to include the directory name)
• if the object is anything else, print the name and "unknown".
I don't know how to print the size and the type of the file.
I also don't know how to cd into the directory, if there is one to check it's files. Please help
What I have so far is this.
#!/usr/bin/ksh if [[ ! -e $1 ]]; then print "File $1 does not exist." return 1 fi if [[ -d $1 ]]; then print "$1 is a directory." fi if [[ -f $1 ]]; then print "$1 is a regular file." elif [[ -L $1 ]]; then print "$1 is a symbolic link." else print "$1 is an unknown file type."