write a shell script to check whether all the directories
in the path exist has read and write permission
Answer Posted / geichel
#!/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 | 2 No |
Post New Answer View All Answers
What is the difference between grep and egrep?
What is ms powershell?
Where is bash history?
What are the four fundamental components of every file system on linux?
Why are there shells on the beach?
How to print pid of the current shell?
c program to display the information of given file similar to givan by the unix or linux command ls -l
What is bash shell command?
What is a batch file used for?
What command needs to be used to take the backup?
What is the syntax of while loop in shell scripting?
Print the 10th line without using tail and head command.
What does egrep mean?
What is echo in shell?
What is a shell script in windows?