Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- BASEDIR=$(dirname $0)
- echo $BASEDIR
- #!/bin/bash
- # Absolute path to this script, e.g. /home/user/bin/foo.sh
- SCRIPT=`readlink -f $0`
- # Absolute path this script is in, thus /home/user/bin
- SCRIPTPATH=`dirname $SCRIPT`
- echo $SCRIPTPATH
- #!/bin/tcsh
- # Absolute path to this script, e.g. /home/user/bin/foo.csh
- set SCRIPT=`readlink -f $0`
- # Absolute path this script is in, thus /home/user/bin
- set SCRIPTPATH=`dirname $SCRIPT`
- echo $SCRIPTPATH
- #!/bin/bash
- current_dir=$(pwd)
- script_dir=$(dirname $0)
- echo $current_dir
- echo $script_dir
- /
- /home/mez
- #!/bin/bash
- pushd $(dirname "${0}") > /dev/null
- basedir=$(pwd -L)
- # Use "pwd -P" for the path without links. man bash for more info.
- popd > /dev/null
- echo "${basedir}"
- cd $(dirname $(readlink -f $0))
- BASEDIR=$(dirname $0)
- echo $BASEDIR
- current_dir=$(pwd)
- script_dir=$(dirname $0)
- if [ $script_dir = '.' ]
- then
- script_dir="$current_dir"
- fi
- if [ -d "$Directory" -a -w "$Directory" ]
- then
- #Statements
- fi
- "$_/../"
Add Comment
Please, Sign In to add comment