Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Regexp replace on all arguments.
- X-seq: zsh-workers 22225
- From: Ligesh <myself@xxxxxxxxxx>
- To: Zsh-workers <zsh-workers@xxxxxxxxxx>
- Subject: Regexp replace on all arguments.
- Date: Sat, 11 Feb 2006 23:06:26 +0530
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- Reply-to: myself@xxxxxxxxxx
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.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author