I am trying build a command using xargs
to pass configuration parameters : user.name
and user.email
to git commit
.
Command to be built by xargs
:
git -c user.name=abc -c user.email=abc@mail.com commit
What I have tried :
echo "-c user.name=abc -c user.email=abc@mail.com" | xargs -I % git % commit
However, git
returns this :
unknown option: -c user.name=abc -c user.email=abc@mail.com
Even with xargs
verbose, the command works fine.
echo "-c user.name=abc -c user.email=abc@mail.com" | xargs -tI % git % commit
This prints the command to be executed git -c user.name=abc -c user.email=abc@mail.com commit
which works when copy-pasted to the terminal.
Note that the configuration parameters are separated by whitespaces.
Some context for what exactly I am trying to do by passing configuration parameters