If I call a function in bash, and that function itself is designed to output messages to the terminal using printf, how can I suppress that functionality. Allow me to explain further.
Normally I would have a main script. This script calls a function. That function does its normal stuff and outputs to the terminal using printf.
I am trying to create an alternative option where you can say, run that function in the background and don't output anything.
Normally I would think to do the following:
FUNCTION & > /dev/null 2>&1
This will run the normal function in the background and discard all output.
It seems to work at first. Where the messages usually appear is blank and the main script finishes running. Once back to a prompt though, the function(s) (which is looped for lots of different things) complete and start outputting to the terminal below the prompt.
Thoughts?