nuke spaces and also remove tail
This commit is contained in:
parent
a5cea26d1b
commit
1214a6fb1a
12
dictpopup
12
dictpopup
|
@ -1,14 +1,12 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
word=${1:-$(sselp)}
|
word=${1:-$(sselp)}
|
||||||
|
word_without_spaces=$(echo "$word" | tr -d ' ')
|
||||||
|
|
||||||
dict_lookup=$(sdcv -n --utf8-output -e "$word")
|
dict_lookup=$(sdcv -n --utf8-output -e "$word_without_spaces")
|
||||||
|
|
||||||
|
|
||||||
if echo "$dict_lookup" | perl -0777 -ne 'exit 0 if /Nothing similar to/ ; exit 1'; then
|
|
||||||
echo "$dict_lookup" | popup
|
|
||||||
|
|
||||||
|
if echo "$dict_lookup" | perl -0777 -ne 'exit 0 if /Nothing similar to/; exit 1'; then
|
||||||
|
echo "$dict_lookup" | popup
|
||||||
else
|
else
|
||||||
echo "$dict_lookup" | tail -n +5 | perl -pe 's/<[^>]*>//g' | popup
|
echo "$dict_lookup" | perl -0777 -pe 's/^.*\n.*\n.*\n.*\n//; s/<[^>]*>//g' | popup
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue