It’s a pity that awk doesn’t support capture groups in line patterns. Then you could get rid of the field separator and make the script even more comprehensible. (You can simulate this with match() in gawk, but then you must know how match() works.)
Personally, I’d probably rather use sed here:
sed -nE 's/^\s*name:\s*"([^"]*)"\s*$/\1/p"
While that regex is more complex, it is also safer and more explicit.
Personally, I’d probably rather use sed here:
While that regex is more complex, it is also safer and more explicit.