From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/33847 Path: main.gmane.org!not-for-mail From: Harry Putnam Newsgroups: gmane.emacs.gnus.general Subject: Re: Mechaincal question Show filename of # marked Date: 21 Dec 2000 21:10:11 -0800 Sender: owner-ding@hpc.uh.edu Message-ID: References: <874rzxtadi.church.of.emacs@meta.verbum.org> NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1035169877 27265 80.91.224.250 (21 Oct 2002 03:11:17 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 21 Oct 2002 03:11:17 +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 B074FD049D for ; Fri, 22 Dec 2000 00:17:38 -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 XAB29260; Thu, 21 Dec 2000 23:14:05 -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 23:13:29 -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 XAA18176 for ; Thu, 21 Dec 2000 23:13:19 -0600 (CST) Original-Received: from freedom.LABridge.com (home.LABridge.com [206.117.169.5]) by mailhost.sclp.com (Postfix) with ESMTP id 7CFA4D049D for ; Fri, 22 Dec 2000 00:13:39 -0500 (EST) Original-Received: from reader.labridge.com (DSL02-160.LABridge.com [206.117.4.160]) by freedom.LABridge.com (8.8.8/8.8.8) with ESMTP id VAA24063 for ; Thu, 21 Dec 2000 21:14:38 -0800 Original-Received: (from reader@localhost) by reader.labridge.com (8.9.3/8.9.3) id VAA29357; Thu, 21 Dec 2000 21:13:36 -0800 X-Authentication-Warning: reader.labridge.com: reader set sender to reader@newsguy.com using -f Original-To: ding@gnus.org In-Reply-To: Colin Walters's message of "21 Dec 2000 22:15:05 -0500" User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.5 Original-Lines: 60 Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:33847 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:33847 Colin Walters writes: > 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). > 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.