From fca59bea770346cf1c1f9b0e00cb48a61b44a8f3 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Sun, 25 Oct 2015 21:00:20 +0100 Subject: import of old now defunct presentation slides svn repo --- .../OLS2005/Texmf/addAuthor.sh | 104 +++++++++++++++++++++ 1 file changed, 104 insertions(+) create mode 100755 2005/flow-accounting-ols2005/OLS2005/Texmf/addAuthor.sh (limited to '2005/flow-accounting-ols2005/OLS2005/Texmf/addAuthor.sh') diff --git a/2005/flow-accounting-ols2005/OLS2005/Texmf/addAuthor.sh b/2005/flow-accounting-ols2005/OLS2005/Texmf/addAuthor.sh new file mode 100755 index 0000000..0bdec4f --- /dev/null +++ b/2005/flow-accounting-ols2005/OLS2005/Texmf/addAuthor.sh @@ -0,0 +1,104 @@ +#!/bin/bash + +# This script should be called from the top OLS/GCC directory +# (eg the one that contains the Texmf directory) + +# gccsummit or linuxsymposium ... +export WEBSITE=linuxsymposium + +# Handle fatal errors +function die { + echo $* + exit 1 +} + +# Prepare new paper/author +function do_paper { + paper="$1" + author="$2" + bio="$3" + key="$4" + title="$5" + + Dir=$(echo "$author" | tr '[:upper:]' '[:lower:]' | awk '{ print $NF }') + echo Dir is $Dir + echo Paper is $paper + echo Author is $author + echo bio is $bio and key is $key + echo Title is "$title" + echo " " + Start=$PWD + MakeAdd="${Dir}/${Dir}-abstract.tex" + if [ ! -d $Dir ] ; then mkdir $Dir || die "cannot mkdir $Dir" ; fi + cd $Dir || die "cannot cd $Dir" + + if [ ! -r ${Dir}-abstract.tex ] ; then + ### CREATE ABSTRACT (pull from $WEBSITE if available) + if [ $key -ne 0 ] ; then + links -dump 'http://www.'${WEBSITE}'.org/2005/view_abstract.php?content_key='$key > ${Dir}-abstract.tex + else + echo " " > ${Dir}-abstract.tex + fi + fi + + if [ ! -r Makefile.inc ] ; then + ### CREATE Makefile.inc + cat > Makefile.inc < ${Dir}.tex + fi + + cd $Start +} + +### Example usage... +## PAPER_ID=1 +## AUTHOR="Andrey Belevantsev" +## BIO_ID=0 +## CONTENT_KEY=11 +## TITLE="Improving GCC instruction scheduling for Itanium" + +## do_paper $PAPER_ID "$AUTHOR" $BIO_ID $CONTENT_KEY "$TITLE" +function do_help { + echo "Usage: $0 PAPER AUTHOR BIO_ID CONTENT_KEY TITLE" + echo "Paper = integer greater than last-used one for papers" + echo "Author = full author name, quoted" + echo "Bio_ID = number from conference website or 0 for not available" + echo "Content_Key = number for abstract from conference website, 0 for not available" + echo "Title = title of paper, quoted" +} + +if [ -z "$*" ] ; then + do_help + exit 0 +fi +if [[ "$1" = *help* ]] ; then + do_help + exit 0 +fi +if [[ "$1" = *-h* ]] ; then + do_help + exit 0 +fi + +do_paper ${@} + -- cgit v1.2.3