wow, impressive. This gave me a great start which worked. I made a minor change to only include IP Addresses
Now it lists everything, how do we do the same thing but delete what we find?
For example, I perform the search and using the example above I would like to delete a result that contains vlan /Common/VLAN215 as well as vlan /Common/VLAN233
Would it be best to search and put results in an array to delete? Just not sure what the best approach would be.
---------- Post updated at 01:46 PM ---------- Previous update was at 01:23 PM ----------
I'm way over my head and looks like I may have went in the wrong direction for the correct solution.
I need to remove VLAN215 from this configuration file but its difficult to see the pattern to make that happen. Sometimes its on a line of its own and others its multiple lines. Really difficult to wrap the head around.
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)
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)
Hi,
This is my first post.It has two parts
first part:
I want to match a line that starts with whitespace tab or similar followed by
must start with specific word and not match same word start with hyphen
like this:
grep height file1:
height: 150px;
line-height: 1.5em;
height:... (4 Replies)
I have a file which is like this
………………………………………..
…………………………………
…………………………………
……………………………………
…………………………………….
………………………………
<<<from_here>>>
………………………………
……………………………….
I want a script which would fetch the data starting from <<<from_here>>> in the file till the end... (2 Replies)
Hi im trying to add numbers, got no problem with it im using awk '{s+=$1} END {print s, "MB"}',
but what if the numbers are like mention below. who will i add them
2000 KB
1 MB
Answer: 2001
Desired:
2000 KB
1 MB
Answer: 3000 (4 Replies)
Hi
i have this script :
#!/bin/bash
DATE=$(date '+%Y-%m-%d %H:%M' -d "1 hour ago")
PASS=$(grep -A99999999999 '$DATE' /var/log/asterisk/full| grep -i 'Wrong password')
it a script that ment to go over log file a hour back from now until
the end of file.
right now im using... (5 Replies)
Hi, i have file file.txt with data like:
START
03:11:30 a
03:11:40 b
END
START
03:13:30 eee
03:13:35 fff
END
jjjjjjjjjjjjjjjjjjjjj
START
03:14:30 eee
03:15:30 fff
END
ggggggggggg
iiiiiiiiiiiiiiiiiiiiiiiii
I want the below output
START (13 Replies)
I need to find two matches in the output from ps. I am searching with ps -ef |grep mysql for:
my.cnf
/bin/sh /usr/bin/mysqld_safe --defaults-file=/data/mysql/master/agis_core/etc/my.cnf
after this match I want to search back and match the hostname which is x number of lines back, above the... (2 Replies)
hi
I have 2 file with more than 10 columns for both
1st file
apple,0,0,0......
orange,1,2,3.....
mango,2,4,5.....
2nd file
apple,2,3,4,5,6,7...
orange,2,3,4,5,6,8...
watermerlon,2,3,4,5,6,abc...
mango,5,6,7,4,6,def.... (1 Reply)
Hi,
i have 2 files , the data i need to match is in masterfile and i need to pull out column 3 from master if column 1 and 2 match and output entire row to new file
I have tried with join and awk and i keep getting blank outputs or same file
is there an easier way than what i am... (4 Replies)