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 do I open a jshell in cmd?

1144


Explain about non-login shell files?

1133


What makes c shell a more preferable option than the bourne shell?

913


What does echo $0 do?

916


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

1018


What is @echo off?

942


Explain about "s" permission bit in a file?

995


Write a shell script that adds two numbers if provided as the command line argument and if the two numbers are not entered throws an error message.

1230


Is it possible to substitute "ls" command in the place of "echo" command?

1000


madhar chod unix ke 10 commands dhang se likh nahi sakta hai

3412


how will you find the total disk space used by a specific user?

980


What does debug script mean?

922


What does $1 mean in bash?

1026


What is the use of .sh file?

1052


What is the conditional statement in shell scripting?

1164