I'm working on a script to set some particular gsettings. If the script is being executed as user its working as expected. But, because of some reason I need my script to work with sudo.
One solution i found was to use sudo -u <username> -H ./script to run it in user space. It is getting executed without any error, but my changes are not taking place in the user space.
I unable to understand what am I missing here. When i run sudo -u <currentUser> -H bach -c `echo " $USER $UID"` it is working as expected and giving the user values.
What might be the issue here?
Thanks in advance!



