2019-04-24 16:16:37 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# This is a quick and dirty shell script to extract the words
|
|
|
|
# in a source file and return the descriptions of them.
|
|
|
|
#
|
|
|
|
# Requirements:
|
|
|
|
#
|
|
|
|
# In your $PATH:
|
|
|
|
#
|
|
|
|
# - retro
|
|
|
|
# - retro-describe
|
|
|
|
#
|
|
|
|
# Usage:
|
|
|
|
#
|
|
|
|
# ./describe sourcefile
|
|
|
|
|
2019-12-16 21:09:07 +01:00
|
|
|
# Extract | Split | Strip Blanks | Sort | Filter | Terminate | Generate | Strip Blanks
|
2019-12-16 22:14:08 +01:00
|
|
|
retro-unu $1 | tr " " "\n" | sed '/^[[:space:]]*$/d' | grep -Ev "^[\\\^\.\"\@\!\$\`:&'#$.\(\|]" | sort | uniq | tr "\n" "\0" | xargs -0 -J % retro-describe | cat -s
|
2019-04-24 16:16:37 +02:00
|
|
|
|
2019-12-16 21:09:07 +01:00
|
|
|
# Extract | Split | Strip Blanks | Get first | Sort | Filter | Find Prefixes | Generate word names | Terminate | Generate | Strip Blanks
|
2019-12-16 22:14:08 +01:00
|
|
|
retro-unu $1 | tr " " "\n" | sed '/^[[:space:]]*$/d' | cut -c1-1 | sort | uniq | grep "[\\\^\.\"\@\!\$\`:&'#$.\(\|]" | sed 's/^/prefix:/' | tr "\n" "\0" | xargs -0 -J % retro-describe | cat -s
|