Subject: Re: lib/254: uname(1) output breaks scripts, is unreadable
To: Thorsten Lockert <tholo@SigmaSoft.COM>
From: Chris G. Demetriou <cgd@postgres.Berkeley.EDU>
List: netbsd-bugs
Date: 05/20/1994 18:20:58
> 	It would be better if the uname(2) emulation (now uname(3)) would
> 	return fields like "NetBSD" "node.domain", "0.9B", "199103" and "i386".

i don't buy it.

I also don't buy that it "breaks scripts".

read the POSIX documentation on it -- the fields are user-defined,
and _MAY CONTAIN SPACES_.  if scripts don't allow for that, they're
broken (and, frankly, anybody who writes scripts for distribution, and
doesn't deal with quoting issues properly, has no right to complain).

here's the output of uname with each of the possible flags except -a:

212 [pain] cgd % uname -m
i386
213 [pain] cgd % uname -n
pain.cs.berkeley.edu
214 [pain] cgd % uname -r
NetBSD 0.9B
215 [pain] cgd % uname -s
NetBSD
216 [pain] cgd % uname -v
NetBSD 0.9B (PAIN) #119: Fri May 20 02:44:25 PDT 1994     cgd@sun-lamp.cs.berkeley.edu:/e/users/cgd/trees/ren/sys/arch/i386/compile/PAIN

by POSIX (and common sense), none of those is unreasonable.  nobody
should be using uname -v for anything anyway, as it has and always
will describe version of the currently-running kernel.

if people are using scripts for configuration, then they should
probably be using -m, -r, and -s.  given that, the only "possibly
objectionable" one is -r, which is legal by POSIX, and, for any
reasonable configuration script, is no harder to deal with than "0.9B"
for instance.


cgd

------------------------------------------------------------------------------