bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Prevent redundancy in 'uname -a' (w/ChangeLog)


From: Bob Proulx
Subject: Re: [PATCH] Prevent redundancy in 'uname -a' (w/ChangeLog)
Date: Thu, 22 Jul 2004 11:04:47 -0600
User-agent: Mutt/1.3.28i

Robert Millan wrote:
> Paul Eggert wrote:
> > I dunno, that patch looks a little weird to me, as it causes "-a" to
> > behave non-orthogonally with respect to the -o option (i.e., -o is
> > treated differently from -s/-n/-r/-v/-m/-p/-i).  Also, I suppose it
> > might break some software that parses "uname -a" output (any such
> > software is unportable, but we'd rather not break it anyway...).
> > 
> > What's the motivation for the change?
> 
> In Debian, "uname -a" is executed by login right after authenticating.

Huh?  Where is this printed?  Not in the standard system login
scripts.  But perhaps in a user's personal environment scripts.  I
tend to do that myself.  But it is a personal choice, not a system
choice.  I am running both Debian woody and sid on various machines.

> In GNU/kFreeBSD systems, `uname -s` output is equal to `uname -o`. Therefore
> everytime you login in Debian GNU/kFreeBSD it prints the same information
> twice, making the string look redundant and longer.

Basically uname is terribly non-portable.  The only safe result is the
one without any options.  I am sure you will have run into the many
cases where this prints radically different styles of information on
different machines.  So I always do something like this:

  case $(uname) in
  HP-UX) echo $(uname -rs) $(model) ;;  # HP-UX B.11.11 9000/785/C3750
  Linux) uname -ms ;;  # Linux ia64
  AIX)   echo $(uname) $(uname -v).$(uname -r) ;;  # AIX 4.3
  esac

Bob




reply via email to

[Prev in Thread] Current Thread [Next in Thread]