m README m install.sh GIANT BUG... causing /usr to be deleted... so sorry.... issue #123, issue #122, issue #121
m README m install.sh GIANT BUG... causing /usr to be deleted... so sorry.... issue #123, issue #122, issue #121
シェルスクリプトやバッチファイルを書いていると、コマンドの中に相対パスで別のファイルを指定したりしてしまいます。 例えばシェルスクリプトと同じディレクトリにある"test.txt"というファイルを開くシェルスクリプトなら、単純に cat test.txt とすればよいように思うかもしれません。 試しに、上記の内容を記述したファイルを/tmp/test.shとし、適当なテキストファイルを/tmp/test.txtとして用意し、 自身のホームディレクトリより /tmp/test.sh として実行するとどうなるでしょうか。 きっとエラーになるはずです。 これは、シェルスクリプトの中で実行されるコマンド(cat)が、ホームディレクトリのtest.txtというファイルを開こうとするからです。 シェルスクリプトと同じディレクトリにあるファイルを開こうとするなら、一度シェルスクリプトがあるディレクトリに
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く