diff options
| author | Mattias Andrée <maandree@operamail.com> | 2015-03-10 09:20:06 +0100 |
|---|---|---|
| committer | Mattias Andrée <maandree@operamail.com> | 2015-03-10 09:20:06 +0100 |
| commit | d8ffb0f49ce2edabf1b251d425463ab18a70f769 (patch) | |
| tree | 2da4b5327ca0c18e82a929f0ad51049dc42dfcbb /gotrc-examples | |
| parent | missed to bump the year on the examples (diff) | |
| download | gates-of-tartaros-d8ffb0f49ce2edabf1b251d425463ab18a70f769.tar.gz gates-of-tartaros-d8ffb0f49ce2edabf1b251d425463ab18a70f769.tar.bz2 gates-of-tartaros-d8ffb0f49ce2edabf1b251d425463ab18a70f769.tar.xz | |
add support for more escapes in issue-file
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'gotrc-examples')
| -rw-r--r-- | gotrc-examples/issue-file | 18 |
1 files 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 == "\\\\": |
