There are also native language-specific wrappers for that API, for example in python[1], which lets you write a bot in 5 lines:
import zulip
client = zulip.Client()
def onmsg(m):
print ("at %d, %s said: %s" %
(m['timestamp'],
m['sender_email'],
m['content']))
client.call_on_each_message(callback=onmsg)
[1] https://pypi.org/project/zulip/
$RANDOM yields a random integer in the range 0..32767. (This feature was already there.)
$EPOCHSECONDS yields the whole number of seconds since the epoch.
$EPOCHREALTIME yields the number of seconds since the epoch with microsecond precision.
I'm thinking of a new shell feature that would allow the user to define similar variables. For example, I have $today set to the current date in YYYY-MM-DD format, and I have to jump through some minor hoops to keep it up to date.
Does anyone else think this would be useful enough to propose as a new bash feature? Would it create any potential security holes? Should variables like $PATH be exempted?
(Of course this doesn't add any new functionality, since I could use "$(date +%F)" in place of "$today". It's just a bit of syntactic sugar.)