Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

unary operator expected

Posted on 2000-03-07
14
Medium Priority
?
1,317 Views
Last Modified: 2013-12-15
   I just bought and installed Linux-Mandrake 7.0. The install went fine except I set up the network during install, but none of the settings took, and I had to set it all up later. Now when I boot up I keep getting these assorted messages:
/etc/rc.d/rc5.d/S50network [. [= unary operator expected
    I get this for the /etc/rc.d/rc5.d S**postfix, S**rwhod, S**userd, S**bootparm (**=moves to fast for me to see on boot up)and many others. When I check the /var/log/boot.log I only see the "/etc/rc.d/rc5.d/S30postfix [. [= unary operator expected" message. I don't know much about programming, so I would have no clue what is wrong by looking at the script. Its not just rc5.d, but also /etc/rc.d/rc0.d/ through /etc/rc.d/rc6.d/ (It appears to boot with different ones each time).
    Everything seems to be working GREAT. No problems at all, Just these messages everytime I boot up.
    This is installed on a machine with a Pentium Pro 200 MHZ, 64MB Ram, a 3com combo card, ANything else I could anwser if needed.
0
Comment
Question by:SeanD
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
  • 4
  • +1
14 Comments
 
LVL 40

Expert Comment

by:jlevie
ID: 2593989
The "unary operator expected" is the shell saying that it doesn't understand somethhin in the rc?.d files. It just shouldn't happen. It's also odd that the networking set up "didn't take" during the install. My suspicion based on the description is that the install didn't properly complete.

Which model 3com combo have you got?
0
 

Author Comment

by:SeanD
ID: 2594151
I have a 3Com Etherlink III 3C590. The install went through completely. Right down to "Please remove the floppy disk and press OK to restart" or something like that. Everything works fine like I said. The network is working perfectly.
By the way, this is a gateway machine, I'm using it for a Samba server, and IP Masq server, If that makes a difference.
Even though I get these messages, EVERYTHING gets an [ OK ] when booting. Everything is working perfectly.
Sean
0
 
LVL 3

Expert Comment

by:jyu_88
ID: 2594579
you  should be able scroll back by shift +pageUp.

It mainly be caused by a comparison test against a variable, which is NULL or empty for some reason. In shell, it supposed has something like,
[ $VIPvariable = "OK" ] && echo "OK"
However, with $VIPvariable be null, this statement becomes
[ = "OK" ]
.. This will result in complaints you saw.

If you can page up find some  line numbers then you can probably look up in the script and find out which varible is not defined while it is supposed and whatnot.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:SeanD
ID: 2596959
I was at work last night and writing this message from memory, and am not sure that this makes a difference, but the exact messages are like this:    
"/etc/rc.d/rc5.d/S50network [: =: unary operator expected"
and not like this:    
"/etc/rc.d/rc5.d/S50network [. [= unary operator expected"
Also I get the same mesage when I restart samba, but it gives the OK
"/etc/sbin/samba [: =: unary operator expected
/etc/sbin/samba [: =: unary operator expected
Shutting down SMB services: [OK]
Shutting down NMB services: [OK]
/etc/sbin/samba [: =: unary operator expected
Starting SMB services: [OK]
Starting SMB services: [OK]"
but like I said, everything seems OK. I will have to take a look at those lines.
0
 
LVL 40

Accepted Solution

by:
jlevie earned 400 total points
ID: 2597452
Just as a guess, I'll bet that the error is being caused by substitution of one of the items that should be in /etc/sysconfig/network aren't there. It should something look like:

NETWORKING=yes
FORWARD_IPV4=false
HOSTNAME="localhost.localdomain"
GATEWAY=

The first three matter the most, and each should have a value.
0
 
LVL 2

Expert Comment

by:Reinier
ID: 2598375
Those error messages come from several of the network related scripts in /etc/rc.d/init.d. Just to make them better scripts you could change the line (if any)

[ ${NETWORKING} = "no" ] && exit 0

to

[ "${NETWORKING}" = "no" ] && exit 0

Your real problem probabely is that the NETWORKING variable in /etc/sysconfig/network has no value assigned, or is not present at all. Make sure the line

NETWORKING=yes

is there.
0
 
LVL 2

Expert Comment

by:Reinier
ID: 2598387
Oh, and indeed, if you didn't want "NETWORKING=no" nothing was wrong with the machine, since the scripts always executed.

0
 

Author Comment

by:SeanD
ID: 2598730
I found the suggestion about
[ ${NETWORKING} = "no" ] && exit 0
in a newsgroup last week and tried it, and nothing changed. As soon as I get a chance (I'm working now) I'll check the /etc/sysconfig/network. I know that when the network configuration didn't work on the install that I edited some of this file myself, it is very likely that I missed something there. I won't get a chance till tomarrow afternoon though, so I'll let you all know then.
Thanx
Sean
0
 
LVL 2

Expert Comment

by:Reinier
ID: 2600097
If adding the " " to
[ ${NETWORKING} = "no" ] && exit 0
didn't work you probabely have some other scripts that cause the same error. All network related scripts in /etc/rc.d/init.d have this same line.

But define NETWORKING=yes and your problems will be over.
0
 

Author Comment

by:SeanD
ID: 2601627
OK I checked out the /ets/sysconfig/network and found uot that there was no line
NETWORKING="yes"
so I added it. When I rebooted I stopped getting the unary operator expected message, but now i get 2 of these lines like this:
Bringing up interface lo    [OK]
Bringing up interface eth0  [OK]
Bringing up interface lo    [OK]
Bringing up interface eth0  [OK]
>other stuff
>
>
Starting portmapper         [OK]
Starting portmapper         [OK]
>
>
Starting postfix            [OK]
Starting postfix            [OK]    
>
>
Like I said, no more unary messages, and everything is working OK, maybe networking is being started somewhere else?
I will except the answer from jlevie, but just wanted to know about this. Should I make this another question? Is this alright to just leave alone?
Thanx
Sean
0
 
LVL 40

Expert Comment

by:jlevie
ID: 2601725
Personally, I'd want to know why that's happening, because it should be. My guess is that it sees two definitions for eth0 (they may both be the same). Normal behaviour is to loop through all the interfaces and bring them all up. Since the system doen't check to see if the second interface is really the same as the first one...

Have you looked at the network config via linuxconf? Since it manipulates the same data you might see more than one "Adapter" defined and can delete the second. Also it may emit a n error that would help pin down the problem.
0
 
LVL 2

Expert Comment

by:Reinier
ID: 2601817
Did you change anything to /etc/syslog.conf? To be precise are you sending (probabely local7.*) syslog output to the console? It seems to me that you just see two messages for one "action".

You can't do ifup eth0 twice without getting an error of some sort. Same goes for portmapper and postfix. You would never see the second green [OK].
0
 

Author Comment

by:SeanD
ID: 2602393
I didn't change anything in the /etc/syslog.conf. I checket the linuxconf network settings and there is only one entry for etho. Everything seems fine, no errors. I'll track it down at some point. Thank you all very much.
Sean
0
 
LVL 40

Expert Comment

by:jlevie
ID: 2602939
Per Reinier's comment... You can get the messages multiple times... For instance, I can  do "/etc/rc.d/init.d/network start" once the system is up and I get:
Bringing up interface lo                                   [  OK  ]
Bringing up interface eth0                                 [  OK  ]

0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Over the last ten+ years I have seen Linux configuration tools come and go. In the early days there was the tried-and-true, all-powerful linuxconf that many thought would remain the one and only Linux configuration tool until the end of times. Well,…
Little introduction about CP: CP is a command on linux that use to copy files and folder from one location to another location. Example usage of CP as follow: cp /myfoder /pathto/destination/folder/ cp abc.tar.gz /pathto/destination/folder/ab…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Suggested Courses

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question