Skip to content

Instantly share code, notes, and snippets.

@devarda
Created February 26, 2020 21:05
Show Gist options
  • Save devarda/c32f851cce086e19bf4306a1ef82b135 to your computer and use it in GitHub Desktop.
Save devarda/c32f851cce086e19bf4306a1ef82b135 to your computer and use it in GitHub Desktop.
Bash script shell script get script path of the file to solve relative path issue when you run the command
#!/bin/bash
SCRIPTPATH="$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
echo $SCRIPTPATH
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment