c program to check whether all the directories in the path
exists has read and write permission
Answer Posted / rakesh
#!/bin/bash
for x in $(echo $PATH |sed "s/:/ /g")
do
echo "Directories in your PATH which you cannot write are:"
echo $(find $x -perm /666 -type d -maxdepth 0 2>/dev/null
|xargs ls -dl | grep -v $USER)
done
exit 0;
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
How to open a read-only file in the shell?
Why are shell scripts used?
What is bash command used for?
Why is used in shell scripting?
How to write a function?
Print the 10th line without using tail and head command.
What is the difference between break and continue commands?
What is console line?
What are script files?
How will you connect to a database server from linux?
Is shell scripting a language?
What is the command to find out users on the system?
How can the contents of a file inside jar be read without extracting in a shell script?
How do you create a shortcut in linux?
What are the different communication commands available in the shell?