How to "*shell-command" and suppress output? All my searches yield the opposite question. (I'd rather not resort to >/dev/null 2>&1 cheap tricks.)
tl;dr: "(shell-command "foo")" but fully suppress stdout. I'd rather not "(shell-command "foo >/dev/null 2>&1")" but that's my least bad option today.
"What have you tried?" Scroll down.
I've got a little bash script the fires off when I save wiki pages. It does all kinds of insane nonsense.
But it keeps dumping stdout to the output window. I didn't mind when it was a one-liner. But it's...usually got some pretty loquacious output (needed for other executions.)
The script in question is just:
#!/bin/bash
curl http://127.0.0.1:1616/plugin/wss/run_sweep/
And the hooked function
(defun mpw-run-wiki-sweep ()
"Sweep the wiki for changes and push."
(interactive)
;; Dumps to an output window "live"
;; (async-shell-command "bash /home/mpwilson/bin/hhc/run_wiki_sweep.sh")
;; Dumps to an output window "live" (evidently that nil doesn't /dev/null the output)
;; (async-shell-command "bash /home/mpwilson/bin/hhc/run_wiki_sweep.sh" nil)
;; dumps static output into "output buffer" splitting the window horizontally to give me all the details.
;; (shell-command "bash /home/mpwilson/bin/hhc/run_wiki_sweep.sh")
;; Least bad option.
(shell-command "bash /home/mpwilson/bin/hhc/run_wiki_sweep.sh >/dev/null 2>&1")
)
https://redd.it/1wvs830
@r_emacs
Post #28644
11