株式会社ヴァンデミックシステム

Blog

<スポンサーリンク>

$(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

<スポンサーリンク>

コメントを残す

Allowed tags:  you may use these HTML tags and attributes: <a href="">, <strong>, <em>, <h1>, <h2>, <h3>
Please note:  all comments go through moderation.

*

日本語が含まれない投稿は無視されますのでご注意ください。(スパム対策)