Help with loop/counter script
The script is searching for "Name" - but no field entitled "Name" exists, so nothing is found. There is an alternate command lpstat that may be easier to parse the name from, and returns the same ordering:

/usr/bin/lpstat -p | awk '{print $2}'

Since PPD is also in PPD Version, this causes a conflict. Search instead for PPD:, like the following:

ppd=($(/usr/sbin/system_profiler SPPrintersDataType \
           | /usr/bin/awk -F ":" '/PPD:/{$1="";print $0}' \
           | /usr/bin/sed 's/\ /-,--/g'))



Here's a complete script - it appears to do what you want:

 #!/bin/bash
 name=($(/usr/bin/lpstat -p | awk '{print $2}' | /usr/bin/sed 's/\ /-,--/g'))
 ppd=($(/usr/sbin/system_profiler SPPrintersDataType | /usr/bin/awk -F ":" '/PPD:/{$1="";print $0}' | /usr/bin/sed 's/\ /-,--/g'))
 ppdversion=($(/usr/sbin/system_profiler SPPrintersDataType | /usr/bin/awk -F ":" '/PPD File Version/{$1="";print $0}' | /usr/bin/sed 's/\ /-,--/g'))
 uri=($(/usr/sbin/system_profiler SPPrintersDataType | /usr/bin/awk '/URI/{print $NF}'))
 total="${#ppdversion[@]}"
 /bin/echo "&lt;result&gt;"
 for ((counter=0; counter &lt; "$total"; counter++))
 {
     echo "name: ${name[$counter]}" | /usr/bin/sed 's/-,--/\ /g;s/\ \ //g'
     echo "PPD: ${ppd[$counter]}" | /usr/bin/sed 's/-,--/\ /g;s/\ \ //g'
     echo "PPD Version: ${ppdversion[$counter]}" | /usr/bin/sed 's/-,--/\ /g;s/\ \ //g'
     echo "URI: ${uri[$counter]}"
     echo
 }
 echo "&lt;/result&gt;"


The output (for my installed printers):

&lt;result&gt;
name: Brother_MFC_9325CW
PPD: Brother MFC-9325CW CUPS
PPD Version: 4.5.2
URI: usb://Brother/MFC-9325CW?serial=000L2J998184

name: Canon_MX410
PPD: Canon MX410 series
PPD Version: 16.10.0.0
URI: dnssd://Canon%20MX410._printer._tcp.local./auto

&lt;/result&gt;