tag:blogger.com,1999:blog-4881511295613196192.post2352063980955211085..comments2023-03-09T03:38:46.794+11:00Comments on Big Floppy Donkey Disk: Recursively chmod only files or directoriesfloppyfranhttp://www.blogger.com/profile/18324754160309653160noreply@blogger.comBlogger10125tag:blogger.com,1999:blog-4881511295613196192.post-10980523793340860592013-11-13T21:40:46.698+11:002013-11-13T21:40:46.698+11:00Thanks mate, I've updated the link. Should be ...Thanks mate, I've updated the link. Should be working now.Anonymoushttps://www.blogger.com/profile/13843811339602933049noreply@blogger.comtag:blogger.com,1999:blog-4881511295613196192.post-86804843866542812352013-11-13T19:12:25.013+11:002013-11-13T19:12:25.013+11:00Seems that the download link is down... :/Seems that the download link is down... :/Anonymoushttps://www.blogger.com/profile/13843811339602933049noreply@blogger.comtag:blogger.com,1999:blog-4881511295613196192.post-33071990178333028212012-11-30T04:00:53.248+11:002012-11-30T04:00:53.248+11:00I suck. here is the pastebin
http://pastebin.com...I suck. here is the pastebin<br /><br />http://pastebin.com/WW4bVMbTAnonymoushttps://www.blogger.com/profile/13843811339602933049noreply@blogger.comtag:blogger.com,1999:blog-4881511295613196192.post-17169681428321834032012-11-30T03:22:58.946+11:002012-11-30T03:22:58.946+11:00usage is wrong order. this works:
[code]
#!/bin...usage is wrong order. this works:<br /><br />[code]<br /><br />#!/bin/sh<br /><br />#<br /><br /># chmodr.sh<br /><br />#<br /><br /># author: Francis Byrne<br /><br /># date: 2011/02/12<br /><br />#<br /><br /># Generic Script for recursively setting permissions for directories and files<br /><br /># to defined or default permissions using chmod.<br /><br />#<br /><br /># Takes a path to Anonymoushttps://www.blogger.com/profile/13843811339602933049noreply@blogger.comtag:blogger.com,1999:blog-4881511295613196192.post-6918553958903164222012-11-29T17:38:14.868+11:002012-11-29T17:38:14.868+11:00Sounds good, I updated the gist to include your ch...Sounds good, I updated the gist to include your changes. <br />Thanks mate!Anonymoushttps://www.blogger.com/profile/13843811339602933049noreply@blogger.comtag:blogger.com,1999:blog-4881511295613196192.post-3203152415564593842012-11-29T17:21:25.933+11:002012-11-29T17:21:25.933+11:00this should take care of spaces. Appeared to work...this should take care of spaces. Appeared to work.<br /><br /># Recursively set directory/file permissions based on the permission variables<br /><br />if [ -n "$DIRPERMS" ] ; then<br /><br /> find $ROOT -type d -print0 | xargs -0 chmod -v $DIRPERMS<br /><br />fi<br /><br />if [ -n "$FILEPERMS" ] ; then<br /><br /> find $ROOT -type f -print0 | xargs -0 chmod -v $FILEPERMS<Anonymoushttps://www.blogger.com/profile/13843811339602933049noreply@blogger.comtag:blogger.com,1999:blog-4881511295613196192.post-27071930430085788072012-11-29T08:28:54.833+11:002012-11-29T08:28:54.833+11:00a space in file/directory name causes an error. T...a space in file/directory name causes an error. Thanks for the script, it will make my life easier.Anonymoushttps://www.blogger.com/profile/13843811339602933049noreply@blogger.comtag:blogger.com,1999:blog-4881511295613196192.post-55865973170497320182012-10-29T06:58:38.650+11:002012-10-29T06:58:38.650+11:00Also, I am wondering if there is an advantage to r...Also, I am wondering if there is an advantage to replacing<br />find $ROOT -type d | xargs chmod -v $DIRPERMS<br />by<br />find $ROOT -type d -exec chmod $DIRPERMS {} \;<br />Does this avoid any command line string length limitations of the shell?Anonymoushttps://www.blogger.com/profile/13843811339602933049noreply@blogger.comtag:blogger.com,1999:blog-4881511295613196192.post-18342340739854929292012-10-29T06:41:07.283+11:002012-10-29T06:41:07.283+11:00Foudn this with google. Unfortunately, the script ...Foudn this with google. Unfortunately, the script does not work as intended, as the getopts is executed before the PATH variable is set, so either the usage information needs to change or the PATH variable is set first and a shift operation executed so that getopts finds the options.Anonymoushttps://www.blogger.com/profile/13843811339602933049noreply@blogger.comtag:blogger.com,1999:blog-4881511295613196192.post-63710638252265288322012-10-19T20:38:42.434+11:002012-10-19T20:38:42.434+11:00This is VERY useful for VERY lazy people like me. ...This is VERY useful for VERY lazy people like me. Thanks!Anonymoushttps://www.blogger.com/profile/13843811339602933049noreply@blogger.com