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 |
What is $1 in shell scripting?
How do you rename the files(*.sh) with file names containing space in it?for example "interview question.sh" needs to rename to "interview-question.sh". Appreciate your inputs.Thanks.
What is shell scripting?
What does .sh file contain?
how to read systems current date and time
What is the difference between a variable and value?
What is the use of break command?
What are the 3 standard streams in linux?
What is bash command used for?
Explain about echo command?
How to sort a result of Ls -l command based on columns. Ex. i want to sort 5th column from output of ls -l command.
How do I set bash as default shell mac?