On Nov 19, 2012, at 8:46 AM, jb wrote: > Eitan Adler <lists <at> eitanadler.com> writes: > >> >> On 18 November 2012 18:44, Mateusz Guzik <mjguzik <at> gmail.com> wrote: >>> Just take user name from id -nu. >> >> While that does provide the $user value I want, id is in /usr/bin/ >> which may not be mounted. > > /rescue/id Bad idea: * /rescue tools are not part of the "standard" world * /rescue tools are sometimes not installed * Quite a few people have customized the rescue tools to adding or omitting things suitable for their particular installation. * /rescue tools are not guaranteed to be functionally identical to the non-rescue versions. Better to invoke 'id' in a way that produces "reasonable" results if 'id' is unavailable. For example: /bin/sh -c 'id -nu 2>/dev/null' || echo '?' prints '?' if the id command fails or is unavailable. TimReceived on Fri Nov 23 2012 - 18:25:24 UTC
This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:32 UTC