Skip to main content
10 events
when toggle format what by license comment
Sep 28, 2013 at 17:02 answer added Danijel-James W timeline score: 0
Mar 21, 2013 at 20:07 vote accept Joost
Mar 21, 2013 at 8:22 comment added kopischke @GordonDavisson I agree Lauri’s answer is neat, but it does not explain why OP’s approaches are failing (literal vs. syntactical quoting, word splitting on parameter expansion of "$*" vs. "$@"), which you pointed out.
Mar 21, 2013 at 1:25 comment added Gordon Davisson @kopischke: Actually, I don't think I have anything to add to @Lauri Ranta's answer (which I've already voted for) -- she includes the $* trick, and also includes a run handler trick (which makes it more robust about special characters in the message) that I didn't think of.
Mar 21, 2013 at 0:14 comment added kopischke And the the problem with the second approach also has its root in the intricacies of Bash’s argument parsing: "$@" expands to a list of several word arguments, which is not what you want. Use "$*" instead, which expands to a single word argument. See the BashWiki articles Arguments and Quotes. @GordonDavisson, care to turn your comment into an answer?
Feb 17, 2013 at 16:03 comment added Gordon Davisson Part of the problem is coming from storing the command in a variable before executing it; see BashFAQ 050: I'm trying to put a command in a variable, but the complex cases always fail!
Feb 17, 2013 at 15:47 answer added Lri timeline score: 1
Feb 17, 2013 at 13:20 history edited Joost CC BY-SA 3.0
added 209 characters in body
Feb 17, 2013 at 13:09 history edited Joost CC BY-SA 3.0
deleted 9 characters in body
Feb 17, 2013 at 12:37 history asked Joost CC BY-SA 3.0