LoginSignup
1
1

More than 5 years have passed since last update.

nyaosでシングルクォートを使うときの注意点

Posted at

nyaosのスクリプトを書く時にこんな感じに書いてうまく動かずハマりました。

if exist 'Gemfile' then

これだとGemfileがカレントディレクトリにあっても真になってくれません。

if exist "Gemfile" then

とダブルクォートを使いましょう。

なんでもコマンドプロンプトはシングルクォートが使えないのでそのためだそうです。まさかシングルクォートが使えない環境があることを想像さえした事もなかったのでびっくりですよ。

参考

今回もQA@ITで教えてもらいました。
http://qa.atmarkit.co.jp/q/3665

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1