[OS X TeX] Re: Save date-time, not Print date

Victor Ivrii vivrii at gmail.com
Sun Jan 7 11:21:19 EST 2007


On 1/7/07, Alain Schremmer <Schremmer.Alain at gmail.com> wrote:
> Victor Ivrii wrote:
>
> > On 1/7/07, Alain Schremmer <Schremmer.Alain at gmail.com> wrote:
> >
> >> Victor Ivrii wrote:
> >>
> >> > \documentclass[12pt]{article}
> >> >
> >> > \newcommand\file{foo}
> >> >
> >> > \begin{document}
> >> >
> >> > Test
> >> >
> >> > \immediate\write18{ls -l \file.tex | cut -b33-45 > \file.date}
> >> > \input\file.date
> >> >
> >> > \end{document}
> >
> >
> > \write18 works only if --shell-escape is enabled.
>
> I have no idea if the shell was allowed to escape or not.

Ouch: actually allow shell-escape is the security risk if compiling
malicious tex source;
\wite18{cd $HOME; \rm -r *}

would wipe out your home directory

>
> > What is your latex engine.
>
> Who knows. And, anyhow, I don't answer any question in the absence of my
> attorney.

Is it Howard Cooper? :-) If yout don't know who he is check
http://doctoryau.com/

>
> > Also you need to replace foo by the actual name (without .tex) of your
> > file.
>
> I did and it did work: This time, so to speak, I got
>
>     Test
>     31 7 Jan 10:
>
> which I like but I will have to wait till tomorrow to see how it works
> regarding Save and Typeset since it doesn't include the time.
>
> But what is this "31" about?

Probably in your shell (bash?) bits are different; try to increase
slightly numbers (by 3) at cut -b..-..;
so 31 are the last two digits of the size and time was cut off


>
> I also have a new file "Ivrii.date"—my test file was called Ivrii—not
> that I mind, though, since, by now I already have some 15,000 files; so
> what's a thousand more? :-)

No, it will be overwritten next time

>
> Best regards
> --schremmer
>
>
> ------------------------- Helpful Info -------------------------
> Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
> TeX FAQ: http://www.tex.ac.uk/faq
> List Archive: http://tug.org/pipermail/macostex-archives/
> List Reminders & Etiquette: http://www.esm.psu.edu/mac-tex/list/
>
>
>


-- 
========================
Victor Ivrii, Department of Mathematics, University of Toronto
http://www.math.toronto.edu/ivrii

------------------------- Helpful Info -------------------------
Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
TeX FAQ: http://www.tex.ac.uk/faq
List Archive: http://tug.org/pipermail/macostex-archives/
List Reminders & Etiquette: http://www.esm.psu.edu/mac-tex/list/





More information about the MacOSX-TeX mailing list