aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Lemon <matt@matthewlemon.com>2022-07-20 08:45:23 +0100
committerMatthew Lemon <matt@matthewlemon.com>2022-07-20 08:45:23 +0100
commit4490faf95d801af699882a2b1dfc48c62b96dbac (patch)
tree6d24f8d375bb1883208715aa3860e6cfb8f47ac9
parent0b2e02c3d6bab46ef71fa60f50b04a05cb9141a4 (diff)
parent2e62dec31c3164218339c5cf72d6d3aaba69d816 (diff)
Merge branch 'master' of gitlab.com:yulqen/bash-scripts
Diffstat (limited to '')
-rwxr-xr-xdict24
1 files changed, 24 insertions, 0 deletions
diff --git a/dict b/dict
new file mode 100755
index 0000000..b9ef58c
--- /dev/null
+++ b/dict
@@ -0,0 +1,24 @@
+#!/usr/local/bin/bash
+
+URL=https://en.m.wiktionary.org/wiki/
+URLT=https://www.wordnik.com/words/WORD#relate
+CMD=lynx
+
+function usage {
+ echo
+ echo "Usage: dic [WORD] [-t (search thesaurus)] [-h (display this help)]"
+ echo " Searches for WORD at wiktionary. If -t is passed, then searches for word at wordnik, using their synonyms feature."
+}
+
+if [[ $# -eq 0 ]]; then
+ usage
+ exit 1
+fi
+
+if [[ "$1" = "-t" ]]; then
+ URLTx=${URLT/WORD/$2}
+ $CMD "$URLTx"
+ shift
+else
+ $CMD "$URL$1"
+fi