summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2020-03-08 11:46:34 -0700
committerOri Bernstein <ori@eigenstate.org>2020-03-08 11:46:34 -0700
commite652be5559a70aa339a3952889f0421b9dda5ceb (patch)
treeeafee20b2f97d5caf165f720fd9ba2ad3267bc78
parentfe393882506834722eda40d94289133366f5a210 (diff)
downloadplan9front-e652be5559a70aa339a3952889f0421b9dda5ceb.tar.xz
"": output previous action to stderr
When redirecting output from "", it prints the command to stdout, which garbles things like: % foo <inspect output> % "" > /dev/snarf Now, we send it to stderr.
-rwxr-xr-xrc/bin/""4
1 files changed, 2 insertions, 2 deletions
diff --git a/rc/bin/"" b/rc/bin/""
index d5089583c..5f717ed7f 100755
--- a/rc/bin/""
+++ b/rc/bin/""
@@ -4,10 +4,10 @@ PROMPT='[^ ]*(%|;)+[ ]+'
_x = `{" $* | tail -1}
if(~ $#_x 0) {
- echo no such command found
+ echo no such command found >[1=2]
exit notfound
}
-echo ' ' $_x
+echo ' ' $_x >[1=2]
_x=`{ echo -n 'eval '''; echo $_x | sed 's/^'$PROMPT'//; s/''/''''/g; s/$/''/'}
rc -c $"_x