Created
August 9, 2016 12:54
-
-
Save jon-grangien/17866b2c6eef123221db0f09641313f6 to your computer and use it in GitHub Desktop.
script to open fysik tentas
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
OPENDOCS=false | |
LISTTENTAS=false | |
while test $# -gt 0; do | |
case "$1" in | |
-h|--help) | |
echo "options:" | |
echo " -h, --help Brief help" | |
echo " -f, --files Open all documens in browser" | |
echo " -l, --list List all tentas available" | |
echo " -d, --date (#) Specify date of tenta to open in browser" | |
exit 0 | |
;; | |
-f|--files) | |
OPENDOCS=true | |
shift # past argument | |
;; | |
-l|--list) | |
LISTTENTAS=true | |
shift # past argument | |
;; | |
-d|--date) | |
TENTADATE="$2" | |
shift # past argument | |
;; | |
--default) | |
DEFAULT=YES | |
;; | |
*) | |
# unknown option | |
;; | |
esac | |
shift # past argument or value | |
done | |
if [ "$OPENDOCS" = true ]; then | |
echo 'Opening files' | |
google-chrome-stable ~/Documents/TNE043/docs/*.pdf && | |
google-chrome-stable "https://www.evernote.com/Home.action#n=4cd66f61-f4e2-4ef0-acca-f369fdd49ff3&b=11eaf285-cd5c-4156-a982-c78c3ee3fef3&ses=4&sh=1&sds=5&" & | |
fi | |
if [ "$LISTTENTAS" = true ]; then | |
for file in ~/Documents/TNE043/tentor/* | |
do | |
if [[ -f $file ]]; then | |
echo $file; | |
fi | |
done | |
fi | |
if [ -n "$TENTADATE" ]; then | |
google-chrome-stable ~/Documents/TNE043/tentor/tenta_$TENTADATE* | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment