On macOS X, the pbcopy and pbpaste command can be used to manipulate the clipboard.
On Desktop linux that's the xclip -selection command, so I made alias pbcopy='xclip -selection clipboard' and alias pbpaste='xclip -selection clipboard -o' for the command to be portable with macOS X.
That's very useful for a lot of text replacement applications :
pbpaste > file.txt # into a file
pbcopy file.txt # from a file
cat file.txt | pbcopy # from a file, using a pipe
pbpaste | sed 's/ /-/g' | pbcopy # direct replacement of clipboard
pbpaste | python 'import sys
sys.stdout.write(sys.stdin.read().replace(" ", "-"))
' | pbcopy # use python for more complicated Operations !
pbpaste | python replace_stuff.py | pbcopy # why not from a python file ?
I have no clue how clipboard work in android but I think that's manageable !
On macOS X, the
pbcopyandpbpastecommand can be used to manipulate the clipboard.On Desktop linux that's the
xclip -selectioncommand, so I madealias pbcopy='xclip -selection clipboard'andalias pbpaste='xclip -selection clipboard -o'for the command to be portable with macOS X.That's very useful for a lot of text replacement applications :
I have no clue how clipboard work in android but I think that's manageable !