nALFS feature request

Richard rgollub at
Mon May 20 05:36:43 PDT 2002

Neven Has wrote:
> On Sat, May 18, 2002 at 10:26:26PM -0300, Richard wrote:
> >       If that wasn't the original problem then my apologies.
> It was, but I obviously wasn't very clear.
> On my system, when I create a user with useradd, the group it belongs
> to doesn't exist (it's not created, which is normal). And in that case
> (when the group doesn't exist), when you execute "id lfs", "id" returns
> false (1 might be confusing here). So, in:
>     id lfs &> /dev/null || useradd ...
> useradd is executed even though lfs user exists.
> "id" does print some info about lfs, but it returns false to the shell.

	Ok, now I get it and have confirmed here that outcome as well.

	By testing then, the correct solution is:

	id -u lfs &> /dev/null || useradd ...

	as, even if group does not exist, id -u will return true (exit
status=0) as "expected".

	It was nice stumbling on this one... Always learning something new! :)

Unsubscribe: send email to listar at
and put 'unsubscribe alfs-discuss' in the subject header of the message

More information about the alfs-discuss mailing list