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
Explain about echo command?
What is shell application?
Rewrite the command to print the sentence and convert the variable to plural: echo “i like $variable”.
Write a command sequence to find all the files modified in less than 2 days and print the record count of each.
How to calculate the number of passed arguments?
What is awk in shell script?
What is shell scripting?
What is the default ubuntu terminal?
How can I set the default rwx permission to all users on every file which is created in the current shell?
What is the default shell of solaris?
What are scripts in psychology?
How will you print the login names of all users on a system?
Where are cowrie shells found?
What is another name for a bash shell script that you might see?
How to print pid of the current shell?