Search Results

Search: Posts Made By: joeg1484
1,581
Posted By vgersh99
for a non-GNU sed - might be harden a bit...
for a non-GNU sed - might be harden a bit more/better:

sed 's/@[^ ][^ ]*[.][^ ][^ ]*/@REDACTED/g' myFile
1,581
Posted By nezabudka
Hi sed 's/@\w\+\.\w\+/@REDACTED/g' or sed...
Hi
sed 's/@\w\+\.\w\+/@REDACTED/g'
or
sed 's/@\w\+\.\w\+/@REDACTED/3'
1,220
Posted By RavinderSingh13
Hello joeg1484, Could you please try...
Hello joeg1484,

Could you please try following once.


awk '/inet addr:/ && match($0,/[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+/){print substr($0,RSTART,RLENGTH)}' Input_file


Thanks,
R. Singh
1,220
Posted By Don Cragun
Hi nezabudka, Note that with <colon> as the...
Hi nezabudka,
Note that with <colon> as the field separator, $2 in the line:
inet addr:123.123.123.123 Bcast:123.123.123.255 Mask:255.255.255.0
will be 123.123.123.123 Bcast (there are...
1,220
Posted By nezabudka
As an alternative: sed -n '/inet addr/...
As an alternative:
sed -n '/inet addr/ s/.*:\([^ ]\+\).*/IP Address is: \1/p'
1,220
Posted By nezabudka
awk 'BEGIN {FS=":"; print "IP Address is: "}...
awk 'BEGIN {FS=":"; print "IP Address is: "} /inet addr/ { print $2 }'
1,220
Posted By Don Cragun
In the line: inet...
In the line:
inet addr:123.123.123.123 Bcast:123.123.123.255 Mask:255.255.255.0
with FS set to a colon character, awk is seeing the leading eleven <space> characters as part of field...
801
Posted By rdrtx1
dos2ux < infile | sed 'N;N;s/\n/,/g'
dos2ux < infile | sed 'N;N;s/\n/,/g'
2,779
Posted By RudiC
Try escaping the <new line> chars when assigning...
Try escaping the <new line> chars when assigning the text variable:

text='-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\
This content is or could contain personal information.\...
3,299
Posted By RudiC
awk ' {HN = $1 ...
awk '
{HN = $1
sub (/[0-9]*$/, _, HN)
sub (/^[a-z]*/, _, $1)
}
NR == 1 {printf "%s[%04d-", HN, $1
}
NR...
3,299
Posted By RudiC
the shell might not be the fittest tool. Try awk:...
the shell might not be the fittest tool. Try awk: awk '
{HN = $1
sub (/[0-9]*$/, _, HN)
sub (/^[a-z]*/, _, $1)
}
NR == 1 ...
Showing results 1 to 11 of 11

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