# $EPIC: lastlog_command.txt,v 1.8 2008/04/11 23:12:17 jnelson Exp $
lastlog [-] [-<flag>] [–<flag>] [-mangle <descr>] [<pattern>] [<number of entries> [<start>]]
LASTLOG allows you to grep through output lines that have previously been displayed on your screen. The contents of this buffer are controlled by SET LASTLOG_LEVEL and the size is controlled by SET LASTLOG.
For backwards compatibility reasons, up to three non-option arguments are acceptable:
| Option | Behavior |
|---|---|
| - | Do not display the “Lastlog:” and “End of Lastlog” lines. |
| -literal <string> | Show lines that contain this literal string. |
| -max <num> | Show only the first <num> lines that match. |
| -number <nmber> | Start at the <number>th recent entry |
| -skip <number> | Skip this many leading lastlog entries |
| -reverse | Show all lines in reverse order; from the END to the BEGINNING. |
| -regex <regex> | Lines must match regular expression <regex> |
| -file <filename> | Write output to <filename>. |
| -LASTLOG_LEVEL | Where LASTLOG_LEVEL is one of the lastlog levels listed in SET LASTLOG_LEVEL; show messages of this type. |
| –LASTLOG_LEVEL | Where LASTLOG_LEVEL is one of the lastlog levels listed in SET LASTLOG_LEVEL; do not show messages of this type. |
| -target <string> | Show only lines with this display target. |
| -mangle <descr> | Output is mangled by specified mangle types. |
| -rewrite <string> | Rewrite each line before it is displayed (see below) |
To list all private messages from JoeBob:
/lastlog -msg joebob
To list all public messages from JoeBob in the last 100 lines
/lastlog -public joebob 100
To list all occurrences of the phrase “ircII-EPIC is cool” from 100 to 600 lines ago:
/lastlog "ircII-EPIC is cool" 100 500
To list everything *except* messages:
/lastlog -all --msgs
To write everything containing “foo” to “lastlog.out”:
/lastlog -file lastlog.out foo
To list only public messages to #epic:
/lastlog -target #epic -public
The -REWRITE flag rewrites each line by expanding the <string> argument using the following values for $*
| $0 | The lastlog item’s unique refnum |
| $1 | Timestamp (suitable for use with $strftime()) |
| $2 | Window refnum |
| $3 | Output level |
| $4 | Reserved for future use |
| $5 | Reserved for future use |
| $6 | Reserved for future use |
| $7 | Output target |
| $8- | The logical line of output |
Remember that the <string> may be subject to quoting hell.
Example:
/lastlog -rewrite "$$strftime($1 %T) $$8-"
The lastlog command first appeared in ircII. The -REWRITE flag first appeared in EPIC5-0.3.5