lib/Tools/mkdir
changeset 15920 c79fa63504c8
parent 15847 c05c7670f166
child 16482 ed08c8edc289
equal deleted inserted replaced
15919:b30a35432f5a 15920:c79fa63504c8
     1 
       
     2 #!/usr/bin/env bash
     1 #!/usr/bin/env bash
     3 #
     2 #
     4 # $Id$
     3 # $Id$
     5 # Author: Markus Wenzel, TU Muenchen
     4 # Author: Markus Wenzel, TU Muenchen
     6 #
     5 #
   207   [ -z "$QUIET" ] && echo "creating $PREFIX/document" >&2
   206   [ -z "$QUIET" ] && echo "creating $PREFIX/document" >&2
   208   mkdir document || fail "Bad directory: $PREFIX/document"
   207   mkdir document || fail "Bad directory: $PREFIX/document"
   209 
   208 
   210   [ -z "$QUIET" ] && echo "creating $PREFIX/document/root.tex" >&2
   209   [ -z "$QUIET" ] && echo "creating $PREFIX/document/root.tex" >&2
   211   TITLE=$(echo "$NAME" | tr _ -)
   210   TITLE=$(echo "$NAME" | tr _ -)
   212   AUTHOR=$("$AUTO_PERL" -e "@pw = getpwnam(\"$USER\"); print @pw[6]" | tr _ -)
   211   # a hack to extract the current user name
       
   212   PERLLINE='@pw = getpwnam("'$USER'"); $uname = $pw[6];
       
   213     $uname =~ tr/_/-/; $uname =~ s/^[^\\]*\\//g; $uname =~ s/,S[0-9\-]+$//g; print $uname;'
       
   214   AUTHOR=$("$AUTO_PERL" -e "$PERLLINE")
       
   215   # the perl "getpwnam" function extracts a data entry
       
   216   # from /etc/passwd; the first tr is to replace some characters
       
   217   # undigestible for tex; the two regexp substs eliminate the
       
   218   # windows domain-specific noise as found in /etc/passwd using cygwin
   213   cat >document/root.tex <<EOF
   219   cat >document/root.tex <<EOF
   214 \documentclass[11pt,a4paper]{article}
   220 \documentclass[11pt,a4paper]{article}
   215 \usepackage{isabelle,isabellesym}
   221 \usepackage{isabelle,isabellesym}
   216 
   222 
   217 % further packages required for unusual symbols (see also isabellesym.sty)
   223 % further packages required for unusual symbols (see also isabellesym.sty)