「シェルスクリプトの基礎 - 入出力」の版間の差分

ナビゲーションに移動 検索に移動
(文字列「__FORCETOC__」を「{{#seo: |title={{PAGENAME}} : Exploring Electronics and SUSE Linux | MochiuWiki |keywords=MochiuWiki,Mochiu,Wiki,Mochiu Wiki,Electric Circuit,Electric,pcb,Mathematics,AVR,TI,STMicro,AVR,ATmega,MSP430,STM,Arduino,Xilinx,FPGA,Verilog,HDL,PinePhone,Pine Phone,Raspberry,Raspberry Pi,C,C++,C#,Qt,Qml,MFC,Shell,Bash,Zsh,Fish,SUSE,SLE,Suse Enterprise,Suse Linux,openSUSE,open SUSE,Leap,Linux,uCLnux,Podman,電気回路,電子回路,基板,プリント基板 |description={{PAGENAME}} - 電子回路とSUSE Linuxに関する情報 | This pag…)
 
303行目: 303行目:
  <span style="color:yellow">warn 'Warning message'</span>
  <span style="color:yellow">warn 'Warning message'</span>
  <span style="color:green">info 'Information message'</span>
  <span style="color:green">info 'Information message'</span>
<br>
==== 標準出力 / 標準エラー出力の抑制 ====
<code>>1>/dev/null</code>は、標準出力を破棄する。<br>
<syntaxhighlight lang="sh">
./script.sh 1>/dev/null
</syntaxhighlight>
<br>
<code>>2>/dev/null</code>は、標準エラー出力を破棄する。<br>
<syntaxhighlight lang="sh">
./script.sh 2>/dev/null
</syntaxhighlight>
<br>
また、<code>2>&-</code>でも、標準エラー出力を閉じることができる。<br>
<syntaxhighlight lang="sh">
./script.sh 2>&-
</syntaxhighlight>
<br>
<br>
==== ジョブ番号の出力の抑制 ====
==== ジョブ番号の出力の抑制 ====

案内メニュー