Hi I want to recursively remove all printers of a certain model number with a script, what I have so far is the below but while testing the script seems to exit with 0.
#!/bin/bash
function rmPrinters {
thisPrinter=""
thisPrinter=`lpstat -p | grep X7855 | head -1 | cut -d " " -f 2`
if [ -z "$thisPrinter" ]; then
exit 0
else
lpadmin -x $thisPrinter
rmPrinters{}
fi
}
Can anyone help figure out why this is not working?