* [Comm] awk
@ 2007-07-05 13:07 Igo
0 siblings, 0 replies; only message in thread
From: Igo @ 2007-07-05 13:07 UTC (permalink / raw)
To: community
всем привет
неподскажите как справиться со след задачей:
есть /var/log/messages нужно брать из него строки, например за час от
текущего времени.
а то я пошел путем перебора всех строк но кажется это некрасиво
/bin/awk --field-separator=' ' 'BEGIN {
H=systime()-600; today=strftime("%d");}
{
if($2==int(today))
{
print($2);
}
}
END {
print(strftime(" %H %M",H));
} ' /var/log/messages
заранее спасибо
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2007-07-05 13:07 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-07-05 13:07 [Comm] awk Igo
ALT Linux Community general discussions
This inbox may be cloned and mirrored by anyone:
git clone --mirror http://lore.altlinux.org/community/0 community/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 community community/ http://lore.altlinux.org/community \
mandrake-russian@linuxteam.iplabs.ru community@lists.altlinux.org community@lists.altlinux.ru community@lists.altlinux.com
public-inbox-index community
Example config snippet for mirrors.
Newsgroup available over NNTP:
nntp://lore.altlinux.org/org.altlinux.lists.community
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git