Possible Solaris 2.4 bug?

Possible Solaris 2.4 bug?

Post by Daniel Erskin » Tue, 04 Nov 1997 04:00:00



Greetings:
  I have Solaris 2.4 (x86) running on my PC's.  I have Solaris 2.5
running on my office servers (NIS+ mapped, of course).  The following
command-line syntax is what I'm trying to run via Bourne shell only:

        # [ `hostname` -eq "server1" ] && crontab -l

  On 2.4, I get the error message "test: argument expected" in all
implementation of this syntax!  Everything works properly on Solaris
2.5!  I've tried using both "/bin/sh" and "/sbin/sh" shells, but to no
avail!  This particular command-line tests the current server.  If the
current server's name is "server1", then the command prints the crontab
entries!
  Does anyone know if this is an operating system "bug" with Solaris
2.4?  I would think it was.  I've tried this with Linux 2.0.x (I know,
it's not the *same*), and the syntax works fine!

Thank you for your time,
------------------------------------------------------
    THE PRECEDING REFLECTS THE VIEWS OF THE AUTHOR
   AND NOT, NECESSARILY, THE VIEWS OF EDWARD JONES.
------------------------------------------------------


 
 
 

Possible Solaris 2.4 bug?

Post by Casper H.S. Dik - Network Security Engine » Tue, 04 Nov 1997 04:00:00


[[ Reply by email or post, don't do both ]]


>  I have Solaris 2.4 (x86) running on my PC's.  I have Solaris 2.5
>running on my office servers (NIS+ mapped, of course).  The following
>command-line syntax is what I'm trying to run via Bourne shell only:
>    # [ `hostname` -eq "server1" ] && crontab -l
>  On 2.4, I get the error message "test: argument expected" in all

There is no "hostname" command in yoru path perhaps?

(There wasn't one in /usr/bin in 2.4.)

Try uname -n.

And also make a habit of using:

        "`some command`"

when invoking test; if there's no output test will fail with a syntax error.

Casper
--
Expressed in this posting are my opinions.  They are in no way related
to opinions held by my employer, Sun Microsystems.
Statements on Sun products included here are not gospel and may
be fiction rather than truth.

 
 
 

Possible Solaris 2.4 bug?

Post by D. Roc » Fri, 07 Nov 1997 04:00:00



: Greetings:
:   I have Solaris 2.4 (x86) running on my PC's.  I have Solaris 2.5
: running on my office servers (NIS+ mapped, of course).  The following
: command-line syntax is what I'm trying to run via Bourne shell only:

:       # [ `hostname` -eq "server1" ] && crontab -l
You don't have /usr/ucb in your path (that's OK), but prior to 2.5
hostname was only in /usr/ucb. Use "uname -n" instead.

Daniel