2017-04-02 6 views
-1

私のコードスニペットは、以下のようにエコーラインを持っています

echo "$(wc -l prov_bulk) provisioning commands found between $t_stmp1 of $(head -1 file_list) till $t_stmp2 of $(tail -1 file_list)" 

予想される出力:

1054721 provisioning commands found between 2017033023 of 170330.AUG till 2017033102 of 170331.AUG 

出力を取得:

1054721 prov_bulk provisioning commands found between 2017033023 of 170330.AUG till 2017033102 of 170331.AUG 

なぜファイル名 "prov_bulk"も表示されますか?これを取り除く方法は?

+0

「wc」のドキュメントをお読みください。 – chepner

+1

ファイル名はコマンドの出力の一部です。それは完全に拡張する。 –

答えて

1

<を追加するだけで、問題を解決できるはずです。リダイレクトはファイル名を省略します。

echo "$(wc -l < prov_bulk) provisioning commands found between $t_stmp1 of $(head -1 file_list) till $t_stmp2 of $(tail -1 file_list)" 
関連する問題