zsh-workers
 help / color / mirror / code / Atom feed
From: Ligesh <myself@ligesh.com>
To: Zsh-workers <zsh-workers@sunsite.dk>
Subject: Re: Regexp replace on all arguments.
Date: Sat, 11 Feb 2006 23:51:05 +0530	[thread overview]
Message-ID: <20060211182105.GA7789@lxlabs.com> (raw)
In-Reply-To: <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.



  reply	other threads:[~2006-02-11 18:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-11 17:36 Ligesh
2006-02-11 17:38 ` Stephane Chazelas
2006-02-11 18:21   ` Ligesh [this message]
2006-02-11 19:20     ` Bart Schaefer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060211182105.GA7789@lxlabs.com \
    --to=myself@ligesh.com \
    --cc=zsh-workers@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).