exercise7
Exercise 7. Write a shell script that asks the user to enter a file_name and then displays that the file is regular file or directory or other type of file.
Script: Like one of our previous script we use if condition here by '-f' option we check that the file is regular or not. else we check that it is directory by using '-d' option. Else we will simply display the message it is not regular file or directory.
Output1: If entered file is regular file.
Output2: If entered is a directory.
Output3: If entered is not a regular file nor directory.
No comments:
Post a Comment