write a shell script to check whether all the directories
in the path exist has read and write permission



write a shell script to check whether all the directories in the path exist has read and write per..

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

Post New Answer

More Shell Script Interview Questions

What is $1 in shell scripting?

0 Answers  


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.

5 Answers   Wells Fargo,


What is shell scripting?

0 Answers  


What does .sh file contain?

0 Answers  


how to read systems current date and time

4 Answers  






What is the difference between a variable and value?

7 Answers   Sun Microsystems,


What is the use of break command?

0 Answers  


What are the 3 standard streams in linux?

0 Answers  


What is bash command used for?

0 Answers  


Explain about echo command?

0 Answers  


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.

6 Answers   TCS,


How do I set bash as default shell mac?

0 Answers  


Categories