aboutsummaryrefslogtreecommitdiffstats
path: root/gotrc-examples
diff options
context:
space:
mode:
Diffstat (limited to 'gotrc-examples')
-rw-r--r--gotrc-examples/issue-file18
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 == "\\\\":