Created
July 12, 2012 10:18
-
-
Save fs111/3097209 to your computer and use it in GitHub Desktop.
nexus commandline search
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# command line search script for nexus instances. Needs curl and xmlstarlet | |
# installed. | |
NEXUS_URL="http://nexus.example.com/nexus/service/local/lucene/search?q=" | |
# make sure we got exactly one param | |
if [ ! $# -eq 1 ] | |
then | |
echo "usage nexus-search <term>" | |
exit 1 | |
fi | |
curl -s $NEXUS_URL$1 | xmlstarlet sel -T -t -m /searchNGResponse/data/artifact \ | |
-v "groupId" -o " "\ | |
-v "artifactId" -o " " \ | |
-v "version" -n |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
cool, exactly what I was looking for :) I will try to create awk script to convert this basic output to '...'