Created
November 9, 2021 18:57
-
-
Save JacobJohansen/5f443e3a7a3898257f14ee4a2d38f8d3 to your computer and use it in GitHub Desktop.
Script Path Relative to File
This file contains 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/sh | |
relative_dir=`perl -e 'use Cwd "realpath";$pwd = realpath(shift); $pwd =~ s/\/[^\/]*$//; print $pwd' $0` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment