I have a file with most of the lines formatted in this way:
There are a few lines with:
using AWK I have a one-liner that excludes case sensitivity, uses the field delimeter ":" and searches for the account name and if there is any ip adress/ip adresses associated with the string:
which print the whole sting correctly:
That is fine but my question is, how can I have awk additionally, once it finds the account name and the ip adress/ip adresses to print out "only the ip adress/ip adresses"
using testaccount2 as an example
The above worked because the ip addess/ip address reside in the next to last field but what do I do if the field is in the last field. Is there a way I can tell AWK once it finds the account name and the ip adress/ip adresses to print out "only the ip adress/ip adresses" no matter where they are in the sting
Any tips on this problem will be greatly appreciated.
I need to build a Linux mailserver, that needs to meet the following requirements:
3 usergroups: endusers, supervisors, and management
Endusers will be on a local Linux mailserver
Supervisors and management will be on Google Apps
... (0 Replies)
i guys, i have a bash script , and it works, but i need an awk file, and i can't convert this code like:
#!/bin/awk -f
.....
my script
#!/bin/bash
awk '/\<FIRST\>|\<SECOND\>|\<THIRD\>|\<ZERO\>/' DOC.txt
thanks :) (4 Replies)
Hi,
I want to search for a particular string using awk and print "Found" or "Not Found" depending on the search.
On searching this forum i got this code but it is not working: (6 Replies)
I need to search the file using strings "Request Type" , " Request Method" , "Response Type" and by using result set find the xml tags and convert into a single line?. below are the scenarios.
Cat test
Nov 10, 2012 5:17:53 AM
INFO: Request Type
Line 1.... (5 Replies)
Hi Shell Tigers,
I am trying to acheive search and replace strings within a setup file.
Help much appreciated.
test.setup
ORACLE_HOME=/oracle/product/11.0.0/home01
PATH1=/perm_loc/3222/FTP/cfg1
PATH2=/perm_loc/3222/FTP/cfg2/bin
PATH3=/perm_loc/3222/FTP/cfg3/bin
So... (3 Replies)
Input:
|Running the Rsync|Sun Oct 16 22:48:01 BST 2016
|End of the Rsync|Sun Oct 16 22:49:54 BST 2016
|Running the Rsync|Sun Oct 16 22:54:01 BST 2016
|End of the Rsync|Sun Oct 16 22:55:45 BST 2016
|Running the Rsync|Sun Oct 16 23:00:02 BST 2016
|End of the Rsync|Sun Oct 16 23:01:44 BST 2016... (4 Replies)
I have this fileA
TEST FILE ABC
this file contains ABC;
TEST FILE DGHT this file contains DGHT;
TEST FILE 123
this file contains ABC,
this file contains DEF,
this file contains XYZ,
this file contains KLM
;
I want to have a fileZ that has only (begin search pattern for will be... (2 Replies)
Discussion started by: vbabz
2 Replies
9. Post Here to Contact Site Administrators and Moderators
I am trying to write a shell script that generates links to a website. Not to spam it. The code necessarily adds things that are links, and so get rejected.
In the end I have up, and have not written the post.
Whilst I apprecaite you want to avoid spam, could you not implement something so... (1 Reply)
Discussion started by: drkirkby
1 Replies
LEARN ABOUT DEBIAN
aggregate-ios
AGGREGATE-IOS(1) General Commands Manual AGGREGATE-IOS(1)NAME
aggregate-ios - optimise a concatenated set of cisco/IOS prefix filters to help make them nice and short.
SYNOPSIS
aggregate-ios <source_config >optimised_config
DESCRIPTION
Takes cisco IOS configuration on stdin, and optimises any prefix filters found using aggregate(1). Optimised filters are produced on std-
out.
OPTIONS
None.
DIAGNOSTICS
Any diagnostics produced by aggregate(1) are passed through on stderr.
EXAMPLES
The following configuration fragment:
ip prefix-list AS65530 description Foo, Inc
ip prefix-list AS65530 permit 10.1.0.0/16
ip prefix-list AS65530 permit 10.2.0.0/16
ip prefix-list AS65530 permit 10.2.1.0/24
ip prefix-list AS65530 permit 10.3.0.0/16
ip prefix-list AS65531 description Bar.Com
ip prefix-list AS65531 seq 5 permit 192.168.1.0/24
ip prefix-list AS65531 seq 10 permit 192.168.2.0/24
ip prefix-list AS65531 seq 15 permit 192.168.0.0/19
is optimised as follows:
ip prefix-list AS65530 permit 10.1.0.0/16 le 24
ip prefix-list AS65530 permit 10.2.0.0/15 le 24
ip prefix-list AS65531 permit 192.168.0.0/19 le 24
SEE ALSO aggregate(1)HISTORY
Aggregate-ios was written by Joe Abley <jabley@mfnx.net>.
BUGS
All those in aggregate(1) and then some :)
Joe Abley 2000 November 27 AGGREGATE-IOS(1)