$BatchInput
現行のセッションの入力が直接Wolfram言語カーネルにバッチモードで与えられている場合に,Trueとなる.
詳細
- $BatchInputは,入力がファイルから取り込まれているときにTrueとなる.
- Wolframシステムのセッション中に$BatchInputを再設定することができる.
- $BatchInputがTrueのとき,Wolframシステムは,割込みを受けると終了したり,空白行が与えられたときに入力を排除しなかったり,ファイルの終りになると終了したりする.
例題
例 (2)
インタラクティブなセッションでは,デフォルトで$BatchInputはFalseである:
$BatchInputスタンドアロンのWolfram言語カーネルを入力ファイルとともに実行する:
in = CreateFile[];
out = CreateFile[];$WolframLanguageKernel = If[
$OperatingSystem === "Windows",
FileNameJoin[{$InstallationDirectory, "wolfram"}],
First[$CommandLine]
]template = StringTemplate["\"`wolfram`\" -noprompt < `in`"];
wolfram = TemplateApply[template, <|
"wolfram" -> $WolframLanguageKernel,
"in" -> in
|>]ファイルにコマンドを入れる.この場合はコマンドを入れて$BatchInputを評価する:
FileTemplateApply[
StringTemplate[
"Put[$BatchInput, \"`out`\"]"
],
<|"out" -> StringReplace[out, $PathnameSeparator -> "/"]|>,
in]FilePrint[in]コマンドを実行する.このセッションはファイルの最後で終了する:
Run[wolfram]出力ファイルには$BatchInputの値が含まれている:
FilePrint[out]DeleteFile[{in, out}]テクニカルノート
関連するガイド
履歴
1991 で導入 (2.0)
テキスト
Wolfram Research (1991), $BatchInput, Wolfram言語関数, https://reference.wolfram.com/language/ref/$BatchInput.html.
CMS
Wolfram Language. 1991. "$BatchInput." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/$BatchInput.html.
APA
Wolfram Language. (1991). $BatchInput. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/$BatchInput.html
BibTeX
@misc{reference.wolfram_2026_$batchinput, author="Wolfram Research", title="{$BatchInput}", year="1991", howpublished="\url{https://reference.wolfram.com/language/ref/$BatchInput.html}", note=[Accessed: 08-August-2026]}
BibLaTeX
@online{reference.wolfram_2026_$batchinput, organization={Wolfram Research}, title={$BatchInput}, year={1991}, url={https://reference.wolfram.com/language/ref/$BatchInput.html}, note=[Accessed: 08-August-2026]}