From d8ffb0f49ce2edabf1b251d425463ab18a70f769 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Tue, 10 Mar 2015 09:20:06 +0100 Subject: add support for more escapes in issue-file MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- gotrc-examples/issue-file | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/gotrc-examples/issue-file b/gotrc-examples/issue-file index ebf7813..6d0d868 100644 --- a/gotrc-examples/issue-file +++ b/gotrc-examples/issue-file @@ -42,16 +42,16 @@ for c in data: elif c == "r": buf += "$(uname -r)" elif c == "v": buf += "$(uname -v)" elif c == "m": buf += "$(uname -m)" - elif c == "o": buf += "(\\\\o is not implemented)" - elif c == "O": buf += "(\\\\O is not implemented)" - elif c == "d": buf += "(\\\\d is not implemented)" - elif c == "t": buf += "(\\\\t is not implemented)" + elif c == "o": buf += "$(hostname -y)" + elif c == "O": buf += "$(hostname -d)" + elif c == "d": buf += "$(date +%Y-%m-%d)" + elif c == "t": buf += "$(date +%H:%M:%S)" elif c == "l": buf += "${tty}" - elif c == "b": buf += "(\\\\b is not implemented)" - elif c == "u": buf += "(\\\\u is not implemented)" - elif c == "U": buf += "(\\\\U is not implemented)" - elif c == "4": buf += "(\\\\4 is not implemented)" - elif c == "6": buf += "(\\\\6 is not implemented)" + elif c == "b": buf += "$(stty | grep -Po 'speed [^ ]* baud;' | cut -d ' ' -f 2)" + elif c == "u": buf += "$(who | wc -l)" + elif c == "U": buf += "$(n=$(who | wc -l) ; echo $n $(echo $n | sed -e 's/^1$/user/' -e 's/^[0-9]\+$/users/'))" + elif c == "4": buf += "$(ifconfig | grep '^ *inet ' | grep -Po 'inet [^ ]*' | cut -d ' ' -f 2 | sed 1q)" + elif c == "6": buf += "$(ifconfig | grep '^ *inet6 ' | grep -Po 'inet6 [^ ]*' | cut -d ' ' -f 2 | sed 1q)" else: buf += c elif c == "\\\\": -- cgit v1.2.3-70-g09d2