简体   繁体   中英

Paste from system mac osx clipboard into terminal

I'm trying to use python-markdown to convert the system clipboard contents into HTML by running a shell script after pressing a hotkey and sending the processed markdown to pbcopy . The following is the shell script to make this happen.

#!/bin/sh
echo `pbpaste` | python -m markdown | pbcopy

The issue already known is that pbpaste will not contain the systems clipboard contents. Is there a similar utility to pbpaste that stores the clipboard contents?

pbpaste should work for this. You can even specify the general clipboard to ensure you're getting the main system clipboard.

#!/bin/sh

pbpaste -pboard general | python -m markdown | pbcopy

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM