Using chown in a script

James Bensley jwbensley at gmail.com
Sun Sep 5 16:23:57 UTC 2010


Is this script going to be used on files owned by all different users
because you could just write the username in the script;

cp /a/system/file /a/place/in/my/home/directory/
chown -R me:mygrp /a/place/in/my/home/directory/

Or pass it as an argument?

$./copy_script.sh me mygrp
cp /a/system/file /a/place/in/my/home/directory/
chown -R $1:$2 /a/place/in/my/home/directory/

-- 
Regards,
James.

http://www.jamesbensley.co.cc/

There are 10 kinds of people in the world; Those who understand
Vigesimal, and J others...?




More information about the ubuntu-users mailing list