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 echo in shell?

0 Answers  


What does sh mean?

0 Answers  


What is a program shell?

0 Answers  


How do you debug a script?

0 Answers  


Write a shell script to looking at the log file to see if the test has passed or not

2 Answers   TCS,


What is k shell?

0 Answers  


What is bash used for?

0 Answers  


How do scripts work?

0 Answers  


How do you know which shell I am using?

0 Answers  


Is SSO and SSL support BOXI?

2 Answers  


What is sudo command?

0 Answers  


how to print the 2-d, 3-d arrays in unix shell script programs please answer thi questio to my mail venusaikumar@gmail.com

0 Answers  


Categories