- Registriert
- 22.10.04
- Beiträge
- 54
würde gern eine Anzahl der gedruckten Seiten pro User ausgeben
for u in *; do
grep -i $u /var/log/cups/page_log
done
wirft ne nette Liste aus. (Wobei man in dem Ordner sein sollte der die Usernames enthält)
Jetzt würde ich gern nur die ausgeben wollen wo die Kombi Username-PID ein andere ist und davon die letzte Zeile.
Also statt:
_10_0_5_1 str 352 [07/Jan/2008:15:40:14 +0100] 1 1 - localhost
_10_0_5_1 str 352 [07/Jan/2008:15:40:14 +0100] 2 1 - localhost
_10_0_5_1 str 352 [07/Jan/2008:15:40:15 +0100] 3 1 - localhost
_10_0_5_1 str 352 [07/Jan/2008:15:40:15 +0100] 4 1 - localhost
_10_0_5_1 str 352 [07/Jan/2008:15:40:15 +0100] 5 1 - localhost
AV_HP str 353 [07/Jan/2008:15:49:40 +0100] 1 1 - localhost
AV_HP str 353 [07/Jan/2008:15:49:40 +0100] 2 1 - localhost
AV_HP str 353 [07/Jan/2008:15:49:40 +0100] 3 1 - localhost
AV_HP str 353 [07/Jan/2008:15:49:41 +0100] 4 1 - localhost
AV_HP str 353 [07/Jan/2008:15:49:41 +0100] 5 1 - localhost
soll nur
_10_0_5_1 str 352 [07/Jan/2008:15:40:15 +0100] 5 1 - localhost
AV_HP str 353 [07/Jan/2008:15:49:41 +0100] 5 1 - localhost
da bleiben.
Hat jemand ne gute Idee?
for u in *; do
grep -i $u /var/log/cups/page_log
done
wirft ne nette Liste aus. (Wobei man in dem Ordner sein sollte der die Usernames enthält)
Jetzt würde ich gern nur die ausgeben wollen wo die Kombi Username-PID ein andere ist und davon die letzte Zeile.
Also statt:
_10_0_5_1 str 352 [07/Jan/2008:15:40:14 +0100] 1 1 - localhost
_10_0_5_1 str 352 [07/Jan/2008:15:40:14 +0100] 2 1 - localhost
_10_0_5_1 str 352 [07/Jan/2008:15:40:15 +0100] 3 1 - localhost
_10_0_5_1 str 352 [07/Jan/2008:15:40:15 +0100] 4 1 - localhost
_10_0_5_1 str 352 [07/Jan/2008:15:40:15 +0100] 5 1 - localhost
AV_HP str 353 [07/Jan/2008:15:49:40 +0100] 1 1 - localhost
AV_HP str 353 [07/Jan/2008:15:49:40 +0100] 2 1 - localhost
AV_HP str 353 [07/Jan/2008:15:49:40 +0100] 3 1 - localhost
AV_HP str 353 [07/Jan/2008:15:49:41 +0100] 4 1 - localhost
AV_HP str 353 [07/Jan/2008:15:49:41 +0100] 5 1 - localhost
soll nur
_10_0_5_1 str 352 [07/Jan/2008:15:40:15 +0100] 5 1 - localhost
AV_HP str 353 [07/Jan/2008:15:49:41 +0100] 5 1 - localhost
da bleiben.
Hat jemand ne gute Idee?