【Bash】 【Linux】シェルスクリプトの実行ディレクトリを取得 Bash Posted by: 2020年9月21日 no comments yet <スポンサーリンク> $(cd $(dirname $0); pwd) 動作確認 test.sh #!/bin/sh DIR=$(cd $(dirname $0); pwd) echo ${DIR} $ ls -l /home/yuta/test.sh -rw-rw-rw- 1 yuta yuta 54 Sep 10 16:10 /home/yuta/test.sh $ sh test.sh /home/yuta <スポンサーリンク> older newer コメントを残す コメントをキャンセルAllowed tags: you may use these HTML tags and attributes: <a href="">, <strong>, <em>, <h1>, <h2>, <h3>Please note: all comments go through moderation. Name (required) Email (required) Website キャプチャコード * Δemail confirm* post date* 日本語が含まれない投稿は無視されますのでご注意ください。(スパム対策)