Re: David Yitzchak Cohen in <20040119194127.GW16674@xxxxxxx> > > Changing the From: header in the compose menu is easy: > > I never noticed the edit-from function ... live and learn :-) To be honest, I had to look it up in the mutt help, I only knew that something like <esc>f works. Personally, I'm using vim macros to change the header. > > > #!/bin/sh > > > file=$1 > > > ( > > > echo "/From:/s/^.*\$/From: William O'Higgins <addy_I_want@xxxxxxxxxxx>/" > > > echo "/Reply-To:/s/^.*\$/Reply-To: William O'Higgins > > > <addy_I_want@xxxxxxxxxxx>/ > > > wq" > > > ) | ed $file > > > > Perl's -i switch is very handy for in-place editing. > > Yeah, I know, but a lot of us treat it as a status symbol that we prefer > to automate an ed session :-) You are welcome to use whatever tool you like :-) Many people are usually annoyed that you can't do "filter < file > file" and have to use temp files; perl -i can be quite a relief. Using ed solves the same problem, but I wouldn't stick it with a MAX_INT-feet pole myself ;-) > I mean, come on: > > #!/usr/bin/perl -in -pi (or -i -p), actually. > s/^From:.*\$/From: William O'Higgins <addy_I_want@xxxxxxxxxxx>/; > s/^Reply-To:.*\$/Reply-To: William O'Higgins <addy_I_want@xxxxxxxxxxx>/; > > It just doesn't look nearly as cool as my pipeline to ed ;-P You could have used a 'here' document ;) > - Dave [who didn't even think of using perl -i before, to be honest] Christoph [who only recently wrote his first sed script after years of perl groking] -- Christoph Berg <cb@xxxxxxxxxxxxxxxx>, http://www.df7cb.de/ Wohnheim D, 2405, Universität des Saarlandes, 0681/9657944
Attachment:
signature.asc
Description: Digital signature