Quantcast
Channel: Spootnik.org
Viewing all articles
Browse latest Browse all 35

Removing duplicate gems

$
0
0

Found myself typing this in a shell:

gem list --local |\
   egrep '.*(.*,.*)' |\
   sed 's/^\([^ ]*\) ([^,]*,\(.*\))/\1\2/' |\
   sed 's/,//g' |\
   awk '{for (i = 2; i <=NF ;i++) {printf "sudo gem uninstall %s --version=%s\n", $1, $i}}'

Sometimes perl or ruby with -e is just faster


Viewing all articles
Browse latest Browse all 35

Trending Articles