Commit ed5c1940 authored by TomKellyGenetics's avatar TomKellyGenetics
Browse files

improve detecting of shell on Mac and Linux

parent 307a66f5
Loading
Loading
Loading
Loading
+28 −1
Original line number Diff line number Diff line
#! /bin/sh

SHELL=`readlink -f /proc/$$/exe | cut -d/ -f3`
if [[ $VENDOR != "apple" ]]
    then
    SHELL=$(readlink -f /proc/$$/exe | cut -d'/' -f3)
else
    SHELL=$(ps -p $$ | awk '$1 == PP {print $4}' PP=$$)
fi
if [[ $(which launch_universc.sh) != *"not found" ]]
    then
    SHELL='' 
    invocation=$0
else
    if [[ -z $ZSH_VERSION ]]
        then
        SHELL="zsh"
    elif [[ -z $KSH_VERSION ]]
       then
       SHELL="ksh"
    elif [[ -z $FISH_VERSION ]]
       then
       SHELL="fish"
    elif [[ -z $BASH_VERSION ]]
        then
        SHELL="bash"
    else
       SHELL=$SHELL
    fi
    invocation=$(echo $(basename $0))
fi

#default install location (root)
if [[ -z $prefix ]]; then prefix="/usr/local/share"; fi
+29 −0
Original line number Diff line number Diff line
#! /bin/sh

if [[ $VENDOR != "apple" ]]
    then
    SHELL=$(readlink -f /proc/$$/exe | cut -d'/' -f3)
else
    SHELL=$(ps -p $$ | awk '$1 == PP {print $4}' PP=$$)
fi
if [[ $(which launch_universc.sh) != *"not found" ]]
    then
    SHELL='' 
    invocation=$0
else
    if [[ -z $ZSH_VERSION ]]
        then
        SHELL="zsh"
    elif [[ -z $KSH_VERSION ]]
       then
       SHELL="ksh"
    elif [[ -z $FISH_VERSION ]]
       then
       SHELL="fish"
    elif [[ -z $BASH_VERSION ]]
        then
        SHELL="bash"
    else
       SHELL=$SHELL
    fi
    invocation=$(echo $(basename $0))
fi

if [[ -z $prefix ]]
    then
    #check for existing install
+28 −1
Original line number Diff line number Diff line
#! /bin/sh

SHELL=`readlink -f /proc/$$/exe | cut -d/ -f3`
if [[ $VENDOR != "apple" ]]
    then
    SHELL=$(readlink -f /proc/$$/exe | cut -d'/' -f3)
else
    SHELL=$(ps -p $$ | awk '$1 == PP {print $4}' PP=$$)
fi
if [[ $(which launch_universc.sh) != *"not found" ]]
    then
    SHELL='' 
    invocation=$0
else
    if [[ -z $ZSH_VERSION ]]
        then
        SHELL="zsh"
    elif [[ -z $KSH_VERSION ]]
       then
       SHELL="ksh"
    elif [[ -z $FISH_VERSION ]]
       then
       SHELL="fish"
    elif [[ -z $BASH_VERSION ]]
        then
        SHELL="bash"
    else
       SHELL=$SHELL
    fi
    invocation=$(echo $(basename $0))
fi

#default install location (root)
if [[ -z $prefix ]]; then prefix="/usr/local/share"; fi
+21 −1
Original line number Diff line number Diff line
@@ -91,12 +91,32 @@ fi


#####usage statement#####
if [[ $VENDOR != "apple" ]]
    then
    SHELL=$(readlink -f /proc/$$/exe | cut -d'/' -f3)
else
    SHELL=$(ps -p $$ | awk '$1 == PP {print $4}' PP=$$)
fi
if [[ $(which launch_universc.sh) != *"not found" ]]
    then
    SHELL='' 
    invocation=$0
else
    SHELL=$(readlink -f /proc/$$/exe | cut -d'/' -f3)
    if [[ -z $ZSH_VERSION ]]
        then
        SHELL="zsh"
    elif [[ -z $KSH_VERSION ]]
       then
       SHELL="ksh"
    elif [[ -z $FISH_VERSION ]]
       then
       SHELL="fish"
    elif [[ -z $BASH_VERSION ]]
        then
        SHELL="bash"
    else
       SHELL=$SHELL
    fi
    invocation=$(echo $(basename $0))
fi
help='
+30 −1
Original line number Diff line number Diff line
#! /bin/sh

if [[ $VENDOR != "apple" ]]
    then
    SHELL=$(readlink -f /proc/$$/exe | cut -d'/' -f3)
else
    SHELL=$(ps -p $$ | awk '$1 == PP {print $4}' PP=$$)
fi
if [[ $(which launch_universc.sh) != *"not found" ]]
    then
    SHELL='' 
    invocation=$0
else
    if [[ -z $ZSH_VERSION ]]
        then
        SHELL="zsh"
    elif [[ -z $KSH_VERSION ]]
       then
       SHELL="ksh"
    elif [[ -z $FISH_VERSION ]]
       then
       SHELL="fish"
    elif [[ -z $BASH_VERSION ]]
        then
        SHELL="bash"
    else
       SHELL=$SHELL
    fi
    invocation=$(echo $(basename $0))
fi

# add manual directory to PATH if not already found
## check config for Linux
if [[ -f /etc/manpath.config ]]
@@ -15,7 +44,7 @@ if [[ -z $CONFIG ]]
    then
    if [[ ! -z $MANPATH ]]
        then
        SHELL_RC=`echo ~/.${0}rc`
        SHELL_RC=`echo ~/.${SHELL}rc`
        echo "export MANPATH=/usr/local/man" >> $SHELL_RC
        MANDIR=`echo ${MANPATH} | cut -d: -f1`
    fi
Loading