blob: 22867e822d8a1e1d73571a9b7f9507f9ddc6d01a (
plain)
1
2
3
4
5
6
7
|
#!/bin/bash
declare awkmatch="$2"
for i in "${@:3}"; do
awkmatch+="|$i"
done
tail -f /var/log/messages \
| awk "/$awkmatch/{ \$5=\" $1:\"; for (f=5; f<=NF; ++f) {printf(\"%s \", \$f);}; printf(\"\n\") }"
|