Sponsored Content
Full Discussion: Multiple regex in sed
Top Forums Shell Programming and Scripting Multiple regex in sed Post 303022919 by Xterra on Sunday 9th of September 2018 09:48:27 AM
Old 09-09-2018
Thanks a TON! That worked like a charm
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

sed regex

I would like to do this: replace the word "prod" with the word "special" but it may occur through the file naturally without a command, I only want it to happen when it has a specific command in front of it. The command will always look like this <IMG,###,###,##,>prod/directory/IMG/file ... (4 Replies)
Discussion started by: Shakey21
4 Replies

2. Shell Programming and Scripting

find -regex: matching multiple extensions

I want to use find to locate files with two different extensions, and run a grep on the results. The closest I have gotten is incredibly slow and ugly: for i in `ls -laR|egrep -e '(.js|.css)'`; do find . -name $i -print|xargs grep -H searchBg; done; This method makes my eyes bleed. Help! ;) ... (2 Replies)
Discussion started by: r0sc0
2 Replies

3. Shell Programming and Scripting

sed - using regex and | need help

From my understanding when using regex1|regex2 the matching process tries each alternative in turn, from left to right, and the first one that succeeds is used. When im trying to extract the name from those examples: A) name.can.be.different.20.03.2009.boom B)... (2 Replies)
Discussion started by: TehOne
2 Replies

4. Shell Programming and Scripting

multiple regex finding in files

Hello folks, I have a text file aa.txt that contains below text (\')|(\-\-) ((\%3D)|(=)) 20%0d% i want to search each line pattern in /opt/1.log and /opt/2.log. Can some one suggest (1 Reply)
Discussion started by: learnbash
1 Replies

5. Shell Programming and Scripting

Converting perl regex to sed regex

I am having trouble parsing rpm filenames in a shell script.. I found a snippet of perl code that will perform the task but I really don't have time to rewrite the entire script in perl. I cannot for the life of me convert this code into something sed-friendly: if ($rpm =~ /(*)-(*)-(*)\.(.*)/)... (1 Reply)
Discussion started by: suntzu
1 Replies

6. UNIX for Advanced & Expert Users

Regex pattern for multiple digits

Hello, I need to construct a pattern to match the below string (especially the timestamp at the beginning) 20101222100436_temp.dat The below pattern works _temp.dat However I am trying find if there are any other better representations. I tried {14}, but it did not work. I am on... (5 Replies)
Discussion started by: krishmaths
5 Replies

7. Shell Programming and Scripting

awk with multiple regex and substring

Hi Experts, I have a file on which i want to print the line which should match following criterias. Line should not start with 0 or 9 and Line should start with 1 and ( 576th character should not be 1 or 2 or 576-580 postion should not be NIPPF or CDIPB or 576-581 postion should... (2 Replies)
Discussion started by: millan
2 Replies

8. UNIX for Advanced & Expert Users

sed REGEX to print multiple occurrences of a pattern from a line

I have a line that I need to parse through and extract a pattern that occurs multiple times in it. Example line: getInfoCall: info received please proceed, getInfoCall: info received please proceed, getInfoCall: info received please proceed, getInfoCall: info received please proceed,... (4 Replies)
Discussion started by: Vidhyaprakash
4 Replies

9. Shell Programming and Scripting

Grep with Regex multiple characters

Hi everyone, So I'm a bit confused about a regex pattern that should exist, but I can't really find any way to do it... Let's say I want to match any lines that have a specific string, but I don't know the order of the letters but I know the length. Let's say it's 10 characters and begins... (3 Replies)
Discussion started by: Lost in Cyberia
3 Replies

10. Shell Programming and Scripting

Regex with sed

hi i would like to say "DATABASENAME=" to "TABLESNAME=" remove "," and press enter myconfig file thanks (1 Reply)
Discussion started by: mnnn
1 Replies
httpdstat.d(1m) 						   USER COMMANDS						   httpdstat.d(1m)

NAME
httpdstat.d - realtime httpd statistics. Uses DTrace. SYNOPSIS
httpdstat.d [interval [count]] DESCRIPTION
This prints connection statistics for "httpd" processes, such as those from an Apache web server. Since this uses DTrace, only users with root privileges can run this command. EXAMPLES
Print statistics every second, # httpdstat.d Print every 5 seconds, 6 times, # httpdstat.d 5 6 FIELDS
TIME time, string NUM number of connections GET number of GETs POST number of POSTs HEAD number of HEADs TRACE number of TRACEs NOTES
All statistics are printed as a value per interval. This version does not process subsequent operations on keepalives. IDEA
Ryan Matteson (who first wrote a solution to this). DOCUMENTATION
See the DTraceToolkit for further documentation under the Docs directory. The DTraceToolkit docs may include full worked examples with ver- bose descriptions explaining the output. EXIT
httpdstat.d will run until Ctrl-C is hit. AUTHOR
Brendan Gregg [Sydney, Australia] SEE ALSO
dtrace(1M) version 0.70 Nov 20, 2005 httpdstat.d(1m)
All times are GMT -4. The time now is 06:52 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy