git - Read an arbitrary string from the console -
i've bash function looks this.
function gg() { git add . && git commit -v -m "$*" }
it takes arguments console , uses commit message.
the problem wont handle special characters ()
, ´
, "
, on. there way escape ingoing params can use given arguments?
this how use function.
gg fixed bugs (closed 123)
it runs command.
git add . && git commit -v -m "fixed bugs (closed 123)"
that example return error.
-bash: syntax error near unexpected token `('
your error isn't coming out of script, it's coming bash, trying interpret special characters before gets passed script.
gg "fixed bugs (closed 123)"
should work fine.
Comments
Post a Comment