2017-04-02 4 views
-1

Mein Code-Schnipsel hat ein Echo Linie wie folgt:

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

Erwartete Ausgabe:

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

Output bekommen :

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

Warum erscheint auch der Dateiname "prov_bulk"? Wie man das los wird?

+0

Lesen Sie die Dokumentation für "wc". – chepner

+1

Der Dateiname ist Teil der Ausgabe Ihres Befehls. Es dehnt sich perfekt aus. –

Antwort

1

Durch einfaches Hinzufügen eines < sollte Ihr Problem lösen. Die Umleitung lässt den Dateinamen weg.

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