Skip to content

Instantly share code, notes, and snippets.

@takesato
Created April 11, 2019 03:04
Show Gist options
  • Save takesato/044f99af96ca6873a9073effd697b65a to your computer and use it in GitHub Desktop.
Save takesato/044f99af96ca6873a9073effd697b65a to your computer and use it in GitHub Desktop.
どこから実行してもスクリプトを置いたパス内を起点に動くようにする
#!/bin/sh
cd "${0%/*}"
# cd `dirname $0`
# dirname だとスペースのあるパスで上手く動かない
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment