Changes between Initial Version and Version 1 of Shell
- Timestamp:
- 08/26/15 09:34:44 (9 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Shell
v1 v1 1 = Shell = 2 3 == Get Current Path == 4 5 {{{ 6 #!/bin/bash 7 8 function get_current_path { 9 SOURCE=${BASH_SOURCE[0]} 10 DIR=$( dirname "$SOURCE" ) 11 if [ -h "$SOURCE" ]; then 12 SOURCE=$(readlink "$SOURCE") 13 [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" 14 DIR=$( cd -P "$( dirname "$SOURCE" )" && pwd ) 15 else 16 DIR=$( cd -P "$( dirname "$SOURCE" )" && pwd ) 17 fi 18 echo $DIR 19 } 20 21 CI_DIR=$( get_current_path ) 22 }}} 23