Compare commits

...

8 Commits

Author SHA1 Message Date
Taha Ahmed 687379932f Compile only paper or only SI with dynamically set
manuscript filenames and corresponding
LaTeX template files for Markdown.
To avoid having to set overly long command
I have opted to read these values from file.
8 months ago
Taha Ahmed d587da571a New script to compile Markdown manuscript 8 months ago
Taha Ahmed 205c8a8afe Restore thesis.bcf from git commit if modified in workspace
This is a convenience to avoid having to remember to restore
this file after any broken compiles.
10 months ago
Taha Ahmed 5a73e3e49d Fixed a bug: path_thesis should be path_wd.
+ gave the die() function a way to customise the sleep duration
  (allows the clean-up step to terminate immediately without waiting),
  and removed its unused exit-code argument.
11 months ago
Taha Ahmed c965437a0f No more file not found errors during cleanup
Cleanup with "rm $auxfiles" produced error messages for all filetypes
that were not found.
Rewritten as "find ... -exec rm ...",  much neater approach.
11 months ago
Taha Ahmed 51e2ca725b auxiliary file .out is by hyperref (comment) 1 year ago
Taha Ahmed 7ef254dd69 Added minitoc aux files to list of aux files. 1 year ago
Taha Ahmed 688c7404ef Added flag that disables Gotify notification
+ cleaned up help section
+ replaced hard-coded colour codes with dependency on colours script
1 year ago

@ -0,0 +1,189 @@
#!/usr/bin/env bash
# solarchemist
# GPL3 2023
set -euo pipefail
usage() {
cat <<EOF
Usage: $(basename "${BASH_SOURCE[0]}") <flags>
Compiles Markdown manuscript and SI to PDF, and optionally converts it to HTML,
ODT, and/or DOCX.
Requires .mdtemplates file to exist in the current working directory.
Available flags:
+ --help --> display this usage guide
+ --convert-all --> convert to HTML, ODT, or other formats
+ --convert-html --> convert to HTML
EOF
exit
}
msg() {
echo >&2 -e "${1-}"
}
# Examples:
# die "some message"
# die "some message and wait 6 seconds before exiting" 6
# die "some message and exit immediately" 0
die() {
local msg=$1
msg "$msg"
# short delay to aid reading last message in case terminal closes on exit
# if $2 was provided, set it as delay
# if $2 is unset or null, use a 3 second delay
simpledelay.sh ${2:-3}
exit 0
}
parse_params() {
while :; do
case "${1-}" in
-h | --help) usage ;;
-v | --verbose) set -x ;;
--convert-all) convert_formats=true ;;
--convert-html) convert_html=true ;;
--paper) only_paper=true;;
--si) only_si=true;;
-?*) die "Unknown option: $1" ;;
*) break ;;
esac
shift
done
return 0
}
convert_formats=false
convert_html=false
only_paper=false
only_si=false
parse_params "$@"
# https://ostechnix.com/bash-associative-array
# https://phoenixnap.com/kb/bash-associative-array
# I expect .mdtemplates to look like this:
# (note the use of "keys" named "paper" and "si", these key names should always be paper/si)
# ```
# $ cat .mdtemplates
# declare -A MANUSCRIPT=( ["paper"]="templates/pmichaillat.latex", ["si"]="templates/pmichaillat-si.latex" )
# ```
# so if your main manuscript is named something other than "paper", just adjust accordingly in your .mdtemplates
# and ditto for the relative path to your latex template file markdown should use.
msg "--- Looking for .mdtemplates"
if [ -e .mdtemplates ]; then
msg "--- Found in .mdtemplates:"
# https://stackoverflow.com/a/4685432/1198249
source ./.mdtemplates
for M in "${!MANUSCRIPT[@]}"; do
echo " ${M}: ${MANUSCRIPT[${M}]}"
done
else
die "Found no .mdtemplates file. Quitting..." 0
# for later, add the ability define the array as arg to the --paper and --si flags
fi
if [[ $only_paper == "true" ]]; then
# msg "Detected --paper flag"
declare -A MANUSCRIPT_PAPER
MANUSCRIPT_PAPER["paper"]=${MANUSCRIPT["paper"]}
unset MANUSCRIPT
declare -A MANUSCRIPT
MANUSCRIPT["paper"]=${MANUSCRIPT_PAPER["paper"]}
# declare -a MANUSCRIPT_TEMPLATES=( "templates/pmichaillat.latex" )
fi
if [[ $only_si == "true" ]]; then
# msg "Detected --si flag"
declare -A MANUSCRIPT_SI
# in this assignment we lose the "si" key, gets replaced by integer
# declare -a MANUSCRIPT_SI=${MANUSCRIPT["si"]}
# we effectively need to build a new array from the old
# https://unix.stackexchange.com/a/464627/411416
MANUSCRIPT_SI["si"]=${MANUSCRIPT["si"]}
# echo "${MANUSCRIPT_SI[@]}"
# echo "${!MANUSCRIPT_SI[@]}"
# echo "${#MANUSCRIPT_SI[@]}"
# simpledelay.sh 10
unset MANUSCRIPT
declare -A MANUSCRIPT
MANUSCRIPT["si"]=${MANUSCRIPT_SI["si"]}
# declare -a MANUSCRIPT_TEMPLATES=( "templates/pmichaillat-si.latex" )
fi
# echo "${MANUSCRIPT[@]}"
# echo "${!MANUSCRIPT[@]}"
# echo "${#MANUSCRIPT[@]}"
# simpledelay.sh 15
# NOTE "templates/" is hard-coded here!
# note the colons (same function as in $PATH), they are important
export TEXINPUTS=.:${PWD}/templates/:
# these are just strings
BIBLIOGRAPHIES="--bibliography ./refmngr/zotero.bib --bibliography ./references.bib"
PANDOC=pandoc
LATEXMK=latexmk
bibtex_zotero="/media/bay/taha/chepec/literature/_refmngr/_bibrep/library.bib"
if [ -f "$bibtex_zotero" ]; then
msg "Updating the local copy of Zotero library.bib"
cp $bibtex_zotero ./refmngr/zotero.bib
fi
# for some reason, *.aux file is messing up the subsequent run (but not the first run):
# /paper.aux:224: Undefined control sequence. l.224 \BibFileName[0]{paper.html}
# rm -f *.aux
# note the exclamation mark in the for loop variable, makes it the loop index
# https://stackoverflow.com/a/51794732/1198249
for M in "${!MANUSCRIPT[@]}"; do
# array key (manuscript name)
manuscript="${M}"
# array value (template path)
template="${MANUSCRIPT[${M}]}"
# The --biblatex option is not for use with the --citeproc option or with PDF output
# https://pandoc.org/MANUAL.html#citation-rendering
msg "pandoc $manuscript.md to TeX"
# https://unix.stackexchange.com/questions/278502/accessing-array-index-variable-from-bash-shell-script-loop
$PANDOC --standalone --biblatex $manuscript.md -o $manuscript.tex --template $template $BIBLIOGRAPHIES
msg "latexmk $manuscript.tex to PDF"
$LATEXMK -bibtex -pdf $manuscript
if [[ $convert_formats == "true" || $convert_html == "true" ]]; then
# TeX to HTML
# successfully produces HTML but after lots of error-like warnings and non-zero exit
msg "Converting $manuscript.tex to HTML"
# this command creates a HTML file as expected, but returns a non-zero exit code
# which causes this script to exit immediately afterwards. Circumvented by "|| true"
# --output-dir works, but also produces all the auxiliary files in the root (very weird)
make4ht --format html5 $manuscript.tex || true
fi
if [[ $convert_formats == "true" ]]; then
# ODT is not too bad, better than html -> docx using pandoc
# pandoc cannot find figures or images, paths must be messed up...
msg "Converting $manuscript.html to ODT"
pandoc -s $manuscript.html -o $manuscript.odt
msg "Converting $manuscript.html to DOCX"
pandoc -s $manuscript.html -o $manuscript.docx
# to also convert to to DOC, consider abiword (works but produces broken equations and tables)
# https://stackoverflow.com/a/8384078/1198249
# if you want this, please run it on a workstation, not luxor
# (abiword is installed on workstations)
# abiword --to=doc $manuscript.odt
fi
done
exit 0

@ -11,22 +11,24 @@ set -euo pipefail
usage() {
cat <<EOF
Usage: $(basename "${BASH_SOURCE[0]}") [arg1]
Usage: $(basename "${BASH_SOURCE[0]}") <flags> job.Rnw
Compiles Rnw documents with knitr and latexmk. This is a highly customised script.
Takes zero or one arguments. The argument must be a filename with the extension "Rnw".
Compiles R Sweave documents using knitr and LaTeXMK.
Filename extension must be .Rnw.
If an argument is supplied, the document in question is compiled.
If no arguments are supplied, a menu is displayed offering a choice of auxiliary tasks.
Available flags:
+ --help --> display this usage guide
+ --no-alert --> disable gotify alert (--silent also works)
+ --menu --> enter "menu" mode where auxiliary commands can be run (--aux)
This script treats certain filenames in a special manner:
+ "thesis" --> triggers a chain of special commands, see source code.
In addition, the internal execution of this script is modified by the existence of
In addition, the internal execution of this script is modified by the existence of
certain files in the working directory:
+ .knitme --> use knitr::knit() instead of pgfSweave().
+ .latexmkrc --> apply RC file to latexmk command.
+ vc --> run vc script (integrates git with LaTeX, deprecated by gitinfo2, kept for backwards support).
+ ./.knitme --> use knitr::knit() instead of pgfSweave().
+ ./.latexmkrc --> apply RC file to latexmk command.
+ ./vc --> run vc script (integrates git with LaTeX, deprecated by gitinfo2, kept for backwards support).
EOF
exit
@ -35,49 +37,29 @@ EOF
# keep track of runtime of entire script
starttime=$(date +%s)
# in future, consider integrating this color setup with ~/.local/bin/echo-colours.sh
setup_colors() {
if [[ -t 2 ]] && [[ -z "${NO_COLOR-}" ]] && [[ "${TERM-}" != "dumb" ]]; then
NOFORMAT='\033[0m'
# text color
Black='\033[0;30m' Red='\033[0;31m' Green='\033[0;32m' Yellow='\033[0;33m' Blue='\033[0;34m' Purple='\033[0;35m' Cyan='\033[0;36m' White='\033[0;37m'
# bold text and color
BBlack='\033[1;30m' BRed='\033[1;31m' BGreen='\033[1;32m' BYellow='\033[1;33m' BBlue='\033[1;34m' BPurple='\033[1;35m' BCyan='\033[1;36m' BWhite='\033[1;37m'
# underline and color
UBlack='\033[4;30m' URed='\033[4;31m' UGreen='\033[4;32m' UYellow='\033[4;33m' UBlue='\033[4;34m' UPurple='\033[4;35m' UCyan='\033[4;36m' UWhite='\033[4;37m'
# text on background color
On_Black='\033[40m' On_Red='\033[41m' On_Green='\033[42m' On_Yellow='\033[43m' On_Blue='\033[44m' On_Purple='\033[45m' On_Cyan='\033[46m' On_White='\033[47m'
# high intensity color
IBlack='\033[0;90m' IRed='\033[0;91m' IGreen='\033[0;92m' IYellow='\033[0;93m' IBlue='\033[0;94m' IPurple='\033[0;95m' ICyan='\033[0;96m' IWhite='\033[0;97m'
# bold high intensity color
BIBlack='\033[1;90m' BIRed='\033[1;91m' BIGreen='\033[1;92m' BIYellow='\033[1;93m' BIBlue='\033[1;94m' BIPurple='\033[1;95m' BICyan='\033[1;96m' BIWhite='\033[1;97m'
# text on high intensity background color
On_IBlack='\033[0;100m' On_IRed='\033[0;101m' On_IGreen='\033[0;102m' On_IYellow='\033[0;103m' On_IBlue='\033[0;104m' On_IPurple='\033[0;105m' On_ICyan='\033[0;106m' On_IWhite='\033[0;107m'
else
NOFORMAT=''
Black='' Red='' Green='' Yellow='' Blue='' Purple='' Cyan='' White=''
BBlack='' BRed='' BGreen='' BYellow='' BBlue='' BPurple='' BCyan='' BWhite=''
UBlack='' URed='' UGreen='' UYellow='' UBlue='' UPurple='' UCyan='' UWhite=''
On_Black='' On_Red='' On_Green='' On_Yellow='' On_Blue='' On_Purple='' On_Cyan='' On_White=''
IBlack='' IRed='' IGreen='' IYellow='' IBlue='' IPurple='' ICyan='' IWhite=''
BIBlack='' BIRed='' BIGreen='' BIYellow='' BIBlue='' BIPurple='' BICyan='' BIWhite=''
On_IBlack='' On_IRed='' On_IGreen='' On_IYellow='' On_IBlue='' On_IPurple='' On_ICyan='' On_IWhite=''
fi
}
# load colours (this script depends on colours being defined!)
# TO-DO: to make this dependency non-critical, consider making all invocations of colour
# optional (depending on whether colours.sh was found, or a CLI flag perhaps)
if [ -f "/home/taha/.local/bin/echo-colours.sh" ]; then
. "/home/taha/.local/bin/echo-colours.sh"
fi
msg() {
echo >&2 -e "${1-}"
}
# examples:
# die "Some message (exiting with status 1)"
# die "Some message (exiting with status -->)" 0
# Examples:
# die "some message"
# die "some message and wait 6 seconds before exiting" 6
# die "some message and exit immediately" 0
die() {
local msg=$1
local code=${2-1} # default exit status 1
msg "$msg"
simpledelay.sh 2 # short delay to aid reading last message in case terminal closes on exit
exit "$code"
# short delay to aid reading last message in case terminal closes on exit
# if $2 was provided, set it as delay
# if $2 is unset or null, use a 3 second delay
simpledelay.sh ${2:-3}
exit 0
}
parse_params() {
@ -85,28 +67,30 @@ parse_params() {
case "${1-}" in
-h | --help) usage ;;
-v | --verbose) set -x ;;
--no-color) NO_COLOR=1 ;;
--aux | --menu) show_menu=true ;;
--no-alert | --silent) disable_alert=true ;;
-?*) die "Unknown option: $1" ;;
*) break ;;
esac
shift
done
args=("$@")
# Check number of arguments
# this script can be run with one argument is process mode or with zero arguments in post-processing mode
[[ ${#args[@]} -gt 1 ]] && die "More than one argument not supported"
# we use maintrack variable to keep track of whether auxiliary menu should be entered
[[ ${#args[@]} -eq 1 ]] && maintrack=true
# If no args were given, show aux menu mode
# note that flags don't count as args, so as long as no jobname was given
# (irrespective of provided flags), aux menu will be entered
[[ ${#args[@]} -eq 0 ]] && show_menu=true
return 0
}
maintrack=false # I'm not really happy with this variable *name*
show_menu=false
# gotify alert is enabled by default (assuming the job takes longer than X seconds)
disable_alert=false
parse_params "$@"
setup_colors
# setup_colors
clear
@ -140,6 +124,8 @@ TeXfiletype="tex"
tikzfiles="*.tikz"
Rnwfiles="*.Rnw"
# aux files
aux_4ct="*.4ct" # TOC entries for HTML output
aux_4tc="*.4tc" # TOC entries for HTML output
aux_acn="*.acn"
aux_acr="*.acr"
aux_alg="*.alg" # glossaries
@ -155,6 +141,7 @@ aux_glg="*.glg"
aux_glo="*.glo" # glossaries
aux_gls="*.gls*" # glossaries and bib2gls
aux_ist="*.ist" # glossaries (makeindex style file)
aux_lg="*.lg" # tex4ht
aux_lob="*.lob"
aux_lof="*.lof"
aux_log="*.log"
@ -164,7 +151,7 @@ aux_los="*.los"
aux_lot="*.lot"
aux_maf="*.maf" # minitoc
aux_mtc="*.mtc*" # minitoc
aux_out="*.out"
aux_out="*.out" # hyperref
aux_lox="*.lox"
aux_make="*.makefile"
aux_map="*.map"
@ -172,15 +159,18 @@ aux_run="*.run*"
aux_slg="*.slg"
aux_slo="*.slo"
aux_sls="*.sls"
aux_stc="*.stc*" # minitoc
aux_tikz="*-tikzDictionary"
aux_tdo="*.tdo"
aux_tmp="*.tmp" # tex4ht
aux_toc="*.toc"
aux_xdy="*.xdy" # glossaries (xindy)
# all aux files in a string
auxfiles="${aux_acn} ${aux_acr} ${aux_alg} ${aux_aux} ${aux_bbl} ${aux_blg} ${aux_dep} ${aux_dpth} ${aux_fdb} ${aux_fig} ${aux_fls} ${aux_glg} ${aux_glo} ${aux_gls} ${aux_ist} ${aux_lob} ${aux_lof} ${aux_log} ${aux_lol} ${aux_lor} ${aux_los} ${aux_lot} ${aux_maf} ${aux_out} ${aux_lox} ${aux_make} ${aux_map} ${aux_mtc} ${aux_run} ${aux_slg} ${aux_slo} ${aux_sls} ${aux_tikz} ${aux_tdo} ${aux_toc} ${aux_xdy}"
aux_xdy="*.xdy" # glossaries (xindy)
aux_xref="*.xref" # pandoc or tex4ht cross-refs
# all aux files in a single string
auxfiles="${aux_4ct} ${aux_4tc} ${aux_acn} ${aux_acr} ${aux_alg} ${aux_aux} ${aux_bbl} ${aux_blg} ${aux_dep} ${aux_dpth} ${aux_fdb} ${aux_fig} ${aux_fls} ${aux_glg} ${aux_glo} ${aux_gls} ${aux_ist} ${aux_lg} ${aux_lob} ${aux_lof} ${aux_log} ${aux_lol} ${aux_lor} ${aux_los} ${aux_lot} ${aux_maf} ${aux_out} ${aux_lox} ${aux_make} ${aux_map} ${aux_mtc} ${aux_run} ${aux_slg} ${aux_slo} ${aux_sls} ${aux_stc} ${aux_tikz} ${aux_tdo} ${aux_toc} ${aux_xdy} ${aux_xref} ${aux_tmp}"
if $maintrack; then
if [[ $show_menu == "false" ]]; then
# Check if the argument contains a filetype
# (assumes a complete filename was passed)
jobfilename=${args[0]}
@ -206,6 +196,20 @@ if $maintrack; then
#### Special treatment for thesis
if [[ $path_wd == "$path_thesis" && $jobname == "$dir_wd" ]]; then
# Restore thesis.bcf from latest commit if modified in workspace
# Background: any LaTeX run that finishes uncleanly (due to errors, etc.) leaves
# the bcf file in an incomplete state. Since we have at least one plot in the thesis
# that reads the bcf file, this in turn causes the subsequent chertex compilation
# to fail. This mess could be automatically avoided if we pre-emptively check
# if thesis.bcf is listed in the output of `git status --short`, and if so `git restore` it.
# https://stackoverflow.com/a/25149786/1198249
if [[ `git status --porcelain | grep $jobname.bcf` ]]; then
msg "<thesis> -------------------------------"
msg "<thesis> Restoring thesis.bcf"
msg "<thesis> -------------------------------"
git -C $path_wd restore $jobname.bcf
simpledelay.sh 2
fi
# Fetch external assets by reading any assets.external files in assets/ tree
# NOTE: be careful NOT to leave empty lines in your assets.external files
msg "<thesis> -------------------------------"
@ -238,16 +242,18 @@ if $maintrack; then
assetpathtarget="$assetpathtarget/${asset_array[1]}"
# also redefine $asset so we keep only the asset path
asset="${asset_array[0]}"
# create the local subdir inside assets/<current/
# create the local subdir inside assets/<current/
mkdir -p "$assetpathtarget" # -p suppresses error if dir already exists
fi
fi
msg "<thesis> Copying $asset to $assetpathtarget"
# cp but don't overwrite existing files
cp --preserve=timestamps --no-clobber --recursive $asset $assetpathtarget
# except we want to overwrite the BibTeX library files (inside the assets/references/ directory), we'll do that by checking the target dirname and only running the destructive cp operation if its "references"
# except we want to overwrite the biblatex library file (inside the assets/references/ directory)
# as well as the zotero.sqlite file, we'll do that by checking the target dirname and only run
# the copy operation (which will overwrite stuff) if it is "references"
assetdirnametarget=$(basename "$assetpathtarget")
if [[ $assetdirnametarget == "references" ]]; then
msg "<thesis> Overwriting BibTeX libraries in assets/references/"
msg "<thesis> Overwriting Zotero biblatex library and database in assets/references/"
cp --preserve=timestamps $asset $assetpathtarget
fi
done < "$externalfilepath"
@ -267,7 +273,7 @@ if $maintrack; then
photoslastrun="$path_thesis/assets/photos/.lowres/lastrun"
if [ ! -f "$photoslastrun" ]; then
# if, for some reason, the lastrun file does not exist
# copy over everything and then create the file
# copy over everything and then create the file
# (except for the .lowres tree itself, and any assets.external files)
rsync -av "$path_thesis/assets/photos/" "$path_thesis/assets/photos/.lowres/" --exclude ".lowres/" --exclude "assets.external"
touch "$photoslastrun"
@ -346,13 +352,13 @@ if $maintrack; then
# Run pdflatex, bibtex, and company
# Leaving this if-else for historical reasons, and also to print the message
if $ltxmkrc; then
msg "${On_Cyan}<cheRTeX> Calling LaTeXMK, detected .latemxkrc file${NOFORMAT}"
msg "${On_Cyan}<cheRTeX> Calling LaTeXMK, detected .latemxkrc file${Color_Off}"
simpledelay.sh 2
# note: latexmk does not need us to invoke "-r .latexmkrc", it finds and uses
# note: latexmk does not need us to invoke "-r .latexmkrc", it finds and uses
# the RC file automatically (as evidenced by latexmk's output)
latexmk -pdf -bibtex $jobname
else
msg "${On_Cyan}<cheRTeX> Calling LaTeXMK${NOFORMAT}"
msg "${On_Cyan}<cheRTeX> Calling LaTeXMK${Color_Off}"
simpledelay.sh 2
latexmk -pdf -bibtex $jobname
fi
@ -383,8 +389,22 @@ else
fi
if [[ $usrchoice == "clean-up" || $usrchoice == "2" ]]; then
msg "<2> 'clean-up' chosen"
rm $auxfiles
# Still, a rather crude way of cleaning up...
# in $auxfiles, strip "*." or "*" at beginning of each word and "*" at the
# end of any word, and replace space between items with pipe symbol
# using the built-in bash ${$VAR//find/replace} takes us part-way
# $ echo "${auxfiles//\*./}"
# acn acr alg aux bbl blg dep dpth fdb* figlist fls glg glo gls* ist lob lof log lol lor los lot maf out lox makefile map mtc* run* slg slo sls stc* *-tikzDictionary tdo toc xdy
# https://www.baeldung.com/linux/process-a-bash-variable-with-sed
# first, replace "*." or "*-" with empty string, then replace "* " with ".* " (to suit
# regex syntax in the subsequent find command), finally replace each inter-word
# spaces with pipe symbol. Also, and this is important, "*-tikzDictionary" needs to
# be cleaned up otherwise trips up the -iregex parameter! (don't leave "*-" in the string)
# https://unix.stackexchange.com/a/15337
# $ echo "$auxfiles" | sed -r "s/\*\.//g" | sed -r "s/\* /\.\* /g" | sed -r "s/ /|/g"
# acn|acr|alg|aux|bbl|blg|dep|dpth|fdb.*|figlist|fls|glg|glo|gls.*|ist|lob|lof|log|lol|lor|los|lot|maf|out|lox|makefile|map|mtc.*|run.*|slg|slo|sls|stc.*|*-tikzDictionary|tdo|toc|xdy
auxregex=$(echo "$auxfiles" | sed -r "s/\*[\.-]//g" | sed -r "s/\* /\.\* /g" | sed -r "s/ /|/g")
# "rm -v" provides nice output of which files were cleaned up
cd "$path_wd" && find . -maxdepth 1 -type f -regextype posix-extended -iregex ".*\.($auxregex)" -exec rm -v "{}" \; && cd $OLDPWD
fi
if [[ $usrchoice == "wipe-dir" || $usrchoice == "3" ]]; then
msg "<3> 'wipe-dir' chosen"
@ -451,7 +471,7 @@ runtime=$(( $endtime - $starttime ))
# send push message to Gotify server
# if runtime is longer than X minutes (suitable limit perhaps 3 min)
if (( $runtime > 70 )); then
if (( $runtime > 180 )) && [[ $disable_alert == "false" ]]; then
# POST request to Gotify server works without needing Gotify CLI on this box
# NOTE, multi-line bash command fails if interrupted by comment lines!
# Hide CURL response (-o /dev/null) and progress bar (--silent)
@ -465,16 +485,16 @@ if (( $runtime > 70 )); then
msg "Push notification sent to Gotify"
fi
msg "${On_Cyan}-------------------------------------${NOFORMAT}"
msg "${On_Cyan}-------------------------------------${Color_Off}"
# the padding for runtime makes the formatting work
# three digits for seconds is enough for just above 15 minutes
printf "${On_Cyan}=== chertex.sh completed in %03d s ===${NOFORMAT}\n" $runtime 1>&2
printf "${On_Cyan}=== chertex.sh completed in %03d s ===${Color_Off}\n" $runtime 1>&2
if [[ $cetcest == "CET" ]]; then
msg "${On_Cyan}=== $(date) ===${NOFORMAT}"
msg "${On_Cyan}=== $(date) ===${Color_Off}"
else
msg "${On_Cyan}=== $(date) ===${NOFORMAT}"
msg "${On_Cyan}=== $(date) ===${Color_Off}"
fi
msg "${On_Cyan}-------------------------------------${NOFORMAT}"
msg "${On_Cyan}-------------------------------------${Color_Off}"
simpledelay.sh 3
exit 0

Loading…
Cancel
Save