Search Results

Search: Posts Made By: numele
4,527
Posted By Scrutinizer
Try: nawk '/interface/&&/move-group/{if(s)print...
Try:
nawk '/interface/&&/move-group/{if(s)print s; s=x; n=2} n-->0{s=s $0 ORS} /filter-shared 14/{s=x; n=0} END{if(s)print s}' file
4,527
Posted By DGPickett
Relatively easy in sed:sed -n ' :loop ...
Relatively easy in sed:sed -n '
:loop
N
/\ninterface/!{
$!{
s/\n/:/
b loop
}
s/$/\
/
}
/filter-shared 14/!{
...
4,527
Posted By drl
Hi. This longish post is intended to show a...
Hi.

This longish post is intended to show a general technique for working with paragraphs or stanzas of data. Each stanza is transformed so that a copy of it becomes a single, standard text line,...
4,527
Posted By Scrutinizer
One way with awk: awk '/^interface/{print x}1'...
One way with awk:
awk '/^interface/{print x}1' file |
awk '!/filter-shared 14/ && $1~/move-group/{print $1}' FS='\n' RS=
4,527
Posted By bartus11
Does it have to be AWK? Try this if not:perl...
Does it have to be AWK? Try this if not:perl -ln0e 'while (/(interface[^\n]+).*?(?=interface|$)/sg){$x=$&;$y=$1;print $y if $x!~/filter-shared 14/ && $y=~/move-group/}' file
5,995
Posted By Chubler_XL
Nice work, I've seen many posts here asking for...
Nice work, I've seen many posts here asking for something similar so I know others will find this useful.

The 600 sec timeout is a little long - do you encounter issues with some commands taking a...
2,532
Posted By ctsgnb
awk...
awk '{y=x;x=$0}y~/bridge1483/&&x!~/description/{print " ip description blabla..."}1' infile
2,532
Posted By Akshay Hegde
Try $ awk '/encapsulation...
Try

$ awk '/encapsulation bridge1483/{print;getline;if($0!~/ip description/)print "ip description blah_blah_blah"}1' fileinterface atm 1/0.190158 point-to-point
atm pvc 100190158 19 158...
1,674
Posted By rdcwayx
I don't review the logic with better arithmetic,...
I don't review the logic with better arithmetic, I just provide the same function for shorter script as same as in your code

cat test.sh

echo $1|awk '{if ($5=="24") print $1,$2,$3, "0/24"
...
1,810
Posted By Scrutinizer
Nice solution RudiC ! I think it would be...
Nice solution RudiC !

I think it would be better to separate the fields in the index to avoid overflow between ranges.
I made an adaptation to your solution so that the CIDR prefix becomes...
1,810
Posted By RudiC
Your sample output is not correct! Tryawk ...
Your sample output is not correct!

Tryawk '{if (++C[$1$2($3-$3%8)] == 8) print $1,$2,($3-$3%8),$4}' FS="." OFS="." file
10.71.192.0
10.122.232.0
2,021
Posted By radoulov
Try the new version and use nawk instead of awk.
Try the new version and use nawk instead of awk.
4,620
Posted By LiorAmitai
You can try to redirect the output to: ...
You can try to redirect the output to:

2>/dev/null
3,449
Posted By ctsgnb
sed 's|http[^ ]*|<a href="&">&</a>|g' input ...
sed 's|http[^ ]*|<a href="&">&</a>|g' input
[ctsgnb@shell ~]$ echo "If you wish to view your options, go to http://20.1.1.1/myoptions.cgi or go to http://10.1.1.1/nextoptions.sh" | sed 's|http[^...
2,358
Posted By methyl
cat tmp/diff | while read line do ...
cat tmp/diff | while read line
do
case ${line} in
"CISCO1"*) echo "CISCO WORKS"
;;
"SE2"*) echo "SE2 WORKS"
...
1,396
Posted By bartus11
awk -F\: '!a[$3]++' file
awk -F\: '!a[$3]++' file
1,449
Posted By bartus11
awk -F\| '/\.acs/{print...
awk -F\| '/\.acs/{print toupper(substr($2,1,3))"."$7}' list
Showing results 1 to 17 of 17

 
All times are GMT -4. The time now is 05:01 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy