BASH script for applying permissions recursively
Dane Mutters
dmutters at gmail.com
Thu Jun 29 07:08:26 BST 2006
Hello.
I'm a newbie at scripting, but I think I've come up with something useful
that you might want to take a look at. It's a script that can be used to
change the permissions of files and directories recursively, respectively.
It is able to handle every file name I've thrown at it, including those with
quotes, spaces, dashes (in any part of the filename), etc. I could not
figure out how to create a file with a slash in it, so that remains untested.
The reason I wrote this script is so that when somebody transfers files from
a vfat partition (or some other filesystem without UNIX permissions), that
person could then set all the permissions to something reasonable without
having to do it all manually. All other solutions I found on the 'net choked
on either large directory structures, filenames with odd characters in them,
or filenames with spaces in them.
Please let me know what you think about whether this is something that would
be useful to Ubuntu users.
Thanks.
--Dane
<script attached>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: chmodr.sh
Type: application/x-shellscript
Size: 3669 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/ubuntu-devel/attachments/20060628/d7fdec5d/chmodr-0001.bin
More information about the ubuntu-devel
mailing list