Skip to content

Instantly share code, notes, and snippets.

@zainengineer
Last active April 12, 2024 01:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zainengineer/f307cd8921371c20d6d813a0d44e85da to your computer and use it in GitHub Desktop.
Save zainengineer/f307cd8921371c20d6d813a0d44e85da to your computer and use it in GitHub Desktop.
bash script path
#!/usr/bin/env bash
script_path=$( cd "$(dirname "${BASH_SOURCE}")" ; pwd -P )
root_path=$(dirname $(dirname $(dirname "$script_path")));
#for simple any level using ..
script_path=$( cd "$(dirname "${BASH_SOURCE}")" ; pwd -P )
dirname=$(realpath "$script_path/..")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment