Advertisement
evandrix

[bash] pip uninstall all

Sep 5th, 2011
864
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.41 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. #if [ "$#" -ne 1 ]; then
  4. #    echo "Usage: $0 <py pkg name using \$(pip freeze -l)>"
  5. #    exit
  6. #fi
  7.  
  8. for plugin in $(pip freeze -l); do
  9.     PLUGIN=$(echo "$plugin" | awk -F == '{print $1}')
  10.     echo "Uninstalling $PLUGIN..."
  11.     expect -c "spawn pip uninstall $PLUGIN
  12.    expect {
  13.         \"Proceed (y/n)?\" {
  14.             send \"y\r\n\"
  15.             expect {
  16.                 exit
  17.             }
  18.         }
  19.    }"    
  20. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement