TGViewer
/r/emacs /r/emacs @r_emacs · 80 subscribers
Post #28644 11
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
Reddit From the emacs community on Reddit Explore this post and more from the emacs community
More from @r_emacs
  1. Oct 3, 2026Anyone using emacs like CRM? Title. If yes could you describe your setup? Or is there some…
  2. Oct 2, 2026Github does not preview Org mode files anymore No more README.org :( https://redd.it/1ww5a…
  3. Oct 2, 2026How can I display some properties alongside the headline in org-mode listings? I want to d…
  4. Oct 2, 2026Emacs bufferfile.el: Rename, Delete, or Copy Files and Associated Buffers (e.g., clones/in…
  5. Oct 2, 2026A tiny, text-only, read-only, emoji-free Mastodon client for Emacs. https://github.com/rou…
  6. Oct 2, 2026After upgrading to Debian 13 and bringing Emacs 28 up to date Company is causing Emacs to…
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →