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
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)
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)
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)
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)
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,
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 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)
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)