c program to check whether all the directories in the path
exists has read and write permission



c program to check whether all the directories in the path exists has read and write permission..

Answer / rakesh

#!/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 0 No

Post New Answer

More Shell Script Interview Questions

What is the syntax of "grep" command?

4 Answers  


What are the disadvantages of shell scripting?

0 Answers  


How to open a read-only file in the shell?

0 Answers  


Give some situations where typing error can destroy a program?

0 Answers  


is there any command to find user password?

4 Answers  






How to handle the delimiter unit seperator in Unix

2 Answers  


What is a shell made of?

0 Answers  


what is the difference between sh & bash shell?

1 Answers  


How to print all the arguments provided to the script?

0 Answers  


What is the difference between scripting and coding?

0 Answers  


How will you list only the empty lines in a file (using grep)?

4 Answers   ANZ,


How to add some content in any file at some desired location without using VI or some other editor in UNIX

2 Answers  


Categories