Since you mentioned awk, here's one way.
Note this is for empty output, i.e., print the default if myCommand outputs nothing at all. If you want to handle a program that outputs a blank line, that's something different.
myCommand | awk -v def="default" '{print} END { if(NR==0) {print def} }'
{print} passes each input line through. At the end (END{...}), NR is the number of input records, i.e., the number of lines received from myCommand. This will be 0 if no output was printed by myCommand. If so, print the value of def, assigned on the command line by -v def="whatever text you want".
Tests:
$ awk -v def="default" '{print} END {if(NR==0) {print def}}' </dev/null
default
$ awk -v def="default" '{print} END {if(NR==0) {print def}}' <<<'foo'
foo
var=$(myCommand), and then use parameter expansion:echo "${var:-default}"?defaultifmyCommandproduces no output or printdefaultfor every line thatmyCommandoutputs that is empty or contains only white space or what? Please edit your question to include concise, testable sample input and expected output forsomethingas right now it's very unclear what you want.