> On 04/13/2014 11:45 AM, Kaj Ailomaa wrote: > > > > On Sun, Apr 13, 2014, at 02:27 PM, Israel wrote: > > > >> I did add myself to the audio group, though I will try the same command > >> again (I think I used my actual username, instead of $USER) > > $USER is an environment variable. It's more correct to use your username > > directly, since using $USER only works if you are logged in as that > > user, when running the command - with sudo (if logged in as root, root > > will become a member of audio group).
If you want to add somebody to a group, use the username , not $USER. If you want a script to test, if somebody does run this script with user or root privileges, use id -u , not $USER. I guess what output you get for $USER depends to your setup or distros default setup, but a username always is a username and the output of id -u always gives information about the privileges. [rocketmouse@archlinux ~]$ echo $USER $(id -u) rocketmouse 1000 [rocketmouse@archlinux ~]$ su Password: [root@archlinux rocketmouse]# echo $USER $(id -u) rocketmouse 0 [root@archlinux rocketmouse]# exit [rocketmouse@archlinux ~]$ sudo -i [sudo] password for rocketmouse: [root@archlinux ~]# echo $USER $(id -u) root 0 [root@archlinux ~]# logout [rocketmouse@archlinux ~]$ -- ubuntu-studio-users mailing list [email protected] Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-studio-users
