Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Regexp replace on all arguments.
- X-seq: zsh-workers 22228
- From: Ligesh <myself@xxxxxxxxxx>
- To: Zsh-workers <zsh-workers@xxxxxxxxxx>
- Subject: Re: Regexp replace on all arguments.
- Date: Sat, 11 Feb 2006 23:51:05 +0530
- In-reply-to: <20060211173818.GA4965@sc>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <20060211173626.GA6863@xxxxxxxxxx> <20060211173818.GA4965@sc>
On Sat, Feb 11, 2006 at 05:38:19PM +0000, Stephane Chazelas wrote:
> winexec() {
> local cmd=$1
> shift || return
> argv=("${@//#\/(#b)([a-zA-Z])\//$match:}")
> "$cmd" "$@"
> }
>
I couldn't get it to work. There is no substitution happening at all. I am getting the same arguments.
winexec cacl.exe /c/name-fo-file
gives: cacls.exec /c/name-of-file.
I am sure the code is the right direction, and but there is some silly bug which makes it fail. I am actually used to vim/emacs syntax for string substitution, but I found the zsh syntax to be a bit exotic. Especially since zsh has SO many special cases. So if you could explain the above, I would be able to correct it myself.
argv=("${@//#\/(#b)([a-zA-Z])\//$match:}")
I take it that the first '@' stands for all arguments.
What's the /#?
what's (#b)?
([a-zA-Z]) stands for 1 character, enclosed in a paranthesis for its use in the replace regexp.
Thanks.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author