Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Segregating a Global Alias
- X-seq: zsh-users 18669
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: Segregating a Global Alias
- Date: Mon, 24 Mar 2014 15:36:28 -0700
- In-reply-to: <XnsA2FAB51B6E85Bdavidrayninfocouk@80.91.229.13>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <XnsA2FA95D9D45BDdavidrayninfocouk@80.91.229.13> <CAH+w=7baCBR0KK+Uvhu8D53CPsVNvq4YSVsrbb35H1ReCHQZAA@mail.gmail.com> <XnsA2FAB2C8DE4F8davidrayninfocouk@80.91.229.13> <XnsA2FAB51B6E85Bdavidrayninfocouk@80.91.229.13>
On Mar 24, 5:47pm, zzapper wrote:
} Subject: Re: Segregating a Global Alias
}
} zzapper <david@xxxxxxxxxxxxxx> wrote in
} news:XnsA2FAB2C8DE4F8davidrayninfocouk@80.91.229.13:
}
} > for f in NF ; perl -ne 's/(<\/\w+>)/$1\n/g; print' < $f > $f.txt
That's fine, but it creates a variable $f that hangs around after the
command is finished.
} BTW this is perl one liner to put each XML tag on a newline.
}
} But can anyone else trump Bart's or my attempt?
Do it entirely in perl?
perl -pe '$. == 1 && open STDOUT,"> $ARGV.txt"; s/(<\/\w+>)/$1\n/g' NF
That'll work for a whole list of files just like the "for" loop.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author