Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

Explain about echo command?

1148


What is shell application?

1034


Rewrite the command to print the sentence and convert the variable to plural: echo “i like $variable”.

1142


Write a command sequence to find all the files modified in less than 2 days and print the record count of each.

1585


How to calculate the number of passed arguments?

1168


What is awk in shell script?

1274


What is shell scripting?

1098


What is the default ubuntu terminal?

1184


How can I set the default rwx permission to all users on every file which is created in the current shell?

1472


What is the default shell of solaris?

1084


What are scripts in psychology?

1118


How will you print the login names of all users on a system?

1017


Where are cowrie shells found?

1066


What is another name for a bash shell script that you might see?

1509


How to print pid of the current shell?

1041