Created
October 25, 2011 11:43
-
-
Save yuxel/1312424 to your computer and use it in GitHub Desktop.
yilmaz.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#bunu | |
matching="yuxel www-data" | |
#buna cevir, bundaki ':' ya dikkat | |
convertTo="yuxel:yuxel" | |
#her dosyada (bunu dizin için de yapmak istersen -type d ile bi daha dönmen gerekeek galiba | |
for i in `find * -type f`; do | |
#owner ve group'u al | |
owngrp=`ls -al $i | awk '{print $3 , $4;}'`; | |
#eger uyuyorsa degistir | |
if [ "$owngrp" = "$matching" ] | |
then | |
sudo chown $convertTo $i | |
echo "changing $i" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment