teratail header banner
teratail header banner
質問するログイン新規登録

回答編集履歴

1

fix

2018/01/23 10:32

投稿

mattn
mattn

スコア5030

answer CHANGED
@@ -6,6 +6,6 @@
6
6
  この部分、サブシェルと言って、子プロセスとして起動されています。ですので childA や childB でいくら export しても呼び出し元には反映されません。`()` を取ってみて下さい。
7
7
 
8
8
  ```
9
- source childA 2 > $1 | awk '{print strftime("%Y/%m/%d %H:%M:%S",systime())" "$0;fflush()}' >> parent.log ←parent.logに対してchildA.shでechoしたものをログ形式で出力
9
+ source childA 2> $1 | awk '{print strftime("%Y/%m/%d %H:%M:%S",systime())" "$0;fflush()}' >> parent.log ←parent.logに対してchildA.shでechoしたものをログ形式で出力
10
- source childB 2 > $1 | awk '{print strftime("%Y/%m/%d %H:%M:%S",systime())" "$0;fflush()}' >> parent.log ←parent.logに対してchildB.shでechoしたものをログ形式で出力
10
+ source childB 2> $1 | awk '{print strftime("%Y/%m/%d %H:%M:%S",systime())" "$0;fflush()}' >> parent.log ←parent.logに対してchildB.shでechoしたものをログ形式で出力
11
11
  ```