write a shell script to check whether all the directories
in the path exist has read and write permission
Answer / 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 |
Is shell a part of kernel?
What is shell and shell script?
Is bash a shell script?
Which scripting language is best for automation?
What is the difference between a 'thread' and a 'process'?
How do you read arguments in a shell program - $1, $2 ..?
What is computer cli?
Why are shell scripts used?
When should shell programming/scripting not be used?
What are the two files of crontab command?
What are script files?
How will you print the login names of all users on a system?