commit 4f319da678e4b631491b276ddabde6d9b5fd48d4
parent ad0aa5113f7fe48b0fadf1e31a0ce40c95fc94dd
Author: Anders Damsgaard <anders@adamsgaard.dk>
Date: Sun, 27 Dec 2020 17:30:58 +0100
search: translate from danish to english with !translate
Diffstat:
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/.local/bin/search b/.local/bin/search
@@ -68,7 +68,10 @@ elif regeximatch "$c" '!wiki'; then
elif regeximatch "$c" '^rfc[0-9][0-9]*$'; then
plumb "ftp://ftp.rfc-editor.org/in-notes/${c}.txt"
-elif regeximatch "$c" '!yt'; then
+elif regexmatch "$c" '!translate'; then
+ plumb "https://en.bab.la/dictionary/danish-english/$(printf '%s' "$c" | sed 's/ *!translate *//')"
+
+elif regexmatch "$c" '!yt'; then
q="$(printf '%s' "$c" | sed "s/ *!yt *//")"
#idiotbox="$HOME/code/idiotbox"
#if [ -x "$idiotbox/cgi" ]; then