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
Which shell is the best?
How can we find the process name from its process id?
What are the advantages of shell script?
I want to create a directory such that anyone in the group can create a file and access any person's file in it but none should be able to delete a file other than the one created by himself.
How do I run a script on mac?
What is bash eval?
What language is shell scripting?
What is a file basename?
What is the use of "$?" Sign in shell script?
How will you pass and access arguments to a script in linux?
What is mac default shell?
Explain about login shell?
How do I stop script errors?
How can you find out how long the system has been running?
What is shell scripting?