Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $ xsel -b | sed 's/^/ /' | xsel -b
- # put two lines in the clipboard, "abc" and "123", for the example
- # the n is a newline, and echo adds another newline to the end
- $ echo $'abcn123' | xsel -b
- $ xsel -b | sed 's/^/ /' # output written to the terminal
- abc
- 123
- $ xsel -b | sed 's/^/ /' | xsel -b # again, to the clipboard
- #!/bin/bash
- xsel -b | sed 's/^/ /' | xsel -b
- $ chmod +x indent4
- # test it:
- $ echo $'abcn123' | xsel -b # load clipboard
- $ ./indent4 # assuming it's in the current directory
- $ xsel -b # show clipboard
- abc
- 123
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement