「Transwiki:Bash Shell Scripting」の版間の差分

削除された内容 追加された内容
Fu7mu4 (トーク | 投稿記録)
Fu7mu4 (トーク | 投稿記録)
750 行
bash -c 'echo $foo'</source>
 
<tt>export</tt>は環境変数を作成しないことに注意してください。これは、実際 Bashの変数にエクスポートした変数と印をつけるだけだからです。そして、そのあとで行われるBash変数への代入は環境変数にも同様に影響します。この影響をスクリプトでみてみましょう。
Note that <tt>export</tt> doesn't just create an environment variable; it actually marks the Bash variable as an exported variable, and later assignments to the Bash variable will affect the environment variable as well. That effect is illustrated by this script:
 
<source lang="bash">#!/bin/bash