On Wed, Mar 27, 2002 at 10:51:34AM -0500, Rocco Rutte wrote:
> > hostname, on any sane
> > system, displays the hostname when called with no args, and tries to set
> > it (requiring root at THAT point) when it has args.  
Yes.  And Solaris is sane in this fashion.

> > Solaris assumes that you're always trying to set it, even to nothing.
Not true.  Type 'hostname' and you get the output, no root required.  
You said it yourself - it only wants you to be root when you supply
an argument.  And '-s' IS AN ARGUMENT.

There is nothing automatic or magical about switches/options to
commands on UNIX; if you are writing a program and want it to accept
options, you have to write it to do so explicitly - although there
are libraries that make this easy.  On traditional UNIX systems,
hostname(1) has no options.  So it sees it has an argument ("-s")
and tries to set the hostname to that.  Since you're not root,
it fails.  You are simply accustomed to the extended version of
the hostname command, standard in Linux distributions, which has
been written to recognize a set of option switches.

-- 
Mark REED                    | CNN Internet Technology
1 CNN Center Rm SW0831G      | [EMAIL PROTECTED]
Atlanta, GA 30348      USA   | +1 404 827 4754 
--
Worth seeing?  Yes, but not worth going to see.

Attachment: msg26488/pgp00000.pgp
Description: PGP signature

Reply via email to