0
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

windowsのコンソールアプリの引数に"(ダブルクォーテーション)を渡す方法

Last updated at Posted at 2018-01-06

文書の目的

  • rscriptの引数にJSONを渡したいが、"(ダブルクォーテーション、二重引用符)が入っていても消えてしまう
  • いろいろブログを見たが解決しなかったので、同様の環境の人もいると思い今回の解決策を書いておく

解決策

  • "を\"に替える

  • 例 rscript script.r "neko":123,"inu":234 → rscript script.r \"neko\":123,\"inu\":234

  • プログラムで呼ぶ場合

var args = "script.r \\\\\\\"neko\\\\\\\"inu\\\\\\\":234";
//7個も必要だぜー

私の環境ではうまくいかなかった例

0
3
2

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
0
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?