Sponsored Content
Full Discussion: Re: exception using AWK
Top Forums Shell Programming and Scripting Re: exception using AWK Post 302700059 by agama on Wednesday 12th of September 2012 11:43:28 PM
Old 09-13-2012
Then this:

Code:
awk -F = '
    /^NAME/ { n = $2; next }
    /^TARGET/ { t = $2; next; }
    /^STATE/ {
        if( t != $2 && !(t == "OFFLINE" && $2 == "ONLINE") )
            print n;
    }
' input-file

This User Gave Thanks to agama For This Post:
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

exception handling

Does exception handling exist in any UNIX enviornment? I develop on Windows MSVC++ land and need to port to UNIX. (1 Reply)
Discussion started by: RichardS
1 Replies

2. UNIX for Dummies Questions & Answers

How to catch the exception

Dear friends, I am transferring some files to a windows system from Unix m/c thru FTP Script given below. echo "open $host quote USER $userid quote PASS $pwd $verbose $type cd $dir bin put $file close quit"|$ftp... (0 Replies)
Discussion started by: Vijayakumarpc
0 Replies

3. Linux

MMU exception

I hope to post in the right forum, otherwise I apologize for this. if a MMU exception is caused by a process which tries to access to other memory segment (out of its own address space) what the kernel does in this case ? maybe kernel kills the "bad" process ? (2 Replies)
Discussion started by: Puntino
2 Replies

4. Shell Programming and Scripting

Perl Exception - $!,$?,$@

Hi, I am trying to understand the significance of the special variables $!,$@ and $? in perl. I have a code block as follows: eval { Code Segment 1: #authenticating to the remote server $ftpobj -> login($username,$password) or die "Can't login to $remote_host"; ... (12 Replies)
Discussion started by: DILEEP410
12 Replies

5. Shell Programming and Scripting

Exception Handling

Hi, I have written a script to load csv files into a mysql database, however, i would like for the shell script to exit in the event of an error (missing file, load error etc.) - currently if an error is encountered the next statement is processed - This is how i am loading the csv scripts ... (5 Replies)
Discussion started by: bertpereira
5 Replies

6. Shell Programming and Scripting

Exception handling

Sometimes when I try to use curl to upload to an ftp server, I get the message: $curl -T file.wmv ftp.eu.filesonic.com --user user:password curl: (8) Got a 421 ftp-server response when 220 was expected How do I get the script to try again if I get the message curl: (8)? (2 Replies)
Discussion started by: locoroco
2 Replies

7. Programming

Exception Handling C++

Hello All, I have a question ....which I am totally confused about! If I have a fxn foo in a program which returns a logical value. But it has a posssiblity to throw some exception. Now my exception handler returns a value as a string stating why the exception occured. But my... (1 Reply)
Discussion started by: mind@work
1 Replies

8. Solaris

solaris 7 exception

Hi all, An application works well under 2.6 but under 7 it gives TEXT_IO exceptions. (Is_Open, Check_Is_Open, Get_Line procedures). Any idea? Regards (3 Replies)
Discussion started by: endoavour
3 Replies

9. Shell Programming and Scripting

Monitor logs for exception and if exception come then sent an email

Hi Folks, please advise , I have logs generated on unix machine at location /ops/opt/aaa/bvg.log , now sometimes there come exception in these logs also, so I want to write such a script such that it should continuously monitor these logs and whenever any exception comes that is it try to find... (3 Replies)
Discussion started by: tuntun27272727
3 Replies

10. UNIX for Beginners Questions & Answers

Parsing output with awk - need assistance on exception

HI Folks - I have a business need to check weather or not there are "active" sessions within a particular application I interact with prior to running any automation. I have built a function that first exports all "sessions" from my respective application to a text file. The output is as... (2 Replies)
Discussion started by: SIMMS7400
2 Replies
SYSTEMD-NETWORKD-WAIT-ONLINE.SERVICE(8) 		     systemd-networkd.service			   SYSTEMD-NETWORKD-WAIT-ONLINE.SERVICE(8)

NAME
systemd-networkd-wait-online.service, systemd-networkd-wait-online - Wait for network to come online SYNOPSIS
systemd-networkd-wait-online.service /lib/systemd/systemd-networkd-wait-online DESCRIPTION
systemd-networkd-wait-online is a one-shot system service that waits for the network to be configured. By default, it will wait for all links it is aware of and which are managed by systemd-networkd.service(8) to be fully configured or failed, and for at least one link to gain a carrier. OPTIONS
The following options are understood: -i, --interface= Network interface to wait for before deciding if the system is online. This is useful when a system has several interfaces which will be configured, but a particular one is necessary to access some network resources. This option may be used more than once to wait for multiple network interfaces. When used, all other interfaces are ignored. --ignore= Network interfaces to be ignored when deciding if the system is online. By default, only the loopback interface is ignored. This option may be used more than once to ignore multiple network interfaces. --timeout= Fail the service if the network is not online by the time the timeout elapses. A timeout of 0 disables the timeout. Defaults to 120 seconds. SEE ALSO
systemd(1), systemd-networkd.service(8) systemd 237 SYSTEMD-NETWORKD-WAIT-ONLINE.SERVICE(8)
All times are GMT -4. The time now is 01:29 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy