Browse Source

second parameter added - display [default|fancy]

master
Sam Hunter 5 months ago
parent
commit
90f63a9f65
  1. 8
      lucy

8
lucy

@ -6,7 +6,7 @@
readonly PROGNAME=${0##*/}
readonly VERSION="1.0"
awk -vWEEKS="${1:-1}" '
awk -vMODE="${2:-"default"}" -vWEEKS="${1:-1}" '
BEGIN{ #WEEKS=3
FS="|"
x=systime()-(WEEKS*7*24*3600)
@ -21,7 +21,11 @@ BEGIN{ #WEEKS=3
topic = $3
idx = sprintf("%s+%s",user,timestamp)
if(topic !~ /^$/){
a[idx] = sprintf("%10s %-15s %-25s %-30s", strftime("%Y-%m-%d",timestamp), user, substr(topic,1,25),substr($5,1,30))
if( MODE == "fancy" ){
a[idx] = sprintf("%10s %-15s \x1b[1m%33s\x1b[0m\n%-60s", strftime("%Y-%m-%d",timestamp), user, substr(topic,1,25),substr($5,1,60))
} else {
a[idx] = sprintf("%10s %-15s %-25s %-30s", strftime("%Y-%m-%d",timestamp), user, substr(topic,1,25),substr($5,1,30))
}
ad[idx] = timestamp
} else {
if(timestamp > x) {

Loading…
Cancel
Save