first commit
This commit is contained in:
16
trk
Executable file
16
trk
Executable file
@@ -0,0 +1,16 @@
|
||||
#!/bin/sh
|
||||
# trk — translate English↔Korean, direction picked from input.
|
||||
|
||||
if [ $# -gt 0 ]; then
|
||||
text=$*
|
||||
else
|
||||
text=$(cat)
|
||||
fi
|
||||
|
||||
if printf '%s' "$text" | grep -qP '[\x{AC00}-\x{D7A3}\x{3131}-\x{3163}]'; then
|
||||
pair=ko:en
|
||||
else
|
||||
pair=en:ko
|
||||
fi
|
||||
|
||||
exec trans -b "$pair" "$text"
|
||||
Reference in New Issue
Block a user