Skip to content

Instantly share code, notes, and snippets.

@zfenj
Created June 12, 2019 08:30
Show Gist options
  • Save zfenj/af9627b22450c5080f8428ba341f5298 to your computer and use it in GitHub Desktop.
Save zfenj/af9627b22450c5080f8428ba341f5298 to your computer and use it in GitHub Desktop.
# Source: https://unix.stackexchange.com/a/115431
#!/usr/bin/env zsh
# only file- / script name
echo ${0:a}
#!/usr/bin/env zsh
# file- / script name with path
echo ${0:a:h}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment