I believe your error message is written on stderr. You need to redirect it to /dev/null.
./sim_program 2>/dev/null
That error message is probably going to stderr.
Try putting this at the start of your script:
#!/bin/bash
exec 2> /dev/null
and anything send to stderr will go to the null device rather than your terminal.
Thank you for answering! This does not solve the problem, though. As far as I know, >&
will redirect both stderr and stdout.
It seems like the error message I want to suppress comes from somewhere else than the sim_program
, perhaps even from the parent itself. No matter how I redirect the output from sim_program
, the error message I want to lose remains printed to screen.