#! /bin/bash # Clean up from previous script if needed rm -f /tmp/print* ### Delete Current Printers # create a temp file containing all # of the printer names, one printer # per line. All other info is commented # out with a "#". /usr/bin/sed 's/\|/\ # /g' /etc/printcap >> /tmp/printcap.tmp # append /usr/sbin/lpadmin -x to # the front of every line and # write it to another temp file /usr/bin/sed 's/^/\/usr\/sbin\/lpadmin\ -x\ /' /tmp/printcap.tmp >> /tmp/printer.final # make our final temp file into an executable script chmod +rwx /tmp/printer.final # run our new script /tmp/printer.final