3 ms·
Instead of using a very long set of If statements, I think you could just use something like a=$((`date +%M`/15));b=$((128335 + `date +%l` +((a*(a**2-39*a+
by chch 13y ago
Instead of using a very long set of If statements, I think you could just use something like
a=$((`date +%M`/15));b=$((128335 + `date +%l` +((a*(a**2-39*a+110))/6)));printf '%x' $b;
and print the resulting hex's character, no?
(I'd finish off the code myself, but I have a bus to catch)
Edit: Ah, I see Sephr came prepared. ;)
- psm42 13y agoI'm sure you could. It's a quick hack.
- chch 13y agoNo criticism here; your quick hack let me do a quick hack and learn some bash in the process. :)
- deleted 13y ago[deleted]
- nojhan 13y agoI've proposed a PR that do just that (maybe a little bit more readable): https://github.com/paulsm/bashtime/pull/1 https://github.com/paulsm/bashtime/pull/1 Also, the code is now used in the liquid prompt: https://github.com/nojhan/liquidprompt/commit/91959b636af751fefdc5f077464a237b8d4701d2 https://github.com/nojhan/liquidprompt/commit/91959b636af751...