Sponsored Content
Top Forums Shell Programming and Scripting search and goto next line then take the output Post 302340179 by imas on Monday 3rd of August 2009 02:49:16 AM
Old 08-03-2009
search and goto next line then take the output

Hi All,

I have a file in which the contents are as shown below:

Number of Dynamic Addresses Allocated : 107790 Addresses:
10.3.29.202,10.47.1.145,10.2.4.98,190.1.89.95,.. (many ip addresses separated by comma)
----
----
----
10.38.3.114,10.38.31.12,205.211.32.175,10.18.30.15,200.122.18.29

Number of Static Addresses ......
Addresses:
----


In this file there are static Ips as well but I am interested only in dynamic Ips.

I would like my output should only include Dynamic Addresses in this format

10.3.29.202|10.47.1.145|10.2.4.98|190.1.89.95|.....
----
----
----
10.38.3.114|10.38.31.12|205.211.32.175|10.18.30.15|200.122.18.29

What command or script i should write to get only dynamic ips in pipe separated format.

Your help is appreciated.

Thanks
Imas
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Perl: Search for string on line then search and replace text

Hi All, I have a file that I need to be able to find a pattern match on a line, search that line for a text pattern, and replace that text. An example of 4 lines in my file is: 1. MatchText_randomNumberOfText moreData ReplaceMe moreData 2. MatchText_randomNumberOfText moreData moreData... (4 Replies)
Discussion started by: Crypto
4 Replies

2. Shell Programming and Scripting

Search a line and output next line as well

Hi, I have a requirement to search a particular text and if found print next line also. Appreciate your help. Thanks (10 Replies)
Discussion started by: kamranjalal
10 Replies

3. Shell Programming and Scripting

perl search and replace - search in first line and replance in 2nd line

Dear All, i want to search particular string and want to replance next line value. following is the test file. search string is tmp,??? ,10:1 "???" may contain any 3 character it should remain the same and next line replace with ,10:50 tmp,123 --- if match tmp,??? then... (3 Replies)
Discussion started by: arvindng
3 Replies

4. Shell Programming and Scripting

Search: find current line, then search back

Hello. I want to find a line that has "new = 0" in it, then search back based on field $4 () in the current line, and find the first line that has field $4 and "last fetch" Grep or Awk preferred. Here is what the data looks like: 2013-12-12 12:10:30,117 TRACE last fetch: Thu Dec 12... (7 Replies)
Discussion started by: JimBurns
7 Replies

5. Shell Programming and Scripting

(n)awk: print regex search output lines in one line

Hello. I have been looking high and low for the solution for this. I seems there should be a simple answer, but alas. I have a big xml file, and I need to extract certain information from specific items. The information I need can be found between a specific set of tags. let's call them... (2 Replies)
Discussion started by: Tobias-Reiper
2 Replies

6. Shell Programming and Scripting

Bash to goto specific line/function and start processing if user response is yes

In the bash below I am trying to run the script entire script including the ....(which is a bunch of code) and then in the run function if the user response is y (line in bold). then start processing from execute function. Basically, goto the # extract folder for variable filename line and start... (4 Replies)
Discussion started by: cmccabe
4 Replies

7. Shell Programming and Scripting

A dash to GOTO or a dash from GOTO, that is the question...

Well, guys I saw a question about GOTO for Python. So this gave me the inspiration to attempt a GOTO function for 'dash', (bash and ksh too). Machine: MBP OSX 10.14.3, default bash terminal, calling '#!/usr/local/bin/dash'... This is purely a fun project to see if it is possible in PURE... (3 Replies)
Discussion started by: wisecracker
3 Replies

8. UNIX for Beginners Questions & Answers

Get an output of lines in pattern 1st line then 10th line then 11th line then 20th line and so on.

Input file: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 (6 Replies)
Discussion started by: Sagar Singh
6 Replies

9. Web Development

302 Redirects Issues Effected Google Search Console (GSC) Fixed - DBSEO Goto Rewrite Problems Solved

Finally! Yesterday I FINALLY figured out why Google Search Console (GSE) was showing so many pages with 302 redirects in our link budget. For over a year, I thought this issue was relate to either Apache2 or DBSEO (our PHP module which rewrites our links to be SEO friendly). However, when I... (5 Replies)
Discussion started by: Neo
5 Replies

10. UNIX for Beginners Questions & Answers

Search a multi-line shell command output and execute logic based on result

The following is a multi-line shell command example: $cargo build Compiling prawn v0.1.0 (/Users/ag/rust/prawn) error: failed to resolve: could not find `setup_panix` in `human_panic` --> src/main.rs:14:22 | 14 | human_panic::setup_panix!(); | ... (2 Replies)
Discussion started by: yogi
2 Replies
RAHOSTS(1)						      General Commands Manual							RAHOSTS(1)

NAME
rahosts - report network addresses in argus(8) data. COPYRIGHT
Copyright (c) 2000-2003 QoSient. All rights reserved. SYNOPSIS
rahosts [ra-options] -M modes [ expression ] DESCRIPTION
Rahosts reads argus(8) data from an argus data source, and outputs a list of sorted network addresses. Based on user supplied criteria, rahosts can generate lists of IP addresses and/or MAC addresses, if available. With IP addresses, rahosts can track the full network and host address, or any network address, based on the mode indicated. Like all ra based clients, rahosts supports a large number of options, configuration through .rarc files, and input filtering using the terminating filter expression. See the ra(1) man page for details on ra-options and expression syntax. RAHOSTS SPECIFIC OPTIONS
-M mode Specify mode of operation. Supported address modes are ip, ether and all address types. The default is to output IP addresses. When IP Addresses are being processed, the network address can be specified with the additional modes class, classA, classB and classC. EXAMPLES
By default, rahosts will output the unique IP addresses seen in an argus data stream. Using the -M mode options you can output all unique class B network addresses that access the server narly.wave.com: rahosts -r argus.data -M classB host narly.wave.com Print the ethernet addresses used to support the HTTP service. rahosts -r argus.data -M ether dst port http AUTHORS
Carter Bullard (carter@qosient.com). SEE ALSO
ra(1), rarc(5), 07 January 2002 RAHOSTS(1)
All times are GMT -4. The time now is 05:33 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy