- May
- 120
- 1
I'm having trouble with levels of quoting. What I'm trying to do is
write a function which returns the output of the Gnu date command.
Annoyingly, the command takes a format string parameter which makes
heavy use of % characters. So I need to quote the argument:
If I try to make this into a user defined function:
function fmtdate=`%@EXECSTR[C:\Utils\Gnuwin32\date +^`%$^`]`
it does not work as expected:
I don't know of a good way to debug this, but it looks to me like the
quoting is wrong somehow. Can anybody offer me any suggestions (either
on how to see what's going on, or on how to fix the quoting up so that
I can call the function in a reasonably natural way)?
(Actually, if someone can point me to a built in function that will
allow me to format the current date *and time* in an arbitrary way,
rather than just the fixed formats described in "Date Display Formats"
that would do me fine, as well!)
Paul.
write a function which returns the output of the Gnu date command.
Annoyingly, the command takes a format string parameter which makes
heavy use of % characters. So I need to quote the argument:
05/07/2008>C:\Utils\Gnuwin32\bin\date +`%d/%m/%Y`
If I try to make this into a user defined function:
function fmtdate=`%@EXECSTR[C:\Utils\Gnuwin32\date +^`%$^`]`
it does not work as expected:
fmtdate=%@EXECSTR[C:\Utils\Gnuwin32\bin\date +`%$`]>function
ECHO is OFF>echo %@FMTDATE[`%D%M%Y`]
I don't know of a good way to debug this, but it looks to me like the
quoting is wrong somehow. Can anybody offer me any suggestions (either
on how to see what's going on, or on how to fix the quoting up so that
I can call the function in a reasonably natural way)?
(Actually, if someone can point me to a built in function that will
allow me to format the current date *and time* in an arbitrary way,
rather than just the fixed formats described in "Date Display Formats"
that would do me fine, as well!)
Paul.