10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Here is the content of a file:
abcdefgh
1234
When I do:
grep a?c <file>
I expect the output to show "abcdefgh". Its not happening. Any ideas?
"a?c" should mean either ac or c. This should mean the first line is a match. Yet its not happening. I have tried with -e option in grep, with... (1 Reply)
Discussion started by: Rameshck
1 Replies
2. Shell Programming and Scripting
I need to fetch particular string from log file based on grep condition match.
Actual requirement is need to print the next word from the same line based on grep string condtion match.
File :Java.lanag.xyz......File copied completed : abc.txt
Ouput :abc.txt
I have used below... (5 Replies)
Discussion started by: siva83
5 Replies
3. Shell Programming and Scripting
Hello,
Awk seem treat the pattern as regular expression, how can awk search not using regular expression? e.g. just represent for "", not "A" or "a" . I don't want to add backslash . (2 Replies)
Discussion started by: 915086731
2 Replies
4. Shell Programming and Scripting
Dear all,
I have a specific problem that I don't quite understand how to solve. I have two files, both of the same format:
XXXXXX_FIND1 bla bla bla
bla
bla
bla
bla
bla
bla
bla
bla
bla
========
(return)
XXXXXX_FIND2 bla bla bla
bla
bla
bla (10 Replies)
Discussion started by: TheTransporter
10 Replies
5. Shell Programming and Scripting
Hi I just started on GNU Grep with regex and am finding it very challenging and need to ask for help already...
here is the problem, I have a page (MYFILE) which consists of the following....
<div>
<input type="hidden" name="__EVENTTARGET" id="__EVENTTARGET" value="" />
<input type="hidden"... (2 Replies)
Discussion started by: noobie74645
2 Replies
6. Shell Programming and Scripting
hello,
I am writting a regular expression that intend to match any tunnel or serial interface but it doesn't mtach any serial sub-interface.
For example, statement should match "Tunnel3" or "Serial0/1" but shouldn't match "Serial0\1.1" (doesn't include dot ".")
I tried the following but... (3 Replies)
Discussion started by: ahmed_zaher
3 Replies
7. Shell Programming and Scripting
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
8. Shell Programming and Scripting
Hi All,
@months = qw(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec);
$day=091023;
$day_combine = $day;
$day_combine =~ s/({2})({2})({2})/20$1-$months-$3/;
Instead of three lines, is possible to combine the last two lines into a single line? means no need assign $day to $day_combine... (2 Replies)
Discussion started by: jimmy_y
2 Replies
9. Shell Programming and Scripting
Hi All,
I have file.txt with contents like this:
random text
To: recipient@email.co.uk
<HTML>S7randomtext more random text
random text
To: recip@smtpemail.com
<HTML>E5randomtext more random text
random text
I need the output to look like this:
1,,,1,S7
1,,,1,E5
My code so... (9 Replies)
Discussion started by: terry2009
9 Replies
10. UNIX for Dummies Questions & Answers
Hi,
I'm struggling with a regex that would match a 'b' that follows an 'a' and is at the end of a string of non-white characters. For example:
Line 1: aba abab b abb aab bab baa
I can find the right strings but I'm lacking knowledge of how to "discard" the bits that precede bs.... (2 Replies)
Discussion started by: machinogodzilla
2 Replies