Hey all, who's any good at bash scripting?
I've been trying for two-and-a-half hours now to make a fairly simple shell
script work, and I've been through every imaginable combination of quoting,
and nothing I've tried works. The bash FAQ doesn't have anything to say on
the matter, nor could I figure it out from the Advanced Bash-Scripting Guide.
I'm not a proud man, so I don't mind begging for help. The trouble is that
I want to:
a) declare a variable which contains the date in ANSI format, then
b) concatenate that variable and a few others into another variable, then
c) pass that other variable to a function, then finally
d) invoke the command line specified in the variable within the function.
Sounds easy, you think? Not quite. There's a catch: the date string
contains a space in it. And I can't find any way at all to get that date
string passed to the command line from within the function without that space
breaking things totally. If I don't try and quote it, the time part of the
datestamp is taken as a separate command line argument and cvs doesn't
understand it. If I do try and quote it, bash mangles the variable into
gibberish. Let me demonstrate:
[snip examples]