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 in a script?

0 Answers  


how did u debugging in unix/ linux platform ??( project Related)

2 Answers   Symphony,


How to create environment variables?What are the conditions for creating variables?

1 Answers   Infosys, Wipro,


What is an inode block?

0 Answers  


what is the difference between writing code in shell and editor?

1 Answers  






What are the different types of variables used in shell script?

0 Answers  


How to print the first array element?

0 Answers  


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

1 Answers  


How will you emulate wc –l using awk?

0 Answers  


what is tickets $ what low,medium,high priorite pls define time also

0 Answers  


Is powershell a language?

0 Answers  


What does echo $0 do?

0 Answers  


Categories