v1ral_ITS

termiinal paste command from clipboard

Sep 3rd, 2018
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.38 KB | None | 0 0
  1. clippaste () {
  2.     emulate -L zsh
  3.     if [[ $OSTYPE == darwin* ]]
  4.     then
  5.         pbpaste
  6.     elif [[ $OSTYPE == cygwin* ]]
  7.     then
  8.         cat /dev/clipboard
  9.     else
  10.         if (( $+commands[xclip] ))
  11.         then
  12.             xclip -out -selection clipboard
  13.         elif (( $+commands[xsel] ))
  14.         then
  15.             xsel --clipboard --output
  16.         else
  17.             print "clipcopy: Platform $OSTYPE not supported or xclip/xsel not installed" >&2
  18.             return 1
  19.         fi
  20.     fi
  21. }
Add Comment
Please, Sign In to add comment