Write a Shell script that displays list of all the files in the current directory to which the user has read, Write and execute permissions.
AIM:
Write a Shell script that displays list of all the files in the current directory to which the user has read, write and execute permissions.
Program:
echo "enter the directory name" read dir if [ -d $dir ] then cd $dir ls > f exec < f while read line do if [ -f $line ] then if [ -r $line -a -w $line -a -x $line ] then echo "$line has all permissions" else echo "files not having all permissions" fi fi done fi
Output:
student@ubuntu:~$sh prg3.sh enter the directory name dir1 ff has all permissions files not having permissions
-
UpdatedOct 23, 2014
-
Views54,781
Write a Shell script to find factorial of a given integer.
Write in C the following Unix commands using system calls A). cat B). ls C). mv
Write a Shell script that displays list of all the files in the current directory to which the user has read, Write and execute permissions.
Write a Shell script that accepts a filename, starting and ending line numbers as arguments and displays all the lines between the given line numbers.
Write a C program to emulate the Unix ls-l command.
Write a Shell script to list all of the directory files in a directory.