From: Ligesh <myself@ligesh.com>
To: Zsh-workers <zsh-workers@sunsite.dk>
Subject: Regexp replace on all arguments.
Date: Sat, 11 Feb 2006 23:06:26 +0530 [thread overview]
Message-ID: <20060211173626.GA6863@lxlabs.com> (raw)
Hi folks,
I want to replace all occurrences of say '/c/' in the arguments with 'c:'. Could someone help me with completing the function below.
winexec () {
// First loop through all arguments and replace
foreach arguments $2 to $- {
replace ^/c/ with c: , ^/d/ with d: etc. (The character c, d should be preserved, '^' means beginning of the word.)
}
execute $1 with the new arguments.
}
The execution would be
$ winexec cacls.exe /c/name-of-file
Now the function should change it to:
$ calcs.exe c:/name-of-file
Thanks in advance.
next reply other threads:[~2006-02-11 17:25 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-02-11 17:36 Ligesh [this message]
2006-02-11 17:38 ` Stephane Chazelas
2006-02-11 18:21 ` Ligesh
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=20060211173626.GA6863@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).