Using chown in a script

Gurus Knugum gurus.knugum at gmail.com
Sun Sep 5 16:23:55 UTC 2010


Den 2010-09-05 18:16:50 skrev Nils Kassube <kassube at gmx.net>:

> Johnny Rosenberg wrote:
>> Den 5 september 2010 17:02 skrev Gurus Knugum
> <gurus.knugum at gmail.com>:
>> > Running the env command I noticed my username three times:
>> > $USER
>> > $USERNAME
>> > $LOGNAME
>>
>> Tried with a simple script and found that all three of them was
>> "root" if I ran the script with sudo, so I can't really use any of
>> them. Too bad…
>
> You want to find out your own login name, not that of some other user?
> Then how about "$SUDO_USER"?
>
>
> Nils
>

Thanks, it seems to work!
-- 
Kind regards

Johnny Rosenberg




More information about the ubuntu-users mailing list