zsh-workers
 help / color / mirror / code / Atom feed
* Regexp replace on all arguments.
@ 2006-02-11 17:36 Ligesh
  2006-02-11 17:38 ` Stephane Chazelas
  0 siblings, 1 reply; 4+ messages in thread
From: Ligesh @ 2006-02-11 17:36 UTC (permalink / raw)
  To: Zsh-workers


 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.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-02-11 19:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-02-11 17:36 Regexp replace on all arguments Ligesh
2006-02-11 17:38 ` Stephane Chazelas
2006-02-11 18:21   ` Ligesh
2006-02-11 19:20     ` Bart Schaefer

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).