From: Emanuel Berg <embe8573@student.uu.se>
To: help-gnu-emacs@gnu.org
Subject: not-instantly-obvious method to get output of shell command to variable
Date: Thu, 31 Jul 2014 00:39:48 +0200 [thread overview]
Message-ID: <87y4vah3nv.fsf@debian.uxu> (raw)
Just wrote this to load the configuration files from
.emacs.
Did spend some (pleasant) time getting the output of
the shell (zsh) command "ls" into the variable `files'
(check it out).
Perhaps that is yet another thing to add for everyone
to use from the holster?
I agree silly configuration and cool hacks shouldn't be
added (unless they are really cool) but such basic
building blocks are great. It boosts creativity if
people don't have to get stuck on details all the time
when they want to do creative stuff.
(let ((files (with-temp-buffer
(call-process-shell-command
"ls ~/.emacs.d/emacs-init/**/*.elc ~/.emacs-no-bc"
nil ; no INFILE
t) ; BUFFER (t = current buffer, i.e. the temp one)
(buffer-substring (point-min) (point-max)) )))
(dolist (f (split-string files)) (load-file f)) )
--
underground experts united
next reply other threads:[~2014-07-30 22:39 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-30 22:39 Emanuel Berg [this message]
2014-07-31 4:54 ` not-instantly-obvious method to get output of shell command to variable Eli Zaretskii
2014-07-31 8:28 ` Nicolas Richard
[not found] ` <mailman.6325.1406795217.1147.help-gnu-emacs@gnu.org>
2014-07-31 20:14 ` Emanuel Berg
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=87y4vah3nv.fsf@debian.uxu \
--to=embe8573@student.uu.se \
--cc=help-gnu-emacs@gnu.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.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.