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

What is the difference between grep and egrep?

1067


What is ms powershell?

964


Where is bash history?

857


What are the four fundamental components of every file system on linux?

1619


Why are there shells on the beach?

1052


How to print pid of the current shell?

944


c program to display the information of given file similar to givan by the unix or linux command ls -l

2148


What is bash shell command?

960


What is a batch file used for?

1027


What command needs to be used to take the backup?

936


What is the syntax of while loop in shell scripting?

968


Print the 10th line without using tail and head command.

2110


What does egrep mean?

913


What is echo in shell?

1046


What is a shell script in windows?

1022