c program to check whether all the directories in the path
exists has read and write permission
Answer Posted / 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 View All Answers
How will you emulate wc –l using awk?
What is a command line shell?
Explain about debugging?
Why is shell scripting important?
What language is bash written in?
Explain about "s" permission bit in a file?
What will happen to my current process when I execute a command using exec?
Explore about environment variables?
What are the 3 standard streams in linux?
Where are cowrie shells found?
What are scripts in psychology?
How to debug the problems encountered in the shell script/program?
How can you get the value of pi till a 100 decimal places?
In my bash shell I want my prompt to be of format '$"present working directory":"hostname"> and load a file containing a list of user-defined functions as soon as I log in, how will you automate this?
What is eval in shell script?