Skip to content

Instantly share code, notes, and snippets.

@jaymecd
Created January 6, 2014 10:06
Show Gist options
  • Select an option

  • Save jaymecd/8280674 to your computer and use it in GitHub Desktop.

Select an option

Save jaymecd/8280674 to your computer and use it in GitHub Desktop.
remove all packages from PEAR channel
function pear_remove {
local channel="$1"
if [ -z $channel ]; then
echo "Error: channel must be provided"
return 1
fi
for pkg in $(pear list -c "$channel" | awk '{if ( $2 ~ /([0-9]+)\.([0-9]+)\.([0-9]+)/ ) print $1}') ; do
pear uninstall "$channel/$pkg"
done
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment