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...

c program to check whether all the directories in the path
exists has read and write permission

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to open a read-only file in the shell?

1113


Why are shell scripts used?

1057


What is bash command used for?

1046


Why is used in shell scripting?

975


How to write a function?

1016


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

2162


What is the difference between break and continue commands?

1080


What is console line?

951


What are script files?

1007


How will you connect to a database server from linux?

1021


Is shell scripting a language?

1016


What is the command to find out users on the system?

949


How can the contents of a file inside jar be read without extracting in a shell script?

1111


How do you create a shortcut in linux?

1171


What are the different communication commands available in the shell?

954