Skip to content

Instantly share code, notes, and snippets.

@onecooltaco
Created November 8, 2011 19:42
Show Gist options
  • Save onecooltaco/1348892 to your computer and use it in GitHub Desktop.
Save onecooltaco/1348892 to your computer and use it in GitHub Desktop.
delete all printers
#!/bin/bash
## from http://groups.google.com/group/macenterprise/browse_thread/thread/25647cbd9e346d16
# remove exiting printers
curPrinterList=`lpstat -p | grep printer | awk '{ print $2 }'`
for p in $curPrinterList; do
echo "Removing $p..."
if lpadmin -x $p; then
echo "Done"
else
echo "\n*******Error removing $p********\n$result\n\n"
fi
echo
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment