After seeing the following post, many possibilities came to mind.
Notes: Pretty print XML
But working with XMPP and SAPO Broker, I’m always copy&pasting XML from one place to the other and it would be nice to format the XML snippet sitting in the clipboard.
This pipe does the trick quite nicely:
pbpaste | xmllint –format – | pbcopy
I wrapped this into a script, called x-xml-format-clipboard and now its just one command away from gratification.
In the end I came up with a couple that I use a lot after searching the web. The possibilities are endless but these are neat for me. In Eclipse I can’t easily transform text unless I install AnyEdit which I have on other systems. But I haven’t yet on this one. So the transforms are simple:
upper to lower:
#!/bin/bash
pbpaste | tr '[:lower:]' '[:upper:]' | pbcopy
lower to upper:
#!/bin/bash<br /><br />pbpaste | tr '[:upper:]' '[:lower:]' | pbcopy<br />
remove blank lines:
#!/bin/bash<br /><br />pbpaste | grep -v '^
These are made into executable scripts on my path which I can then pull up with Quicksilver. So now to remove blank lines, I select the text in any editor, trigger Quicksilver, highlight the command, press enter, and paste it back. Nice. Of course this means that you can do just about anything with this kind of thing as discussed here. | pbcopy
These are made into executable scripts on my path which I can then pull up with Quicksilver. So now to remove blank lines, I select the text in any editor, trigger Quicksilver, highlight the command, press enter, and paste it back. Nice. Of course this means that you can do just about anything with this kind of thing as discussed here.