Requirement was to get the differences of printers on the prod server and the dev server
Using the following awk, i was able to get the difference between two files.
awk 'BEGIN {while ( getline < "sun5-printers.txt") {arr[$0]++ }}{ if (!($0
in arr ) ) {print} }' sun8-printers.txt
I need to amend the IP address of my printers, so that they can work on my DEV server
I have this function to add the printer using the lpadmin command
# Printer Name cannot Include any spaces
prName=" "
# IP Address of printer
prAddress=" "
# Location
prLocation=" "
#Description
prdescrip=" "
#filter
prfilter=" "
#Port
prport=" "
#Driver
prdriver=" "
#Amend,create or delete Printer
printerExists $prName
prExists=$?
function printerExists()
{
if [ $prExists -eq 1 ]; then
echo "Printer already exists. Skipping: \"$prName\""
else
# Add Printer Command
lpadmin -p "${prName}" -E -D "${prDescript}" -L "${prLocation}" -i /u1/cups/mac/"$prFilter_filter -v \
"$Port"://"${prAddress}":"Prdriver"
fi
Is this correct, if not how can i amend it????