From: vp@a-b.xyz
To: 9front@9front.org
Subject: dnsquery(8): prompt on stderr
Date: Fri, 30 Aug 2019 11:13:24 +0200 [thread overview]
Message-ID: <0829F14A385F6EC9FFE8989904B3256D@a-b.xyz> (raw)
[-- Attachment #1: Type: text/plain, Size: 328 bytes --]
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
[-- Attachment #2: dnsquery.diff --]
[-- Type: text/plain, Size: 423 bytes --]
diff -r 7789bbc91c22 sys/src/cmd/ndb/dnsquery.c
--- a/sys/src/cmd/ndb/dnsquery.c Fri Aug 23 21:39:20 2019 +0200
+++ b/sys/src/cmd/ndb/dnsquery.c Fri Aug 30 10:20:33 2019 +0200
@@ -58,7 +58,7 @@
Biobuf in;
Binit(&in, 0, OREAD);
- for(print("> "); lp = Brdline(&in, '\n'); print("> ")){
+ for(fprint(2, "> "); lp = Brdline(&in, '\n'); fprint(2, "> ")){
n = Blinelen(&in) -1;
while(isspace(lp[n]))
lp[n--] = 0;
reply other threads:[~2019-08-30 11:13 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=0829F14A385F6EC9FFE8989904B3256D@a-b.xyz \
--to=vp@a-b.xyz \
--cc=9front@9front.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).