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 |
What is awk in shell scripting?
How do I run a shell script on a mac?
how to delete all the files with extension .dat rom a directory tree from root to third level in a single unix command?
What is shell scripting used for?
How shell works?
how do you write sql queries using shell script for eg:- we have databae table like EMPNO,ENAME,SAL,DEPTNO columns in EMP table how you display EMPNO,SAL FIELDS from emp in SHELL SCRIPT please explain with an example
What does debug script mean?
What is shift command in shell script?
How do you know which shell I am using?
What is shell chemistry?
In shell scripting if text is surrounded by single quotes what does it denotes?
What is the use of echo in shell script?