diff options
author | emkael <emkael@tlen.pl> | 2019-01-31 21:09:58 +0100 |
---|---|---|
committer | emkael <emkael@tlen.pl> | 2019-01-31 21:09:58 +0100 |
commit | e1056ce60855b0a6ece9f49ae5b96b6c9c52ab08 (patch) | |
tree | 79e175ffe58a394bde6e130f4cbec27854dbb2de /bin | |
parent | aa19ac70447506b64c78ab38a6a3031f7effa31a (diff) |
Reading HtmlFeed user agent from config file
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/get-user-agent.sh | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/bin/get-user-agent.sh b/bin/get-user-agent.sh new file mode 100755 index 0000000..4d348d9 --- /dev/null +++ b/bin/get-user-agent.sh @@ -0,0 +1,10 @@ +#!/bin/bash +ACCESSLOG="$1" +PATTERN="$2" +OUTPUT="$3" +LINE=`grep "$PATTERN" "$ACCESSLOG" | grep Chrome | tail -n 1` +if [ -n "$LINE" ] +then + COLS=`echo "$LINE" | csvtool -t ' ' width -` + echo "$LINE" | csvtool -t ' ' col $COLS - | sed 's/"//g' > $OUTPUT +fi |