c program to check whether all the directories in the path
exists has read and write permission
Answer / 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 |
write a scwipt that a) takes exactly one argument, a directory name. b) if the number of argument is more or less than one,print a usage message c) if the argument is not adirectory, print another message d) for the given directory, print the five biggest files and the five files that were most recently modified. e) save the output to a file called q2output.
write a shell script that counts a number of unique word contained in the file and print them in alphabetical order line by line?
write a shell script to identify the given string is palindrome or not?
17 Answers CTS, HP, IBM, InfoEst, Wipro,
Please give me example of " at command , contrab command " how to use
How to sort a result of Ls -l command based on columns. Ex. i want to sort 5th column from output of ls -l command.
Write down the syntax for all the loops in shell scripting.
Dear All, Can anybody tell me how to predefind no. of selected rows from a text file.
How to get script name inside a script?
What is the use of "$?" Sign in shell script?
What are the advantages of shell scripting?
Determine the output of the following command: name=shubham && echo ‘my name is $name’.
what are command line arguments? what is the need of those?