View previous topic :: View next topic |
Author |
Message |
z4Rilla Apprentice
Joined: 22 Dec 2003 Posts: 291 Location: EU
|
Posted: Sat Feb 19, 2005 7:50 pm Post subject: [Solved]Bash - Wie Datei Zeile für Zeile ausgeben lassen |
|
|
Wie kann ich eine Datei Zeile für Zeile in einer for-Schleife verarbeiten ?
Code: | for line in ????
do
...
done |
Und wo gibts ein gutes Tutorial für Bash-scripting
Last edited by z4Rilla on Sat Feb 19, 2005 8:12 pm; edited 1 time in total |
|
Back to top |
|
|
STiGMaTa_ch Veteran
Joined: 28 Dec 2004 Posts: 1686 Location: Rüti ZH / Schweiz
|
Posted: Sat Feb 19, 2005 7:55 pm Post subject: |
|
|
Code: |
for line in `cat datei`
do
...
done
|
Quote: | Und wo gibts ein gutes Tutorial für Bash-scripting |
Google!
Lieber Gruss
STiGGi |
|
Back to top |
|
|
benjamin200 Veteran
Joined: 01 Feb 2004 Posts: 1426 Location: DE Munich
|
Posted: Sat Feb 19, 2005 7:56 pm Post subject: |
|
|
Quote: |
Und wo gibts ein gutes Tutorial für Bash-scripting
|
googeln:
http://www.google.de/search?hl=de&q=Tutorial+bash+scripting&spell=1
Gruß,
Benjamin _________________ Gentoo Linux Stage1 / Kernel 2.6.18
AMD Athlon64 3500+ on Asus A8N-E / 1024 MB DDR-RAM / ATI X700 PCIe
Take LINUX and forget Blue Screens |
|
Back to top |
|
|
z4Rilla Apprentice
Joined: 22 Dec 2003 Posts: 291 Location: EU
|
Posted: Sat Feb 19, 2005 7:58 pm Post subject: |
|
|
das hatte ich schon probiert. Da wird die Ausgabe von cat noch weiter auseinandergenommen (bei jedem Space)
Aber ich will ja das jede Zeile als ganzes in $line landet. |
|
Back to top |
|
|
STiGMaTa_ch Veteran
Joined: 28 Dec 2004 Posts: 1686 Location: Rüti ZH / Schweiz
|
Posted: Sat Feb 19, 2005 8:07 pm Post subject: |
|
|
z4Rilla wrote: | das hatte ich schon probiert. Da wird die Ausgabe von cat noch weiter auseinandergenommen (bei jedem Space)
Aber ich will ja das jede Zeile als ganzes in $line landet. |
Achja, stimmt... die Spaces hab ich glatt vergessen:
Neuer Versuch
Code: |
while read LINE
do
...Zeileninhalt wird in Variable $LINE gespeichert...
done </pfad/zu/deiner/datei.txt |
Lieber Gruss
STiGMaTa |
|
Back to top |
|
|
z4Rilla Apprentice
Joined: 22 Dec 2003 Posts: 291 Location: EU
|
Posted: Sat Feb 19, 2005 8:12 pm Post subject: |
|
|
k, funktioniert.
thx |
|
Back to top |
|
|
|