DAFNIX
1
Hi I am very new to KSH programming
and need some help with finding a string in an error log
currently i am doing
cat FTP_LOG.lis | grep Warning
which gives me
Warning: Authentication failed. Remaining authentication methods: 'publickey,pas
I want to only pick up the test between the "Warning:" and the fullstop"."
Any help appreciated
cheers
DAF
aigles
2
Try something like this :
sed '/Warning/!d;s/.*\(Warning[^.]*\.\).*/\1/' < FTP_LOG.lis
Jean-Pierre.
here's one simpler, in Python:
for lines in open("FTP.lis"):
if lines.startswith("Warning"):
for c in lines:
if c == '.': break
print c,
reborg
4
nawk -F '[:.]' '$1 == "Warning" { print $2 }' FTP_LOG.lis
DAFNIX
5
Thank you
reborg, aigles and ghostdog74
for your isolutions, they work a treat
Cheers
DAF