Gnus development mailing list
 help / color / mirror / Atom feed
From: Colin Walters <walters@cis.ohio-state.edu>
Subject: Re: Mechaincal question Show filename of # marked
Date: 21 Dec 2000 22:15:05 -0500	[thread overview]
Message-ID: <874rzxtadi.church.of.emacs@meta.verbum.org> (raw)
In-Reply-To: <m2wvct7orc.fsf@gnus-5.8.8-cvs.now.playing>

Harry Putnam <reader@newsguy.com> writes:

> Yes... It gives a nice list like this:
> 
> ("/home/reader/Mail/prinb/13456" "/home/reader/Mail/prinb/13455" \
> "/home/reader/Mail/prinb/13454" "/home/reader/Mail/prinb/13453")
> 
> Cool.
> 
> How can I feed that list to a shell script?  Can I pipe it to a
> shell script some how?

There are a few list processing functions you can use.  In Emacs 20,
the traditional way to do this is with `mapcar', and an anonymous
function (lambda).

So for example, if you want to run a shell command foo on those files:

(mapcar (lambda (x) (shell-command-to-string (concat "foo " x)))
        thelist)

where `thelist' is a variable in which you have stored the above list.

If you use the CL macro `dolist', you can say:

(require 'cl)
(dolist (x thelist)
  (shell-command-to-string (concat "foo " x)))

There are some differences between the above two forms, but those
differences aren't really important for this task.

`dolist' will be builtin to Emacs 21, too.





  reply	other threads:[~2000-12-22  3:15 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-12-21  3:06 Harry Putnam
2000-12-21 10:02 ` Kai Großjohann
2000-12-21 14:28   ` Harry Putnam
2000-12-21 15:42 ` Kai Großjohann
2000-12-21 15:55   ` Harry Putnam
2000-12-22  3:15     ` Colin Walters [this message]
2000-12-22  5:10       ` Harry Putnam
2000-12-22  6:05         ` Colin Walters
2000-12-22  8:44         ` Kai Großjohann
2000-12-22  8:40     ` Kai Großjohann

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=874rzxtadi.church.of.emacs@meta.verbum.org \
    --to=walters@cis.ohio-state.edu \
    --cc=ding@gnus.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).