Search Results

Search: Posts Made By: JayDoshi
2,172
Posted By itkamaraj
cat $rrs.*.err.txt | grep "Error $err" ...
cat $rrs.*.err.txt | grep "Error $err"

change it to

awk -v err="$err" '/Error/ && $0~err {for(i=1;i<=NF;i++)if($i~/ID/){print $(i+1);next}}' $rrs.*.err.txt
2,172
Posted By elixir_sinari
Another one: awk '$0~e {if(match($0,/ID...
Another one:
awk '$0~e {if(match($0,/ID [0-9]+/)) print substr($0,RSTART+3,RLENGTH-3)}' e="Error $err" $rrs.*.err.txt
And the output will not have the colon generated by the previous solution.
2,172
Posted By Corona688
Then the statements given to you should print one...
Then the statements given to you should print one line of output for each matching line of input.
Showing results 1 to 3 of 3

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