On Fri, Oct 18, 2013 at 10:39:08PM +0800, Chris Down wrote: > On 2013-10-18 17:32, lambda lambda wrote: > > Hi guys and thank you for your hard work so far. I'm sending my first > > patch here. As the subject says, i'm adding logname(1). > > More complex logname variants look at the terminal connected to stdin to work > out the login name. This, however, sucks, just as much as writing a full > program just to print out an environment variable.
I think the most portable/sensible means is to simply inspect the environment. I also had a look at musl's implementation of getlogin() and that is basically getenv("LOGNAME"). If there is enough reason to include logname, such as existing scripts using it etc. then I would not mind adding this to sbase. Thanks, sin