Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion macro to save attachments renamed

Received: by 10.68.134.225 with SMTP id pn1mr2413658pbb.7.1330982453612;
        Mon, 05 Mar 2012 13:20:53 -0800 (PST)
MIME-Version: 1.0
Path: h9ni43400pbe.0!nntp.google.com!news1.google.com!goblin3!goblin1!goblin.stu.neva.ru!npeer.de.kpn-eurorings.net!npeer-ng0.de.kpn-eurorings.net!newsfeed.arcor.de!newsspool1.arcor-online.net!news.arcor.de.POSTED!not-for-mail
Newsgroups: comp.mail.mutt
From: Ulrich Thorwarth <ulrich.thorwa...@arcor.de>
Subject: Re: macro to save attachments renamed
References: <d208dbe0-a5b5-4c6b-8e65-c4b5b4697e0b@p7g2000yqk.googlegroups.com>
 <a20a29-u13.ln1@odin.th>
 <a926aac5-2145-4c0f-b6dc-cf720903de5c@o16g2000yqg.googlegroups.com>
 <jj0ri7$l6l$1@news-rocq.inria.fr>
 <03392513-74c5-4c57-8d9e-ab5373969996@x17g2000yqj.googlegroups.com>
 <slrnjla92p.1ls.grahn+nntp@frailea.sa.invalid>
User-Agent: slrn/pre1.0.0-18 (Linux)
Date: Mon, 5 Mar 2012 22:20:46 +0100
Message-ID: <eanf29-1f3.ln1@odin.th>
Lines: 34
Organization: Arcor
NNTP-Posting-Date: 05 Mar 2012 22:20:52 CET
NNTP-Posting-Host: 096a7b20.newsspool1.arcor-online.net
X-Trace: DXC=b`U]THfMKk1RadXUBHgFh3ic==]BZ:af>4Fo<]lROoR1<`=YMgDjhg2m8;f]mX?]R69XG=nMXB_h5kMQ75g`l_X9YA7GKP?l6m2DJKbKTTSIm4
X-Complaints-To: usenet-abuse@arcor.de

ok, no really solution so far, here is my next idea:
Unfortunately I'm not too familiar with macros in mutt, don't know about
<shell-esacpe> or calling scripts, BUT...

If it is one particular directory, what about a scripts like this (might
be triggered by a mutt-macro, cronjob or manually):


#!/bin/sh
if [ -z "$1" ]
then
  infiles=`ls -x *.doc`
else
  infiles="$@"
fi

for i in $infiles; do
  NAME=`echo $i | tr -d \'\"\)\(\:\,\?\!\/\-`
  NAME=`echo $NAME | tr [:blank:] _`
  NAME=`echo $NAME | tr 'A-Z' 'a-z'`
  mv -v $i $NAME
done


If treating all files in the directory is too much, take
infiles=`ls -tr1 | tail -1`

and you only treat the newest!

(all untested)
Ulrich