From: Harry Putnam <reader@newsguy.com>
Subject: Re: Mechaincal question Show filename of # marked
Date: 21 Dec 2000 21:10:11 -0800 [thread overview]
Message-ID: <m24rzxoxcc.fsf@gnus-5.8.8-cvs.now.playing> (raw)
In-Reply-To: Colin Walters's message of "21 Dec 2000 22:15:05 -0500"
Colin Walters <walters@cis.ohio-state.edu> writes:
> 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).
>
OK trying to get in to this, but I have no clue how that list might be
stored into a variable... In the shell, no problem but in lisp.. I'm
lost.
Imagine for a minute that you are talking to one of the inmates in `One
Flew Over the Cuckoos Nest':
Taking the first example, since I don't know how to generate a
variable containing a list I try using a single file name instead, and
insert something simple for a shell command `cat' (UUofC not
withstanding)
I'm guessing this is like a simple `for loop' and cat will be run on
each member in turn. So with just 1 member then maybe just on it.
(mapcar (lambda (x) (shell-command-to-string (concat "cat " x)))
/home/reader/Mail/tmp/awk-work/13)
So C-x C-e
Symbol's value as variable is void: \
/home/reader/Mail/tmp/awk-work/13
OK, I'm guessing it wants more paren or double quotes or something
(mapcar (lambda (x) (shell-command-to-string (concat "cat " x)))
"/home/reader/Mail/tmp/awk-work/13")
C-x C-e
("cat: 47: No such file or directory
" "cat: 104: No such file or directory
" "cat: 111: No such file or directory
[...] snip about 20 more lines
Well, I'm getting closer... May sound terribly lame, but I don't even
have a clue on how to begin looking this up in the Into or Lisp
manual.
Good thing this isn't explosive... I'd have had a serious accident by
now.
next prev parent reply other threads:[~2000-12-22 5:10 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
2000-12-22 5:10 ` Harry Putnam [this message]
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=m24rzxoxcc.fsf@gnus-5.8.8-cvs.now.playing \
--to=reader@newsguy.com \
/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).