Last active
July 8, 2025 18:20
-
-
Save CatChenal/039754196ea57e17a252c2c47e1167e4 to your computer and use it in GitHub Desktop.
Abspath in zsh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/zsh | |
abs1=${0:A:h} | |
echo "Script dir, abs1: $abs1" | |
echo "" | |
abs2=$(cd "$(dirname "$0")" ; pwd -P) | |
echo "Script dir, abs2: $abs2" | |
echo "" | |
abs3=$(cd -- $(dirname -- $0) ; pwd -P); | |
echo "Script dir, abs3: $abs3" | |
echo "" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment