Skip to content

Commit

Permalink
Update occ.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
wiwikuan authored May 11, 2024
1 parent d4a45d7 commit d7c65f5
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions occ.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"

0 comments on commit d7c65f5

Please sign in to comment.