write a shell script to check whether all the directories
in the path exist has read and write permission
Answer Posted / 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 View All Answers
What is scripting used for?
Explain about shebang?
What is .sh file in mac?
How do I run a script on mac?
is this growing field and what is average package in this?
How can you get the value of pi till a 100 decimal places?
What is $1 in shell scripting?
State the advantages of shell scripting?
What is the fastest scripting language?
Why are shell scripts used?
What is @echo off?
I want to create a directory such that anyone in the group can create a file and access any person's file in it but none should be able to delete a file other than the one created by himself.
Explain about debugging?
Is shell scripting a programming language?
What are the zombie processes?