From: Boyang Du <duboyang.h@gmail.com>
To: zsh-workers@zsh.org
Subject: PATCH: zargs - replace all "replace string" occurences in comand
Date: Fri, 31 Dec 2021 22:19:13 +0000 [thread overview]
Message-ID: <4365631.LvFx2qVVIh@new-pc> (raw)
[-- Attachment #1: Type: text/plain, Size: 771 bytes --]
Hi,
I'm trying to use zargs as it provide nice features to avoid xargs + zsh -lic ... .
However I found that if I use replace string, only one {} is replaced.
e.g.
zargs -i{} -- hi -- echo "{} and {} is okay" will output 'hi and {} is okay'
with the change will output 'hi and hi is okay'
diff --git a/Functions/Misc/zargs b/Functions/Misc/zargs
index ecd69f7e4..fff319fbf 100644
--- a/Functions/Misc/zargs
+++ b/Functions/Misc/zargs
@@ -291,7 +291,7 @@ do
args=( "${(@)argv[1,end]}" )
shift $((end > ARGC ? ARGC : end))
if (( $#i ))
- then call=( "${(@)command/$i/$args}" )
+ then call=( "${(@)command//$i/$args}" )
else call=( "${(@)command}" "${(@)args}" )
fi
if (( ${(c)#call} > s ))
--
/******************
Best Regards
Boyang Du
******************/
[-- Attachment #2: Type: text/html, Size: 2977 bytes --]
reply other threads:[~2021-12-31 22:19 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=4365631.LvFx2qVVIh@new-pc \
--to=duboyang.h@gmail.com \
--cc=zsh-workers@zsh.org \
/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).