Advertisement
Guest User

Untitled

a guest
Dec 23rd, 2020
14
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. \ExecuteOptions{shell}
  2. \newif\ifcmd
  3. \newif\ifnix
  4. \ProcessOptions\relax
  5. %% test if shell escape really works
  6. \ifShellEscape
  7. \def\tmpfile{w18-test-\the\year\the\month\the\day\the\time.tex}
  8. \immediate\write18{echo t > "\tmpfile"}
  9. \IfFileExists{\tmpfile}{\ifcmdtrue}{\ifcmdfalse}
  10. \ifcmpd
  11. \else
  12. \immediate\write18{touch \tmpfile}
  13. \IfFileExists{\tmpfile}{\ifnixtrue}{\ifnixfalse}
  14. \fi
  15. \ifcmd
  16. \IfFileExists{\tmpfile}{\ShellEscapetrue}{\ShellEscapefalse}
  17. \immediate\write18{del "\tmpfile"}
  18. \else
  19. \ifnix
  20. \IfFileExists{\tmpfile}{\ShellEscapetrue}{\ShellEscapefalse}
  21. \immediate\write18{rm -f \tmpfile}
  22. \immediate\write18{rm -f "\jobname.gnuploterrors"}
  23. \fi
  24. \fi
  25. \fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement