12 Sep
2003
12 Sep
'03
18:02
Am Freitag, 12. September 2003 19:13 schrieb Andreas Winkelmann:
Was gibt es für eine simple Möglichkeit die _neueste_ Datei, das ist also die 1. Zeile von ls -1t in eine Variable zu bekommen?
TESTVAR=`/bin/ls -lt|/usr/bin/gawk '{if (NR==2) print $9}'` echo $TESTVAR
Danke Andreas, das bringt mich schon mal weiter, ich verstehe aber noch nicht, warum das Ergebnis nicht stimmt, wenn ich eine Wildcard setze, zB: TESTVAR=`/bin/ls -lt *.txt |/usr/bin/gawk '{if (NR==2) print $9}'` Al -- Infos zu Softwarepatenten: http://swpat.ffii.org/index.de.html http://petition.eurolinux.org/index.html?LANG=de