I'm sure I'm missing something simple, but I'm using an executive script to call a few utility scripts and I want to handle all of the output from the utilities via one pipe. My issue is the utilities use stderr to report error conditions, but I can't capture that for use in the parent script.
Parent Script:
#!/bin/bash
child 2>&1 >/dev/null
Child Script
#!/bin/bash
echo "Print"
echo "Error" 1>&2
What I expect is that the stderr
of child
(and all of it's commands) is redirected to stdout
(hence no output), but when I execute parent
I get Error
echo'd to the terminal ("Print" is sent to /dev/null).