Skip to content

Instantly share code, notes, and snippets.

@a-yasui
Last active October 8, 2025 09:22
Show Gist options
  • Select an option

  • Save a-yasui/d598e524680798d6712e693b239052b1 to your computer and use it in GitHub Desktop.

Select an option

Save a-yasui/d598e524680798d6712e693b239052b1 to your computer and use it in GitHub Desktop.
Work directory moving
#!/usr/bin/env bash
# スクリプトの設置ディレクトリに移動して、そのディレクトリパスを取得する
# :-$0 とする事で他のshellでも動くようになる
PWD="$( cd "$( dirname "${BASH_SOURCE:-$0}" )" && pwd )"
@a-yasui
Copy link
Author

a-yasui commented Apr 3, 2020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment