I have a bash script like this:

} 2>&1 | tee file.log

The problem is that when I kill the script, an error is printed like this:

line 214:  8679 Terminated              { commands...} 2>&1
      8680  | tee file.log

Is there a way I can prevent this message from showing?


Disable and enable job control:

set +m
kill ...
set -m

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.