exercise5
Exercise 5. Write a shell script that displays a number of files in your present working directory.
Script: We use a variable 'files' in which we list out the content of our current directory and then counted the number of lines of listed files or directories. As it will also count that line as well which is showing 'total' to avoid that line we subtracted 1 by that total count and then displayed final output.
Output: It will show the number of files or directories which are 4 here in our case.
No comments:
Post a Comment