From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/33846 Path: main.gmane.org!not-for-mail From: Colin Walters Newsgroups: gmane.emacs.gnus.general Subject: Re: Mechaincal question Show filename of # marked Date: 21 Dec 2000 22:15:05 -0500 Organization: The Ohio State University Dept. of Computer and Info. Science Sender: owner-ding@hpc.uh.edu Message-ID: <874rzxtadi.church.of.emacs@meta.verbum.org> References: Reply-To: ding@gnus.org NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1035169876 27264 80.91.224.250 (21 Oct 2002 03:11:16 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 21 Oct 2002 03:11:16 +0000 (UTC) Return-Path: Original-Received: from spinoza.math.uh.edu (spinoza.math.uh.edu [129.7.128.18]) by mailhost.sclp.com (Postfix) with ESMTP id 9CF6AD049D for ; Thu, 21 Dec 2000 22:19:44 -0500 (EST) Original-Received: from sina.hpc.uh.edu (lists@Sina.HPC.UH.EDU [129.7.3.5]) by spinoza.math.uh.edu (8.9.1/8.9.1) with ESMTP id VAB28940; Thu, 21 Dec 2000 21:16:12 -0600 (CST) Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Thu, 21 Dec 2000 21:15:35 -0600 (CST) Original-Received: from mailhost.sclp.com (postfix@66-209.196.61.interliant.com [209.196.61.66] (may be forged)) by sina.hpc.uh.edu (8.9.3/8.9.3) with ESMTP id VAA17681 for ; Thu, 21 Dec 2000 21:15:23 -0600 (CST) Original-Received: from cis.ohio-state.edu (mail.cis.ohio-state.edu [164.107.115.5]) by mailhost.sclp.com (Postfix) with ESMTP id 7EA06D049D for ; Thu, 21 Dec 2000 22:15:47 -0500 (EST) Original-Received: from meta.verbum.org (root@gold.cis.ohio-state.edu [164.107.112.16]) by cis.ohio-state.edu (8.9.1/8.9.1) with ESMTP id WAA04067 for ; Thu, 21 Dec 2000 22:15:46 -0500 (EST) Original-Received: by meta.verbum.org (Postfix (Debian/GNU), from userid 1000) id 3D5EF1034A; Thu, 21 Dec 2000 22:15:06 -0500 (EST) Original-To: ding@gnus.org X-Attribution: Colin X-Face: %'w-_>8Mj2_'=;I$myE#]G"'D>x3CY_rk,K06:mXFUvWy>;3I"BW3_-MAiUby{O(mn"wV@m dd`)Vk[27^^Sa Original-Lines: 35 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.0.94 Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:33846 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:33846 Harry Putnam 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.