Update occ.sh

This commit is contained in:
2024-05-11 09:29:16 +08:00
committed by GitHub
parent d4a45d7c51
commit d7c65f5d55

9
occ.sh
View File

@@ -23,5 +23,14 @@ opencc -i "$input" -o "$output" -c s2tw.json
# 輸出結果
cat "$output"
# 將結果複製到剪貼簿
if command -v pbcopy >/dev/null 2>&1; then
# macOS
cat "$output" | pbcopy
elif command -v xclip >/dev/null 2>&1; then
# Linux
cat "$output" | xclip -selection clipboard
fi
# 清理臨時檔案
rm "$input" "$output"