But it serves its purpose for this article and most scenarios. The if statement only compares the last line of the clipboard.txt file, so if there are multiple lines in the clipboard it'll fail to recognize it as a duplicate entry. However, this solution is somewhat flawed. Only if the current clipboard content is not equal ( !=) to the last entry ( tail -n1) in clipboard.txt will pbpaste update the file. ~$ while true do if ] then echo -e "\n$(pbpaste)" >/tmp/clipboard.txt fi
0 Comments
Leave a Reply. |