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 do I open a jshell in cmd?
Explain about non-login shell files?
What makes c shell a more preferable option than the bourne shell?
What does echo $0 do?
Rewrite the command to print the sentence and convert the variable to plural: echo “i like $variable”.
What is @echo off?
Explain about "s" permission bit in a file?
Write a shell script that adds two numbers if provided as the command line argument and if the two numbers are not entered throws an error message.
Is it possible to substitute "ls" command in the place of "echo" command?
madhar chod unix ke 10 commands dhang se likh nahi sakta hai
how will you find the total disk space used by a specific user?
What does debug script mean?
What does $1 mean in bash?
What is the use of .sh file?
What is the conditional statement in shell scripting?