Sponsored Content
Top Forums UNIX for Advanced & Expert Users Regex to match Exact port number (netstat command) Post 302925194 by Corona688 on Friday 14th of November 2014 12:52:49 PM
Old 11-14-2014
I agree, cramming it into a regex is more difficult than (column >= "6000")...

Code:
netstat -an | nawk -F"[. \t]+" '(($5 >= "6000") && ($5 <= "6009")) || (($10 >= "6000") && ($10 <= "6009"))'

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

exact string match ; search and print match

I am trying to match a pattern exactly in a shell script. I have tried two methods awk '/\<mpath${CURR_MP}\>/{print $1 $2}' multipath perl -ne '/\bmpath${CURR_MP}\b/ and print' /var/tmp/multipath Both these methods require that I use the escape character. I am guessing that is why... (8 Replies)
Discussion started by: bash_in_my_head
8 Replies

2. Shell Programming and Scripting

Issues with an exact match using regex in perl!

Hello Guys, I am trying to make an exact match for an email address entered as an argument, using perl, however, it's not working if I put a "$" in the email address. See the below outputs, Correct Match : bash-2.03$ echo sandy@test.com | perl -wln -e 'print if /(^*\@test.com$)/i'... (6 Replies)
Discussion started by: suffisandy
6 Replies

3. Shell Programming and Scripting

grep regex, match exact string which includes "/" anywhere on line.

I have a file that contains the 2 following lines (from /proc/mounts) /dev/sdc1 /mnt/backup2 xfs rw,relatime,attr2,noquota 0 0 /dev/sdb1 /mnt/backup xfs rw,relatime,attr2,noquota 0 0 I need to match the string in the second column exactly so that only one result is returned, e.g. > grep... (2 Replies)
Discussion started by: jelloir
2 Replies

4. Shell Programming and Scripting

command to match ethernet port to network card

hi I juts want to know if there is a command that checks if an ethernet port corresponds to a network card. ex. I have 3 network cards, one is two ports, and the other two 8 ports. How do I know that eth0 corresponds to the the two-port network card and eth9 corresponds to the first 8-port... (2 Replies)
Discussion started by: h0ujun
2 Replies

5. Shell Programming and Scripting

Regex: print matched line and exact pattern match

Hi experts, I have a file with regexes which is used for automatic searches on several files (40+ GB). To do some postprocessing with the grep result I need the matching line as well as the match itself. I know that the latter could be achieved with grep's -o option. But I'm not aware of a... (2 Replies)
Discussion started by: stresing
2 Replies

6. Solaris

How to find port number wwn of particular port on dual port HBA,?

please find the below o/p for your reference bash-3.00# fcinfo hba-port HBA Port WWN: 21000024ff295a34 OS Device Name: /dev/cfg/c2 Manufacturer: QLogic Corp. Model: 375-3356-02 Firmware Version: 05.03.02 FCode/BIOS Version: BIOS: 2.02; fcode: 2.01;... (3 Replies)
Discussion started by: sb200
3 Replies

7. UNIX for Beginners Questions & Answers

Find command with Metacharacter (*) Should match exact filename

Hi, Below is list of files in my directory. -rw-rw-r--. 1 Roots Roots 0 Dec 26 06:58 12345_kms_report.csv -rw-rw-r--. 1 Roots Roots 0 Dec 26 06:59 12346_kms_report.csv -rw-rw-r--. 1 Roots Roots 0 Dec 26 06:59 12347_kms_report.csv -rw-rw-r--. 1 Roots Roots 0 Dec 26 06:59... (2 Replies)
Discussion started by: Balraj
2 Replies

8. Shell Programming and Scripting

Match exact String with sed command

I have a workaround to the problem i m posting, however if someone wants to look at my query and respond ... i will appreciate. This is in reference to this thread -> https://www.unix.com/shell-programming-and-scripting/267630-extract-between-two-exact-matched-strings.html I have data.txt as... (11 Replies)
Discussion started by: mohtashims
11 Replies

9. Shell Programming and Scripting

awk to update file based on partial match in field1 and exact match in field2

I am trying to create a cronjob that will run on startup that will look at a list.txt file to see if there is a later version of a database using database.txt as the source. The matching lines are written to output. $1 in database.txt will be in list.txt as a partial match. $2 of database.txt... (2 Replies)
Discussion started by: cmccabe
2 Replies

10. Shell Programming and Scripting

Sendmail K command regex: adding exclusion/negative lookahead to regex -a@MATCH

I'm trying to get some exclusions into our sendmail regular expression for the K command. The following configuration & regex works: LOCAL_CONFIG # Kcheckaddress regex -a@MATCH +<@+?\.++?\.(us|info|to|br|bid|cn|ru) LOCAL_RULESETS SLocal_check_mail # check address against various regex... (0 Replies)
Discussion started by: RobbieTheK
0 Replies
VTF2PROFILE(1)							       Tools							    VTF2PROFILE(1)

NAME
vtf2profile - Generate a TAU profile set from a vampir trace file SYNOPSIS
vtf2profile [-p profile] [-i interval_start interval_end] [-c] [-h] {-f tracefile} DESCRIPTION
vtf2profile is created when TAU is configured with the -vtf=<vtf_dir> option. This tool converts a VTF trace file (*.vpt) to a tau profile set (profile.A.B.C where A, B and C are the node, context and thread numbers respectively). The vtf file to be read is specified in the command line by the -f flag followed by the file's location. The VTF tracefile specified may be in gzipped form, eg app.vpt.gz. -p is similarly used to specify the relative path to the directory where the profile files should be stored. If no output directory is specified the current directory will be used. A contiguous interval within the vtf file may be selected for conversion by using the -i flag followed by two integers, representing the timestamp of the start and end of the desired interval respectively. The entire vtf file is converted if no interval is given. OPTIONS
-f tracefile -Specify the Vampir tracefile to be converted. -p profile -Specify the location where the profile file(s) should be written. -i interval_start interval_end -Limit the profile produced to the specified interval within the vampir trace file. -c -Opens a command line interface for the program. -h -Displays a help message. EXAMPLES
To convert a vampir tracefile, trace.vpt, to an equivalent TAU profile, use the following: vtf2profile -f trace.vpt To produce a TAU profile in the ./profiles directory representing only the events from the start of the tracefile to timestamp 6000, use: vtf2profile -f trace.vpt -p ./profiles -i 0 6000 SEE ALSO
tau2vtf(1), tau2profile(1) 12/22/2005 VTF2PROFILE(1)
All times are GMT -4. The time now is 11:40 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy