bash: replace error with success