From c09d91fe95fca4367f47c06fc808cd02a1a8e6a5 Mon Sep 17 00:00:00 2001 From: Ben Burwell Date: Tue, 13 Aug 2019 14:40:54 -0400 Subject: add bins --- templates/.bin/randword | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100755 templates/.bin/randword (limited to 'templates/.bin/randword') diff --git a/templates/.bin/randword b/templates/.bin/randword new file mode 100755 index 0000000..3bf5bd8 --- /dev/null +++ b/templates/.bin/randword @@ -0,0 +1,6 @@ +#!/bin/sh + +wf=/usr/share/dict/words +total_words=`wc -l $wf | tr -d ' ' | cut -d'/' -f1` +ln=`python3 -c "import secrets; print(secrets.randbelow($total_words))"` +tail -n $ln $wf | head -n 1 -- cgit v1.2.3