Sponsored Content
Top Forums Shell Programming and Scripting print word after pattern match in two instances Post 302500555 by sb245 on Tuesday 1st of March 2011 03:15:40 AM
Old 03-01-2011
print word after pattern match in two instances

i have a file like below. how can i printout the digits followed by the pattern -bwout and -bwin. say i run the script by entering line number 145 (the fourth line), then the o/p should be like
5000000 1024000
Code:
8 test1 -ipprot erp -ppsout 500 -ppsin 500 -bwout 300000 -bwin 300000 -statsdevice test1 -stats 
30 test2 -addr a.b.c.249 -wdwthresh 3 -bwout 512000 -bwin 512000 -statsdevice test2 -stats 
125 test3 -addr a.b.c.0 -addrmsk 255.255.255.0 -bwlink total1 -statsdevice testing3 -stats -global 
145 test4 -group -bwout 1024000 -bwin 5000000 -statsdevice group4 -stats 
1451 test5 -addr a.b.c.251 -bwout 256000 -bwin 512000 -bwlink test4 -statsdevice test5 -stats 
14539 test6 -addr a.b.c.34 -bwboth 128000 -bwlink xyz128 -statsdevice abc123 -stats

did i make myself clear?

tia

Last edited by Franklin52; 03-01-2011 at 04:30 AM.. Reason: Please use code tags, thank you.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Replace 1 word after pattern match

Hi, Here is my pattern CREATE USER LZ IDENTIFIED BY VALUES 'A0144280ESD70' DEFAULT TABLESPACE USERS TEMPORARY TABLESPACE TEMP1 PROFILE DEVELOPER_D_1 ACCOUNT UNLOCK / The Sed command must look for the Line that contains TEMPORARY TABLESPACE and replace the immediate word... (4 Replies)
Discussion started by: rajan_san
4 Replies

2. Shell Programming and Scripting

Search word in a line and print earlier pattern match

Hi All, I have almost 1000+ files and I want to search specific pattern. Looking forwarded your input. Search for: word1.word2 (Which procedure contain this word, I need procedure name in output. Expected output: procedure test1 procedure test2 procedure test3 procedure test4 ... (7 Replies)
Discussion started by: susau_79
7 Replies

3. Shell Programming and Scripting

Print all the words after a match word

Hi, I want to print all words till the last word after the match of "ERROR" word. For e.g. I'll get an sqlplus error with e.g. 1 $ ./calltest_fn.ksh var test_var:=test_fn1; calltest_fn.ksh file1 file2 file3 ERROR at line 4: ORA-06550: line 4, column 11: PLS-00201: identifier... (5 Replies)
Discussion started by: dips_ag
5 Replies

4. Solaris

Error: svcs: Pattern 'pooladm.conf' doesn't match any instances

Hi, I got the following errors during zfs resource pool configuration. Please help. Thanks. # svcs *pool* svcs: Pattern 'pooladm.conf' doesn't match any instances STATE STIME FMRI # svcadm enable system/pools:default # svcs *pool* svcs: Pattern 'pooladm.conf' doesn't match any... (4 Replies)
Discussion started by: aixlover
4 Replies

5. Shell Programming and Scripting

Need one liner to search pattern and print everything expect 6 lines from where pattern match made

i need to search for a pattern from a big file and print everything expect the next 6 lines from where the pattern match was made. (8 Replies)
Discussion started by: chidori
8 Replies

6. Shell Programming and Scripting

Script to match a pattern and print only the pattern and after that

Hi, I am writing a shell script to parse some files, and gather data. The data in the files is displayed as below. .......xyz: abz: ...... .......xyz: abz: ..... I have tried using awk and cut, bu the position of these values keep changing, so I can use awk and split it into columns. ... (14 Replies)
Discussion started by: Serena
14 Replies

7. UNIX for Dummies Questions & Answers

Match Pattern after certain pattern and Print words next to Pattern

Hi experts , im new to Unix,AWK ,and im just not able to get this right. I need to match for some patterns if it matches I need to print the next few words to it.. I have only three such conditions to match… But I need to print only those words that comes after satisfying the first condition..... (2 Replies)
Discussion started by: 100bees
2 Replies

8. Shell Programming and Scripting

Print a word after a match

Hi all, I have the below line: 08 03 * * 1-5 XXXXXXXXXXXXX -ENVI LDNFOUAT10 -EXE xxxxxxxx -CONFIG \${xxxxx} -SUBCLASS RESET -START -EXTRAAPPARGS \" -env 38LDNFOUAT10 \" >> /tmp/SRRC_xxxxxxx_start.log.`/usr/bin/date +\%Y\%m\%d` 2>&1 I want to print just one word after the string "-env", in... (7 Replies)
Discussion started by: Cvg
7 Replies

9. Shell Programming and Scripting

Print string after the word match

Hi, I have the logs : cat logsx.txt 744906,{"reportingGroups":,"version":"2.0"} 678874,{"reportingGroups":,"version":"2.0"} 193571,{"reportingGroups":,"version":"2.0"} 811537,{"reportingGroups":,"version":"2.0"} 772024,{"reportingGroups":,"version":"2.0"}... (5 Replies)
Discussion started by: justbow
5 Replies

10. Shell Programming and Scripting

Match Pattern and print pattern and multiple lines into one line

Hello Experts , require help . See below output: File inputs ------------------------------------------ Server Host = mike id rl images allocated last updated density vimages expiration last read <------- STATUS ------->... (4 Replies)
Discussion started by: tigerhills
4 Replies
MIXMASTER-UPDATE(1)						 mixmaster-update					       MIXMASTER-UPDATE(1)

NAME
mixmaster-update - Fetch new reliability stats and keyrings for mixmaster SYNOPSIS
mixmaster-update [--verbose] [--source=SOURCE] [--configfile=FILE] [--destination=DIRECTORY] mixmaster-update --list-sources mixmaster-update --help mixmaster-update --version DESCRIPTION
mixmaster-update is a simple yet configurable script that downloads latest remailer reliability statistics and keyrings for your mixmaster. As having uptodate reliability statistics is imperative if you want to make use of remailers it is recommended that you always update this data should it be older that twelve or twentyfour hours and you intent to use mixmaster. mixmaster-update has several built in stats sources. You can view the list of stats sources with the --list-sources parameter. If you want to make use of another stats source which is not listed in the output of --list-sources you can do so by setting the location of mlist and others in your configuration file. OPTIONS
--verbose Print verbose output to standard output. May be given more than once to increase verbosity. --source=SOURCE Use this built in stats source. --configfile=FILE Also parse the configuration file FILE. --destination=DIRECTORY Write output to DIRECTORY rather than the directory given in the config file or ~/.Mix/. --list-sources List available stats sources. --help Print a brief help message and exit successfully. --version Print a version information and exit successfully. FILES
/etc/mixmaster/update.conf ~/.Mix/update.conf MIXMASTER_UPDATE_CONF environment --configfile parameter These files are parsed in this order. Later definitions overwrite older ones. This config file defines proxy settings, where to write the results to and which stats source to use /etc/mixmaster/allpingers.txt ~/.Mix/allpingers.txt MIXMASTER_ALLPINGERS environment --allpingers parameter These files are parsed in this order. Later definitions overwrite older ones. The allpingers.txt is a list of all pingers. FILEFORMAT
The update.conf configuration file for mixmaster-update is simple. Lines with whitespace only are ignored as are lines that have the hash our pound ("#") sign as their first non whitespace character. Lines are always truncated at the first hash our pound ("#") sign. Lines are pairs of keys and values separated by a convenient amount of whitespace. The key is case insensitive. Allowed keys: source Use the builtin stats source with this name destination Write the downloaded data to this directory rather than ~/.Mix proxy Set proxies for different protocols. The value is split into two parts: protocol and proxy URL. They are separated by whitespace. Example: PROXY http http://proxy.example.com:8080/ PROXY ftp http://proxy.example.com:8080/ The format for allpingers.txt is simple too: [example] base = http://stats.example.net/ rlist = http://stats.example.net/rlist.txt mlist = http://stats.example.net/mlist.txt rlist2 = http://stats.example.net/rlist2.txt mlist2 = http://stats.example.net/mlist2.txt rlist_html = http://stats.example.net/rlist.html mlist_html = http://stats.example.net/mlist.html rlist2_html = http://stats.example.net/rlist2.html mlist2_html = http://stats.example.net/mlist2.html rchain_html = http://stats.example.net/mlist2.html pgpring = http://stats.example.net/pgp-all.asc pgpring_rsa = http://stats.example.net/pgp-rsa.asc mixring = http://stats.example.net/pubring.mix type2list = http://stats.example.net/type2.list The file may contain several such definitions. ENVIRONMENT
MIXMASTER_UPDATE_CONF MIXMASTER_ALLPINGERS See the FILES section abobe. HOME Your homedirectory. Used for finding your user configuration file. Also the default destination directory is $HOME/.Mix/ SEE ALSO
mixmaster(1) BUGS
Please report them to the Debian Bug Tracking System as described at "http://bugs.debian.org/" or use a tool like reportbug(1). AUTHOR
Peter Palfrader <peter@palfrader.org> $Revision: 459 $ 2013-02-08 MIXMASTER-UPDATE(1)
All times are GMT -4. The time now is 05:59 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy