I want to insert commands into an interactive environment using the following method:
bc <<END
1+1
quit
END
The output of the example is '2' and it appears after typing END. Suppose I would want to suppress this output. So after typing END I don't want any output to appear. How could I accomplish this?
You can accomplish it redirecting the output of
bcto/dev/null:Note that using
& > /dev/nullboth stdout and stderr will be sent to/dev/null, so not output will appear at all.