dnsquery(8) prints the interactive prompt on stdout together with query results, making scripted usage unnecessarily difficult. A straightforward solution is prompting on stderr instead: as practiced by rc(1), among many others -- promptly taking care of the issue: ; echo 9front.org mx | ndb/dnsquery >[2]/dev/null -- kvik