marketing

Marketing materials (presentations, posters, flyers)
Log | Files | Refs

mk_variables.sh (1232B)


      1 #!/bin/bash
      2 # generate variables.tex
      3 # Author: Andreas HABEGGER <andreas.habegger>
      4 # Date  : 2017
      5 # Based on an idea by Albert Reiner.
      6 
      7 _FILE_PERM=644
      8 
      9 OUTFILE=variables.tex         # Name of the file to generate.
     10 OUTFILE="${_DESTINATION_DIR}/${OUTFILE}"
     11 
     12 # -----------------------------------------------------------
     13 # 'Here document containing the body of the generated script.
     14 (
     15 cat <<'EOF'
     16 
     17 %% Replace COURSE_TITLE by the appropriate course title
     18 \def\coursename{COURSE\_TITLE}
     19 
     20 %% Replace NAME with first and last file of the author
     21 \def\lecturername{Prof. NAME}
     22 
     23 %% Replace EMAIL NAME by author email address
     24 \def\lectureremail{<andreas.habegger@bfh.ch>}
     25 
     26 %% Modify company name
     27 \def\universityname{Bern University of Applied Sciences}
     28 
     29 %% Modify division name
     30 \def\departmentname{Micro- and Medicaltechnology}
     31 
     32 %% Modify revison
     33 \def\revision{1.0}
     34 
     35 EOF
     36 ) > $OUTFILE
     37 # -----------------------------------------------------------
     38 
     39 #  Quoting the 'limit string' prevents variable expansion
     40 #+ within the body of the above 'here document.'
     41 #  This permits outputting literal strings in the output file.
     42 
     43 if [ -f "$OUTFILE" ]
     44 then
     45   chmod ${_FILE_PERM} ${OUTFILE}
     46 else
     47   echo "Problem in creating file: \"$OUTFILE\""
     48 fi
     49 
     50 
     51 
     52 exit 0