When I run:

#!/bin/sh
xmllint --c14n "$*" | XMLLINT_INDENT=$'\t' xmllint --encode UTF-8 --format -

I get

/private/var/folders/Aj/Aj9m3c8JGnmkccHY2o3lKE+++TI/Cleanup At Startup/Tidy XML.sh.S:1: parser error : Start tag expected, '<' not found question_autoSwitch ^ -:1: parser error : Document is empty

^ -:1: parser error : Start tag expected, '<' not found

Something is very wrong. :P

Any ideas?

link|improve this question

43% accept rate
I don't know anything, but that hat pipe | looks out of place. did you mean to have another command after it or did you mean to escape it? – Zoredache Mar 18 '11 at 23:06
This is where I go the script magp.ie/2010/02/15/format-xml-with-textwrangler – bobber205 Mar 18 '11 at 23:20
feedback

1 Answer

Try this instead:

#!/bin/bash
XMLLINT_INDENT=$'\t' xmllint --encode UTF-8 --format - $*
link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.