16 lines
218 B
Bash
16 lines
218 B
Bash
#!/bin/sh
|
|
|
|
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"
|