= Shell = == others == * [[https://unix.stackexchange.com/questions/119905/why-does-my-regular-expression-work-in-x-but-not-in-y|Basic/Extended/Perl-compatible regular expressions]] * [[https://skyyan.com/d/scripts/mirror-rsync.sh|mirror-rsync.sh]] * [[https://skyyan.com/d/scripts/sendEmail.pl|sendEmail.pl]] == Get Current Path == {{{ #!/bin/bash function get_current_path { SOURCE=${BASH_SOURCE[0]} DIR=$( dirname "$SOURCE" ) if [ -h "$SOURCE" ]; then SOURCE=$(readlink "$SOURCE") [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" DIR=$( cd -P "$( dirname "$SOURCE" )" && pwd ) else DIR=$( cd -P "$( dirname "$SOURCE" )" && pwd ) fi echo $DIR } CI_DIR=$( get_current_path ) }}}