Advertisement
v1ral_ITS

test

Nov 11th, 2019
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.71 KB | None | 0 0
  1. #!/usr/bin/zsh
  2. #    v1ral_ITS
  3. #*  .bashrc OR .zshrc Alias for awesome terminal cat output anyfile to pastebin
  4. ##   https://pastebin.com/u/v1ral_ITS
  5.  
  6. #    .*rc function alias
  7. #*   needed default pastebin script and default pastebin.conf are lsted after
  8.  
  9.  
  10. # Define the alias for which ever rc they choose
  11. to_rc() {
  12. cat <<EOF
  13.     pbin_this() {
  14.         file_this=$*
  15.         (\cat $file_this | pastebin) | xsel -i --clipboard
  16.  
  17.         printf '\033[033mPASTEBINS_NEW_URL: \033[m'
  18.         echo `xsel --clipboard`
  19.     }
  20. EOF
  21. }
  22.  
  23.  
  24. # Execute \$0\ file to add to your .bashrc or .zshrc
  25. echo -e "Which RC: \n1) bashrc \n2) zshrc "
  26. read n
  27.  
  28. case $n in
  29.     1)
  30.     to_rc >>~/.bashrc && . ~/.bashrc
  31.     ;;
  32.     2)
  33.     to_rc >>~/.zshrc && . ~/.zshrc
  34.     ;;
  35.       *) invalid input ;;
  36. esac
  37.  
  38. # Finished
  39. exit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement