この文書の現在のバージョンと選択したバージョンの差分を表示します。
両方とも前のリビジョン 前のリビジョン 次のリビジョン | 前のリビジョン | ||
ja:root:wantto18 [2018/09/29 08:25] kota |
ja:root:wantto18 [2018/09/29 08:42] (現在) kota |
||
---|---|---|---|
ライン 19: | ライン 19: | ||
root 'test.C(10,"aho")' | root 'test.C(10,"aho")' | ||
| | ||
+ | ### shell 変数を使う場合 | ||
N=10; | N=10; | ||
str="aho"; | str="aho"; | ||
- | root 'test.C('$N', "'$str'")' | + | root 'test.C('${N}', "'${str}'")' |
+ | </code> | ||
+ | のようにシングルクオートでエスケープが必要。 | ||
+ | rootの対話型ターミナルでなら | ||
+ | <code cpp> | ||
+ | .x test.C(10,"aho") | ||
</code> | </code> | ||
+ | でも実行できる。 | ||
+ | |||
+ | ほか、\\ | ||
+ | test1.sh | ||
+ | <code bash> | ||
+ | #!/bin/bash | ||
+ | root << EOF | ||
+ | .x test.C(10,"aho"); | ||
+ | .q; | ||
+ | EOF | ||
+ | </code> | ||
+ | |||
+ | とか\\ | ||
+ | test2.sh | ||
+ | <code bash> | ||
+ | #!/bin/bash | ||
+ | N=10 | ||
+ | str=\"aho\" | ||
+ | root << EOF | ||
+ | .x test.C(${N},${str}); | ||
+ | .q; | ||
+ | EOF | ||
+ | </code> | ||
+ | |||
+ | などでも実行可能 |