Hi
I have a error message like this.
ERROR at line 1:
ERROR at line 15:
ERROR at line 49:
I want to grep the number from the ERROR line.
Can some one help here.
Thanks,
Rami Reddy.
Hi
I have a error message like this.
ERROR at line 1:
ERROR at line 15:
ERROR at line 49:
I want to grep the number from the ERROR line.
Can some one help here.
Thanks,
Rami Reddy.
use "cut" command
awk -F'[ :]' { print $(NF-1) } ' file
grep -o [0-9]* file
awk -F' |:' '{print $4}' file
Hi, I add a clarification: if you apply this solution to the error output of a script may be necessary to redirect execute a redirect
./script.sh 2>&1 | awk -F' |:' '{print $4}'