Advertisement
Guest User

eb script

a guest
Mar 12th, 2014
494
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. eb script
  2.  
  3. #!/bin/bash
  4.  
  5. # mc clipboard is ~/.cedit/cooledit.clip
  6. #
  7. # 1. With no argument, transfers mc clipboard to stdout.
  8. #
  9. # 2. with argument of filename or "-", loads clipboard
  10. # from file or stdin. If that arg is preceded by "-a",
  11. # then file or stdin is appended to clipboard, not loaded.
  12.  
  13. edbuf=~/.mc/cedit/cooledit.clip
  14.  
  15. if [ -z "$1" ]; then
  16. cat $edbuf
  17. else
  18. if [ "$1" = "-a" ]; then
  19. shift
  20. if [ "$1" = "-" ]; then
  21. cat >> $edbuf
  22. else
  23. cat $1 >> $edbuf
  24. fi
  25. else
  26. if [ "$1" = "-" ]; then
  27. cat > $edbuf
  28. else
  29. cat $1 > $edbuf
  30. fi
  31. fi
  32. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement