10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
Hi
In a file I have string in multiple lines. Like below:
<?=test.getObjectName("L", "testTBL","D") ?>
<?=test.getObjectName("L", "testTBL","testDB", "D") ?>
I want to use regex to search for the pattern "<?=test.getObjectName...?>"
If the parenthesis has 3 parameters then return 2nd... (5 Replies)
Discussion started by: dashing201
5 Replies
2. Shell Programming and Scripting
The sample file:
dept1: user1,user2,user3
dept2: user4,user5,user6
dept3: user7,user8,user9
I want to match by '/^dept2.*/' but don't want to have substring 'dept2:' in output. How to compose such regex? (8 Replies)
Discussion started by: urello
8 Replies
3. Shell Programming and Scripting
Hi
We have a tool to monitor logs in our environment. The tool accepts log pattern match only using regex and I accept I am a n00b in that:confused:. I had been banging my head to make it work without much success and at last had to turn on to my last option to post it here. I had got great... (2 Replies)
Discussion started by: radioactive9
2 Replies
4. Shell Programming and Scripting
$ find /opt/data_* -maxdepth 3 -type d -name "main*" 2> /dev/null
/opt/data_025/maindblogs
/opt/data_026/maindblogs
/opt/data_027/maindblogs
/opt/data_028/maindblogs
$ find /opt/data_* -maxdepth 3 -type d -name "rvlogs*" 2> /dev/null
/opt/data_002/prod/rvlogs2_archive... (4 Replies)
Discussion started by: urello
4 Replies
5. Shell Programming and Scripting
Fairly straightforward, but I'm having an awful time getting what I thought was a simple regex to work. I'll give the command I was playing with, and I'm aware why this one doesn't work (the 1,3 is off the A-Z, not the whole expression), I just don't know what the fix is:
Actual Output(s):
$... (5 Replies)
Discussion started by: Vryali
5 Replies
6. Shell Programming and Scripting
I need RegEx to delete text block delimited by "^--" and "^request saved" if the block contained the pattern "FAILED:No air,rail,hotel or car" in the following.
Many thanks in advance!
company_id=9292 queue_id=72 internationalOnly=0
Building XML...
ABC123
Adding passenger first=First ... (1 Reply)
Discussion started by: roshansharma
1 Replies
7. UNIX for Advanced & Expert Users
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
8. Shell Programming and Scripting
Hello,
let's start by giving you guys a few examples of the text:
"READ /TEXT123/ABC123"
"READ /TEXT123/ABC123/"
"READ TEXT123/ABC123"
"READ TEXT123/ABC123/"
"READ TEXT123/TEXT456/ABC123"
"READ /TEXT123/TEXT456/ABC123"
"READ /TEXT123/TEXT456/ABC123/"
TEXT and ABC can be and I... (5 Replies)
Discussion started by: TehOne
5 Replies
9. UNIX for Dummies Questions & Answers
why does sed 's/.* //' show the last word in a line
and
sed 's/ .*//' show the first word in a line? How is that blank space before or after the ".*" being interpreted in the regex?
i would think the first example would delete the first word and the next example would delete the second... (1 Reply)
Discussion started by: glev2005
1 Replies
10. Shell Programming and Scripting
Hello,
I am trying to covert a for statement into a single awk script and I've got everything but one part.
I also need to execute an external script when "not found", how can I do that ?
for TXT in `find debugme -name "*.txt"` ;do
FPATH=`echo $TXT | sed 's/\(.*\)\/\(.*\)/\1/'`
how... (7 Replies)
Discussion started by: TehOne
7 Replies