Skip to content

Instantly share code, notes, and snippets.

@noahcampbell
Created April 19, 2011 22:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save noahcampbell/929828 to your computer and use it in GitHub Desktop.
Save noahcampbell/929828 to your computer and use it in GitHub Desktop.
Select nodes from a resources.xml file used by RunDeck
#!/bin/bash
# Expect stdin to be a pipe from a resources.xml file.
xmlstarlet sel -t -m //node -v @hostname -o , -v @tags -n | grep --color -E "${1:-.*}" | cut -d , -f 1 | sed "/^$/d" | sort | uniq
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment