Hallo, ich möchte ein bestimmten string (Wort oder Zahl) in einer Datei mit bash suchen, z.b. jeweils das erste Wort in einer Zeile. Nur weiß ich nicht wie das in shell /bash funktioniert. In python mache ich das so:
1 2 3 4 5 | fil = open("/home/mein.txt").readlines() for i in fil: pri = i.split() print(pri[2]) |
Gibt es so etwas ähnliches auch für shell?