null error in if command

null error in if command

Post by Gareth Burges » Sun, 11 Nov 2001 22:33:48



I have wriiten a script that searches for the temperature line in a metar
file. Basically using awk and cut it searches for a "/". If  / = / it gets
temperature,  if  anything else = / it processes the next elif. This is fine
until a null is returned, then I get an argument expected error. How can I
stop it exiting on the error and get it to process the next elif?

Thanks

gareth

 
 
 

null error in if command

Post by Chris F.A. Johnso » Sun, 11 Nov 2001 22:56:39



> I have wriiten a script that searches for the temperature line in a metar
> file. Basically using awk and cut it searches for a "/". If  / = / it gets
> temperature,  if  anything else = / it processes the next elif. This is fine
> until a null is returned, then I get an argument expected error. How can I
> stop it exiting on the error and get it to process the next elif?

It sounds as though you need quotation marks around something, but unless
you post the section of your script that is causing problems, along with a
sample of the data format, it's almost impossible to tell where your
problem lies.

--
    Chris F.A. Johnson                        http://cfaj.freeshell.org
    ===================================================================
    My code (if any) in this post is copyright 2001, Chris F.A. Johnson
    and may be copied under the terms of the GNU General Public License

 
 
 

1. rsh machine -n 'command >&/dev/null </dev/null &'

My copy of the Unix FAQ suggests syntax like this

            rsh machine -n 'command >&/dev/null </dev/null &'

for running rsh (assuming I use csh on the remote machine, and
something similar if I use sh remotely).  This has always worked
fine for me under SunOS 4.1.2.

My question is: Will this magic necessary under Solaris 2.X?

Many thanks!
---
------------------------------------------------------------------
Francois-Michel Lang          (202) 752-6067   FAX: (202) 752-5074


2. how do you force search for eth1 in Kernel???

3. Errors compiling Wingz 1.4 Add-ins (Linux 1.3.99, GCC 2.6)

4. Help with libthread_db interface

5. setup.ins error when installing OO in 5.0-REL

6. Dell 2400/SMP problem

7. Solaris 2.6: command to search binaries for char string portion (not null terminated)?

8. Number of Files in a Directory.. part 2 :)

9. Solaris 2.6: unix command to search binaries for char string portion (not null terminated

10. NULL problem in files/commands etc. - affects smail and others.

11. map meta scroll-Lock to xscreensaver-command -lock > /dev/null ?

12. suspect list_empty( {NULL, NULL} )

13. HELP: 2>&1 > /dev/null != 2>&- > /dev/null ???