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
How does shell scripting work?
Differentiate between ‘ and ” quotes.
What does egrep mean?
What is subshell?
How to get script name inside a script?
What is a shell script? Can you name some of its advantages?
What does sh mean?
Is shell script a programming language?
What is a file basename?
How do I run a shell script on a mac?
What is a boot block?
What are the advantages of shell scripting?
What is the significance of the shebang line in shell scripting?
What are different types of shell?
What makes c shell a more preferable option than the bourne shell?