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 the command to find out today's date?
Which is better perl or shell scripting?
What is bourne shell scripting?
How to enable the shell to know what program should be run to interpret the script?
Hi, all Scripting professional. Q. I have written script1.sh and calling script2.sh in script1.sh file using bash shell as interpreter and my log in shell also bash shell.My code like Script1 #!/bin/bash echo "My script2 call" . script2.sh Here script2.sh file run successfully but when I have changed my interpreter bash to ksh like #!/bin/ksh Error are comming script2.sh command not found. Guid me how to call other script in our main script.
What are the different kinds of loops available in shell script?
I want to upload a file to remote server through ftp daily.Can anyone suggest how to make a shell script for that.I hv credentials for that ftp
Write a command sequence to find the count of each word?
determine the output of the following command: echo ${new:-variable}
Explain about non-login shell files?
What are the types of script?
What is gui scripting?