Roland Mainz wrote:
> Hi!
> 
> ----
> 
> While looking for incompatibilities between Solaris commands and ksh93's
> builtin commands I found a difference in the output of "uname -a"
> 
> The difference looks like this:
> -- snip --
> # use native Solaris "uname"
> $ /usr/bin/uname -a
> SunOS s10test001 5.10 Generic_118844-26 i86pc i386 i86pc
> $ builtin | fgrep uname
> /bin/uname
> # use ksh93 builtin "uname"
> $ export PATH=/bin:$PATH
> $ uname -a
> SunOS s10test001 5.10 Generic_118844-26 i86pc
> -- snip --
> Neither /usr/xpg4/bin/ nor /usr/xpg6/bin/ contain a "uname" variant so I
> assume there is no standard, right ?
> 
> The builtin "uname" results the following help:
> -- snip --
> uname --help  
> Usage: uname [ options ]
> OPTIONS
>   -a, --all       Equivalent to -snrvm.
>   -d, --domain    The domain name returned by getdomainname(2).
>   -f, --list      List all sysinfo(2) names and values, one per line.
>   -h, --host-id|id
>                   The host id in hex.
>   -i, --implementation|platform
>                   The hardware implementation (platform); this is
> --host-id on some systems.
>   -m, --machine   The name of the hardware type the system is running
> on.
>   -n, --nodename  The hostname or nodename.
>   -p, --processor The name of the processor instruction set
> architecture.
>   -r, --release   The release level of the operating system
> implementation.
>   -s, --os|system|sysname
>                   The operating system name. This is the default.
>   -v, --version   The operating system implementation version level.
>   -A, --everything
>                   Equivalent to -snrvmphCdtbiRX.
>   -R, --extended-release
>                   The extended release name.
>   -S, --sethost=name
>                   Set the hostname or nodename to name. No output is
> written to standard output.
> -- snip --
> 
> Calling the Solaris /usr/bin/uname command with the "-snrvm" option
> listed in the builtin commands help returns the same output then:
> -- snip --
> % /usr/bin/uname -snrvm
> SunOS s10test001 5.10 Generic_118844-26 i86pc
> -- snip --
> 
> Based on that it simply seems that the Solaris command's "-a" option is
> the equivalent to "uname -snrvmpi":
> -- snip --
> % /usr/bin/uname -snrvmpi
> SunOS s10test001 5.10 Generic_118844-26 i86pc i386 i86pc
> % /usr/bin/uname -a      
> SunOS s10test001 5.10 Generic_118844-26 i86pc i386 i86pc
> % uname -snrvmpi
> SunOS s10test001 5.10 Generic_118844-26 i86pc i386 i86pc
> -- snip --
> 
> David/Glenn:
> I have attached a patch
> ("ksh93_solaris_uname_all_output_fix001.diff.txt") which syncs the
> output of the ksh93 builtin command with the Solaris version in
> /usr/bin/ - is that change Ok for you ?
Solaris is not the only OS that provides a uname command.
/bin/uname --version
uname (coreutils) 5.2.1
Written by David MacKenzie.

Copyright (C) 2004 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
uname --help
Usage: uname [OPTION]...
Print certain system information.  With no OPTION, same as -s.

   -a, --all                print all information, in the following order:
   -s, --kernel-name        print the kernel name
   -n, --nodename     h      print the network node hostname
   -r, --kernel-release     print the kernel release
   -v, --kernel-version     print the kernel version
   -m, --machine            print the machine hardware name
   -o, --operating-system   print the operating system
       --help     display this help and exit
       --version  output version information and exit

Report bugs to <bug-coreutils at gnu.org>.

Or
uname -a
SunOS nodename 5.8 Generic_117350-26 sun4u sparc SUNW,Netra-T12
uname --help
/bin/uname: illegal option -- -
/bin/uname: illegal option -- h
/bin/uname: illegal option -- e
uname: illegal option -- l
usage:  uname [-snrvmapiX]
         uname [-S system_name]

If uname is to be patched, the native uname command
needs to be probed and the ksh uname conditionally
compiled based on the results of the probe.  The GNU
version of uname supports -o, which is not supported
by Solaris or ksh uname commands.  There is also
nothing that prevents spaces from being in the version,
so parsing uname -a is problematic at best.


> 
> ----
> 
> Bye,
> Roland
[snip]

Reply via email to