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

Is SSO and SSL support BOXI?

2 Answers  


How do I run a .sh file on mac?

0 Answers  


how to create purchase order

2 Answers  


How do we delete all blank lines in a file?

0 Answers  


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

1 Answers  






How does ls command work?

0 Answers  


What is mac default shell?

0 Answers  


How will you pass and access arguments to a script in linux?

0 Answers  


What language is bash written in?

0 Answers  


What is bash used for?

0 Answers  


How do you create a shortcut in linux?

0 Answers  


Create a bash shell script that reads in a number from the user. If the number is 1, print out the date. If the number is 2, list the files in the current directory. If the number is 3, print out who is currently logged onto the system. If the number is anything else, print out an error message and exit. Name this script "various.sh"

4 Answers  


Categories