write a shell script to check whether all the directories
in the path exist has read and write permission
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 |
Why is the use of shell script?
What is Path variable?What is its use?
What is bash shell command?
Explain about non-login shell files?
How to print all the arguments provided to the script?
Using set -A write a script to print the output of the ls command in 5 columns with two spaces between each column. Pretend that ls does not have multicolumn output.
How to add some content in any file at some desired location without using VI or some other editor in UNIX
What is the equivalent of a file shortcut that we have a window on a linux system?
How do I stop script errors?
Explain about stdin, stdout and stderr?
Is SSO and SSL support BOXI?
What shell is bin sh?