I would like to do something like this:
\immediate\write18{git log -1 --pretty=format:"%h-%ad" --date=short > /tmp/temp.dat }
however, xelatex cannot proceed because the % means comment out if I do this:
\immediate\write18{git log -1 --pretty=format:"\%h-\%ad" --date=short > /tmp/temp.dat }
The call is actually:
git log -1 --pretty=format:"\%h-\%ad" --date=short > /tmp/temp.dat
which will have extra \ in it.
How can I let the shell command use % instead of \% ?
\spacefactor \@m {}percentchar h;\spacefactor \@m {}percentchar ad– Wang Jan 14 '15 at 12:24\makeatletter...\makeatotheraround code using\@percentchar: http://tex.stackexchange.com/questions/8351/what-do-makeatletter-and-makeatother-do – Joseph Wright Jan 14 '15 at 12:26\catcode`\%=11\catcode`\%=14pair now. – Wang Jan 14 '15 at 12:29