Let's say I have two scripts, one calls the other, how can I prepend text to each echo to visually indicate the echo comes from the called command?
a.sh
#!/usr/bin/env sh
echo - BEGIN
./b.sh # Append "-" to each echo?
echo - END
b.sh
#!/usr/bin/env sh
echo - BEGIN
echo - END
Output I want:
- BEGIN
-- BEGIN
-- END
- END
I can't touch b.sh and I need to stream the output.
b.shcontained a command other thanechoand the command generated output? In general do you want the whole output fromb.shto be modified? or just output fromechos? – Kamil Maciorowski Mar 16 '23 at 19:43