From e1daac32c5b7ca0d902c16135d361aa5303f5124 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Sun, 27 Jan 2013 15:00:27 +0100 Subject: o Creating an initial version of install-file. --- app | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'app') diff --git a/app b/app index 880026a..a70b026 100755 --- a/app +++ b/app @@ -1,19 +1,5 @@ #!/bin/bash -e -PRG="$0" -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG="`dirname "$PRG"`/$link" - fi -done - -APPSH_HOME=`dirname "$PRG"` -APPSH_HOME=`cd "$APPSH_HOME" && pwd` - usage() { if [ -n "$1" ] then @@ -30,6 +16,20 @@ usage() { echo "Run $0 -h for more help" >&2 } +PRG="$0" +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG="`dirname "$PRG"`/$link" + fi +done + +APPSH_HOME=`dirname "$PRG"` +APPSH_HOME=`cd "$APPSH_HOME" && pwd` + . $APPSH_HOME/lib/common while getopts "h" opt -- cgit v1.2.3