Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: cp file with a filter
- X-seq: zsh-users 14715
- From: zzapper <david@xxxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: cp file with a filter
- Date: Fri, 15 Jan 2010 19:43:06 +0000 (UTC)
- 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
- Organization: SuccessTheory
- References: <Xns9D00DA47D5E30zzappergmailcom@xxxxxxxxxxxx> <20100114225814.GB24626@xxxxxxxxxxxx> <20100115171759.1099b9a0@xxxxxxxxxxxxxxxxxxx>
- Sender: news <news@xxxxxxxxxxxxx>
Yuri D'Elia wrote in news:20100115171759.1099b9a0@xxxxxxxxxxxxxxxxxxx:
>> > value (I know I could extract the number of the directory using the
>> > php)
>>
>> typeset -a flags
>> flags=( 3 4 )
>> for f in $flags; do
>> sed "s/flag=2/flag=$f/" init.php > dir$f/init.php
>> done
>
> Is there a way to rewrite the number without having to type again?
> As in re-executing the last command after a regular expression
> substitution?
>
>
>
If you mean perform subsitute on previous line then yes?
^4^5
^4^5^:G (global)
--
zzapper
http://zzapper.co.uk/ Technical Tips
Messages sorted by:
Reverse Date,
Date,
Thread,
Author