Added grep -o option to ensure the script won't get other digits as the error code result
Fixes: #5105