Monthly Archives: October 2014

Find with xargs

Search all files under current directory, look for xml node ‘ ‘, copy and print that node. Send the output to a file. find . |xargs -n1 xmlstarlet sel -t -c “//processorInfo[@ruleType='store']” 2>/dev/null > /cygdrive/b/allstore.txt

Posted in Linux | Leave a comment

XMLStartlet – Command line xml queries

xmlstarlet sel -t -c “//YOUR_NODE_ELEMENT_TAG_NAME[@ATTRIBUTE_NAME='ATTRIBUTE_VALUE']” YOUR_XML_FILE.xml

Posted in Linux | Leave a comment

Bash Scripting templates

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859# ========================== # Bash tips # ========================== # Run bash by $ /bin/bash scriptname.sh $ /bin/bash scriptname.sh +x  # debug mode # Or put the next line on the 1st line of your file. #!/bin/bash -x ## Double round braket … Continue reading

Posted in Linux | Leave a comment