On Sunday 03 June 2007, Dan Cowsill wrote: > Hey list, > > It has been a constant burden to me to have to change the file > permissions of files I've copied so that other users can access them > and modify them. Say I have a number of documents in the /root > folder which the root user owns. Now I want to transfer them to my > non-priveliged user so I can work on them... But I have to chown them > so that is possible. > > It just occured to me that there must be an easier way to do things > like this and I was wondering if you fine fellows could guide me down > the right path.
A custom script? Maybe something like (named as chowncp) #!/bin/bash # chown $1 $2 cp $2 $3 Permissions would be something like x only for owner (root), called something like this: chowncp dan <file1> <file2> It's way incomplete, I'll let you figure out your own '[ -f ...' checks but you get the idea. I'm also sure ext3/reiser acls can force ownership of new files (it can do it for groups), but I'm way too lazy to figure it out right now, it being Friday and all... alan -- Optimists say the glass is half full, Pessimists say the glass is half empty, Developers say wtf is the glass twice as big as it needs to be? Alan McKinnon alan at linuxholdings dot co dot za +27 82, double three seven, one nine three five -- [EMAIL PROTECTED] mailing list

