#!/bin/sh # # stc startup script # APP_NAME=stc # imagine we startup in current directory as the script parentdir=${0%/*} cd $parentdir # here is where we look for the software p1=$HOME/Desktop/$APP_NAME.app/Contents/MacOS/$APP_NAME p2=$HOME/Desktop/$APP_NAME/$APP_NAME p3=/Applications/$APP_NAME.app/Contents/MacOS/$APP_NAME p4=/usr/local/$APP_NAME/$APP_NAME APP_LIST="$p1 $p2 $p3 $p4" # stop when we have found an executable prog="" for i in $APP_LIST; do if ( test -x $i ) then prog=$i break fi done if ( test -x $prog) then # start program $prog & else # did not find software echo "Cannot find $APP_NAME executable on this machine." fi exit