Skip to content

Instantly share code, notes, and snippets.

@okash1n
Created October 16, 2022 03:52
Show Gist options
  • Save okash1n/df8dbe398d4ed16352a9440b715eeb43 to your computer and use it in GitHub Desktop.
Save okash1n/df8dbe398d4ed16352a9440b715eeb43 to your computer and use it in GitHub Desktop.
安全にスクリプト自身のディレクトリでスクリプトを実行するおまじない
#!/usr/bin/env bash
# スクリプト自身のディレクトリを確実に格納
SCRIPT_DIR=$(cd $(dirname $0); pwd)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment