Quote:
Originally Posted by ckumar
chown -R root:${USER} /opt/app
chown -R ${USER}:${USER} /opt/app/policy
but after running script the "policy" directy dont have the user changed it still shows root.
|
The commands by themselves, if executed by the superuser, will change ownership of all directories and files at
/opt/app/policy to $USER.
Note that there are several conditions for this to work. Here are a few:
Are you sure these lines are executed at all? If so, how do you know?
Only the superuser can change ownership. Are the commands executed by
root? Again, how do you know?
Are you sure the value of USER is something else than "root"?
And of course, are there any error messages?
A few troubleshooting tips:
Add
echo commands before and after the
chown commands.
Use
set -x before the commands you want to troubleshoot, and
set +x after them (this works for Bash, not sure for other shells).