以前のリビジョンの文書です
Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in
/mnt/hep_web/hep_web/member/n-kota/dokuwiki/inc/parser/handler.php on line
1458
Warning: Declaration of syntax_plugin_note::handle($match, $state, $pos, &$handler) should be compatible with DokuWiki_Syntax_Plugin::handle($match, $state, $pos, Doku_Handler $handler) in
/mnt/hep_web/hep_web/member/n-kota/dokuwiki/lib/plugins/note/syntax.php on line
79
Warning: Declaration of syntax_plugin_note::render($mode, &$renderer, $indata) should be compatible with DokuWiki_Syntax_Plugin::render($format, Doku_Renderer $renderer, $data) in
/mnt/hep_web/hep_web/member/n-kota/dokuwiki/lib/plugins/note/syntax.php on line
101
Warning: preg_match(): Compilation failed: invalid range in character class at offset 3120 in
/mnt/hep_web/hep_web/member/n-kota/dokuwiki/inc/parser/lexer.php on line
118
A PCRE internal error occured. This might be caused by a faulty plugin
====== macroに引数を渡したい ======
----
たとえば、Int_t と TString の2変数をとるマクロがあるとする。
test.C
<code cpp>
void test( const Int_t N, const TString str )
{
std::cout << "N = " << N << std::endl;
std::cout << "str = " << str.Data() << std::endl;
}
</code>
このマクロを実行するには
<code bash>
root 'test.C(10,"aho")'
### shell 変数を使う場合
N=10;
str="aho";
root 'test.C('${N}', "'${str}'")'
</code>
のようにシングルクオートでエスケープが必要。
rootの対話型ターミナルでなら
<code cpp>
.x test.C(10,"aho")
</code>
でも実行できる。
ほか、\\
test1.sh
<code bash>
#!/bin/bash
root -b -l << EOF
.x test.C(10,"aho");
.q;
EOF
</code>
とか\\
test2.sh
<code bash>
#!/bin/bash
N=10
str=\"aho\"
root -b -l << EOF
.x test.C(${N},${str});
.q;
EOF
</code>
などでも実行可能