<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Parameter help inside script. in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/parameter-help-inside-script/m-p/2815970#M828554</link>
    <description>ok all&lt;BR /&gt;&lt;BR /&gt;as per your suggestion robin, i moved the statement containing the select_on variable up in the script, now the script just passes thru with no input asked for or output given.&lt;BR /&gt;&lt;BR /&gt;any clues?&lt;BR /&gt;&lt;BR /&gt;mvitux01@/home/fgrosb01# ./jdpstatus &lt;BR /&gt;#! /usr/bin/ksh -v&lt;BR /&gt;&lt;BR /&gt;# This script is utilized to gather printer information on all print queue's installed&lt;BR /&gt;# on a system using the hpnpadmin command.&lt;BR /&gt;&lt;BR /&gt;# Environmental section&lt;BR /&gt;&lt;BR /&gt;BASEDIR=/home/fgrosb01&lt;BR /&gt;DATE=`date +%m/%d/%Y`&lt;BR /&gt;YDATE=`TZ=CST+24 date +%m/%d/%Y`&lt;BR /&gt;SCRIPT_EXECUTION_TIME=$(date +'%H:%M:%S')&lt;BR /&gt;SCRIPT_REVISION="HPUX-b.11.00.01"&lt;BR /&gt;SCRIPT_HPUX_VERSION=$(uname -r)&lt;BR /&gt;SCRIPT_SYSTEM=$(uname - n)&lt;BR /&gt;SCRIPT_USER=$(whoami)&lt;BR /&gt;SCRIPT_EXECUTION_TIME=$(date +'%Y/%m/%d/%H:%M:%S')&lt;BR /&gt;&lt;BR /&gt;echo $SCRIPT_SYSTEM \(Version $SCRIPT_REVISION\) $SCRIPT_EXECUTION_TIME&lt;BR /&gt;HP-UX (Version HPUX-b.11.00.01) 2002/09/30/11:17:12&lt;BR /&gt;echo _____________________________________________________________________&lt;BR /&gt;_____________________________________________________________________&lt;BR /&gt;echo&lt;BR /&gt;&lt;BR /&gt;if [ ${SCRIPT_USER} != "root" ] ; then&lt;BR /&gt;   echo&lt;BR /&gt;      echo "This program must be executed utilizing the root logon id only"&lt;BR /&gt;      echo&lt;BR /&gt;      return 501&lt;BR /&gt;      fi&lt;BR /&gt;      echo _______________________________________________________________________&lt;BR /&gt;_______________________________________________________________________&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;# Gather information about printer queue's on system.&lt;BR /&gt;################################################################################## &lt;BR /&gt;# Defaults &lt;BR /&gt;&lt;BR /&gt;PS3="Please select desired printer: " &lt;BR /&gt;fulllist="`cd /etc/lp/interface;ls`" &lt;BR /&gt;&lt;BR /&gt;all_printers () &lt;BR /&gt;{ &lt;BR /&gt;hpnpadmin ${fulllist}&lt;BR /&gt;} &lt;BR /&gt;&lt;BR /&gt;select_printer () &lt;BR /&gt;{ &lt;BR /&gt;select prtname in ALL Quit ${fulllist} &lt;BR /&gt;do &lt;BR /&gt;[ "${prtname}" = "Quit" ] &amp;amp;&amp;amp; exit 0 &lt;BR /&gt;&lt;BR /&gt;if test -n "${prtname}" &lt;BR /&gt;then &lt;BR /&gt;if test "${prtname}" = "ALL" &lt;BR /&gt;then &lt;BR /&gt;prtlist="${fulllist}" &lt;BR /&gt;else &lt;BR /&gt;prtlist="${prtname}" &lt;BR /&gt;fi &lt;BR /&gt;&lt;BR /&gt;break &lt;BR /&gt;fi &lt;BR /&gt;done &lt;BR /&gt;&lt;BR /&gt;hpnpadmin ${prtlist} &lt;BR /&gt;} &lt;BR /&gt;&lt;BR /&gt;[ "${select_on}" = 'N' ] &amp;amp;&amp;amp; all_printers || single_printer &lt;BR /&gt;./jdpstatus[64]: single_printer:  not found&lt;BR /&gt;&lt;BR /&gt;# Main &lt;BR /&gt;if test ${#} -ne 0 &lt;BR /&gt;then &lt;BR /&gt;while getopts :s option &lt;BR /&gt;do &lt;BR /&gt;case ${option} in &lt;BR /&gt;s) select_on="Y";; &lt;BR /&gt;?) echo "Usage: ${0} [&amp;lt;-s&amp;gt;]" &lt;BR /&gt;exit 4 ;; &lt;BR /&gt;esac &lt;BR /&gt;done &lt;BR /&gt;fi &lt;BR /&gt;&lt;BR /&gt;exit 0 &lt;BR /&gt;mvitux01@/home/fgrosb01# &lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Mon, 30 Sep 2002 14:15:28 GMT</pubDate>
    <dc:creator>fg_1</dc:creator>
    <dc:date>2002-09-30T14:15:28Z</dc:date>
    <item>
      <title>Parameter help inside script.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/parameter-help-inside-script/m-p/2815967#M828551</link>
      <description>Hello all&lt;BR /&gt;&lt;BR /&gt;I am trying to figure out the error i am getting from the script below, i understand its a parameter not set but I thought that as part of the script executes it will set that parameter during execution. Basically with this script I am trying to allow someone to query all printers on system or select a particular printer for the check.&lt;BR /&gt;&lt;BR /&gt;can anyone shed some light on this.&lt;BR /&gt;&lt;BR /&gt;Error: ./jdpstatus[80]: select_on: parameter not set&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;#! /usr/bin/ksh&lt;BR /&gt;&lt;BR /&gt;# This script is utilized to gather printer information on all print queue's installed&lt;BR /&gt;# on a system using the hpnpadmin command.&lt;BR /&gt;&lt;BR /&gt;# Environmental section&lt;BR /&gt;&lt;BR /&gt;set -u&lt;BR /&gt;&lt;BR /&gt;BASEDIR=/home/fgrosb01&lt;BR /&gt;DATE=`date +%m/%d/%Y`&lt;BR /&gt;YDATE=`TZ=CST+24 date +%m/%d/%Y`&lt;BR /&gt;SCRIPT_EXECUTION_TIME=$(date +'%H:%M:%S')&lt;BR /&gt;SCRIPT_REVISION="HPUX-b.11.00.01"&lt;BR /&gt;SCRIPT_HPUX_VERSION=$(uname -r)&lt;BR /&gt;SCRIPT_SYSTEM=$(uname - n)&lt;BR /&gt;SCRIPT_USER=$(whoami)&lt;BR /&gt;SCRIPT_EXECUTION_TIME=$(date +'%Y/%m/%d/%H:%M:%S')&lt;BR /&gt;&lt;BR /&gt;echo $SCRIPT_SYSTEM \(Version $SCRIPT_REVISION\) $SCRIPT_EXECUTION_TIME&lt;BR /&gt;echo _____________________________________________________________________&lt;BR /&gt;echo&lt;BR /&gt;if [ ${SCRIPT_USER} != "root" ] ; then&lt;BR /&gt;   echo&lt;BR /&gt;      echo "This program must be executed utilizing the root logon id only"&lt;BR /&gt;      echo&lt;BR /&gt;      return 501&lt;BR /&gt;      fi&lt;BR /&gt;      echo _______________________________________________________________________&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;# Gather information about printer queue's on system.&lt;BR /&gt;################################################################################## &lt;BR /&gt;# Defaults &lt;BR /&gt;&lt;BR /&gt;PS3="Please select desired printer: " &lt;BR /&gt;fulllist="`cd /etc/lp/interface;ls`" &lt;BR /&gt;&lt;BR /&gt;all_printers () &lt;BR /&gt;{ &lt;BR /&gt;hpnpadmin ${fulllist}&lt;BR /&gt;} &lt;BR /&gt;&lt;BR /&gt;select_printer () &lt;BR /&gt;{ &lt;BR /&gt;select prtname in ALL Quit ${fulllist} &lt;BR /&gt;do &lt;BR /&gt;[ "${prtname}" = "Quit" ] &amp;amp;&amp;amp; exit 0 &lt;BR /&gt;&lt;BR /&gt;if test -n "${prtname}" &lt;BR /&gt;then &lt;BR /&gt;if test "${prtname}" = "ALL" &lt;BR /&gt;then &lt;BR /&gt;prtlist="${fulllist}" &lt;BR /&gt;else &lt;BR /&gt;prtlist="${prtname}" &lt;BR /&gt;fi &lt;BR /&gt;&lt;BR /&gt;break &lt;BR /&gt;fi &lt;BR /&gt;done &lt;BR /&gt;&lt;BR /&gt;hpnpadmin ${prtlist} &lt;BR /&gt;} &lt;BR /&gt;&lt;BR /&gt;# Main &lt;BR /&gt;&lt;BR /&gt;if test ${#} -ne 0 &lt;BR /&gt;then &lt;BR /&gt;while getopts :s option &lt;BR /&gt;do &lt;BR /&gt;case ${option} in &lt;BR /&gt;s) select_on="Y";; &lt;BR /&gt;?) echo "Usage: ${0} [&amp;lt;-s&amp;gt;]" &lt;BR /&gt;exit 4 ;; &lt;BR /&gt;esac &lt;BR /&gt;done &lt;BR /&gt;fi &lt;BR /&gt;&lt;BR /&gt;[ "${select_on}" = 'N' ] &amp;amp;&amp;amp; all_printers || single_printer &lt;BR /&gt;&lt;BR /&gt;exit 0 &lt;BR /&gt;mvitux01@/home/fgrosb01# &lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 30 Sep 2002 13:45:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/parameter-help-inside-script/m-p/2815967#M828551</guid>
      <dc:creator>fg_1</dc:creator>
      <dc:date>2002-09-30T13:45:26Z</dc:date>
    </item>
    <item>
      <title>Re: Parameter help inside script.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/parameter-help-inside-script/m-p/2815968#M828552</link>
      <description>This section of code that checks for no arguments-&lt;BR /&gt;&lt;BR /&gt;if test ${#} -ne 0 &lt;BR /&gt;...&lt;BR /&gt;fi &lt;BR /&gt;&lt;BR /&gt;will bypass the while loop and select_on will not be set.&lt;BR /&gt;&lt;BR /&gt;HTH&lt;BR /&gt;&lt;BR /&gt;-- Rod Hills</description>
      <pubDate>Mon, 30 Sep 2002 13:54:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/parameter-help-inside-script/m-p/2815968#M828552</guid>
      <dc:creator>Rodney Hills</dc:creator>
      <dc:date>2002-09-30T13:54:50Z</dc:date>
    </item>
    <item>
      <title>Re: Parameter help inside script.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/parameter-help-inside-script/m-p/2815969#M828553</link>
      <description>Hi Frank,&lt;BR /&gt;&lt;BR /&gt;You've got "set -u" which means treat unset variables as an error when substituting, and in your test at around line 80, select_on hasn't necessarily been set, hence the error.  Just initialise it first.&lt;BR /&gt;&lt;BR /&gt;Rgds, Robin</description>
      <pubDate>Mon, 30 Sep 2002 13:58:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/parameter-help-inside-script/m-p/2815969#M828553</guid>
      <dc:creator>Robin Wakefield</dc:creator>
      <dc:date>2002-09-30T13:58:30Z</dc:date>
    </item>
    <item>
      <title>Re: Parameter help inside script.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/parameter-help-inside-script/m-p/2815970#M828554</link>
      <description>ok all&lt;BR /&gt;&lt;BR /&gt;as per your suggestion robin, i moved the statement containing the select_on variable up in the script, now the script just passes thru with no input asked for or output given.&lt;BR /&gt;&lt;BR /&gt;any clues?&lt;BR /&gt;&lt;BR /&gt;mvitux01@/home/fgrosb01# ./jdpstatus &lt;BR /&gt;#! /usr/bin/ksh -v&lt;BR /&gt;&lt;BR /&gt;# This script is utilized to gather printer information on all print queue's installed&lt;BR /&gt;# on a system using the hpnpadmin command.&lt;BR /&gt;&lt;BR /&gt;# Environmental section&lt;BR /&gt;&lt;BR /&gt;BASEDIR=/home/fgrosb01&lt;BR /&gt;DATE=`date +%m/%d/%Y`&lt;BR /&gt;YDATE=`TZ=CST+24 date +%m/%d/%Y`&lt;BR /&gt;SCRIPT_EXECUTION_TIME=$(date +'%H:%M:%S')&lt;BR /&gt;SCRIPT_REVISION="HPUX-b.11.00.01"&lt;BR /&gt;SCRIPT_HPUX_VERSION=$(uname -r)&lt;BR /&gt;SCRIPT_SYSTEM=$(uname - n)&lt;BR /&gt;SCRIPT_USER=$(whoami)&lt;BR /&gt;SCRIPT_EXECUTION_TIME=$(date +'%Y/%m/%d/%H:%M:%S')&lt;BR /&gt;&lt;BR /&gt;echo $SCRIPT_SYSTEM \(Version $SCRIPT_REVISION\) $SCRIPT_EXECUTION_TIME&lt;BR /&gt;HP-UX (Version HPUX-b.11.00.01) 2002/09/30/11:17:12&lt;BR /&gt;echo _____________________________________________________________________&lt;BR /&gt;_____________________________________________________________________&lt;BR /&gt;echo&lt;BR /&gt;&lt;BR /&gt;if [ ${SCRIPT_USER} != "root" ] ; then&lt;BR /&gt;   echo&lt;BR /&gt;      echo "This program must be executed utilizing the root logon id only"&lt;BR /&gt;      echo&lt;BR /&gt;      return 501&lt;BR /&gt;      fi&lt;BR /&gt;      echo _______________________________________________________________________&lt;BR /&gt;_______________________________________________________________________&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;# Gather information about printer queue's on system.&lt;BR /&gt;################################################################################## &lt;BR /&gt;# Defaults &lt;BR /&gt;&lt;BR /&gt;PS3="Please select desired printer: " &lt;BR /&gt;fulllist="`cd /etc/lp/interface;ls`" &lt;BR /&gt;&lt;BR /&gt;all_printers () &lt;BR /&gt;{ &lt;BR /&gt;hpnpadmin ${fulllist}&lt;BR /&gt;} &lt;BR /&gt;&lt;BR /&gt;select_printer () &lt;BR /&gt;{ &lt;BR /&gt;select prtname in ALL Quit ${fulllist} &lt;BR /&gt;do &lt;BR /&gt;[ "${prtname}" = "Quit" ] &amp;amp;&amp;amp; exit 0 &lt;BR /&gt;&lt;BR /&gt;if test -n "${prtname}" &lt;BR /&gt;then &lt;BR /&gt;if test "${prtname}" = "ALL" &lt;BR /&gt;then &lt;BR /&gt;prtlist="${fulllist}" &lt;BR /&gt;else &lt;BR /&gt;prtlist="${prtname}" &lt;BR /&gt;fi &lt;BR /&gt;&lt;BR /&gt;break &lt;BR /&gt;fi &lt;BR /&gt;done &lt;BR /&gt;&lt;BR /&gt;hpnpadmin ${prtlist} &lt;BR /&gt;} &lt;BR /&gt;&lt;BR /&gt;[ "${select_on}" = 'N' ] &amp;amp;&amp;amp; all_printers || single_printer &lt;BR /&gt;./jdpstatus[64]: single_printer:  not found&lt;BR /&gt;&lt;BR /&gt;# Main &lt;BR /&gt;if test ${#} -ne 0 &lt;BR /&gt;then &lt;BR /&gt;while getopts :s option &lt;BR /&gt;do &lt;BR /&gt;case ${option} in &lt;BR /&gt;s) select_on="Y";; &lt;BR /&gt;?) echo "Usage: ${0} [&amp;lt;-s&amp;gt;]" &lt;BR /&gt;exit 4 ;; &lt;BR /&gt;esac &lt;BR /&gt;done &lt;BR /&gt;fi &lt;BR /&gt;&lt;BR /&gt;exit 0 &lt;BR /&gt;mvitux01@/home/fgrosb01# &lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 30 Sep 2002 14:15:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/parameter-help-inside-script/m-p/2815970#M828554</guid>
      <dc:creator>fg_1</dc:creator>
      <dc:date>2002-09-30T14:15:28Z</dc:date>
    </item>
    <item>
      <title>Re: Parameter help inside script.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/parameter-help-inside-script/m-p/2815971#M828555</link>
      <description>Hi Frank,&lt;BR /&gt;&lt;BR /&gt;"single_printer" is incorrect, it should be "select_printer".&lt;BR /&gt;&lt;BR /&gt;I didn't actually mean to move the statement, just initialise select_on to "N", or whatever you need it to be at the beginning of the script.&lt;BR /&gt;&lt;BR /&gt;Rgds, Robin</description>
      <pubDate>Mon, 30 Sep 2002 14:18:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/parameter-help-inside-script/m-p/2815971#M828555</guid>
      <dc:creator>Robin Wakefield</dc:creator>
      <dc:date>2002-09-30T14:18:28Z</dc:date>
    </item>
    <item>
      <title>Re: Parameter help inside script.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/parameter-help-inside-script/m-p/2815972#M828556</link>
      <description>I don't see "single_printer" defined.&lt;BR /&gt;&lt;BR /&gt;-- Rod Hills</description>
      <pubDate>Mon, 30 Sep 2002 14:18:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/parameter-help-inside-script/m-p/2815972#M828556</guid>
      <dc:creator>Rodney Hills</dc:creator>
      <dc:date>2002-09-30T14:18:48Z</dc:date>
    </item>
    <item>
      <title>Re: Parameter help inside script.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/parameter-help-inside-script/m-p/2815973#M828557</link>
      <description>Ok guys&lt;BR /&gt;&lt;BR /&gt;Were extremely close, everything works with the exception of when you select #1) All &lt;BR /&gt;you get an error, (listed below). &lt;BR /&gt;&lt;BR /&gt;Each of the individual printer queue names work as needed, but I also have no need to have model.orig as a listed variable there but I can deal with that if I had to. the big thing here is the ALL option which should print the necessary info for #'s 4-6 in one listing.&lt;BR /&gt;&lt;BR /&gt;1) ALL&lt;BR /&gt;2) Quit&lt;BR /&gt;3) model.orig&lt;BR /&gt;4) mv2itd05&lt;BR /&gt;5) mv2itd07&lt;BR /&gt;6) mv2itd08&lt;BR /&gt;Please select desired printer: 1&lt;BR /&gt;model.orig: Unknown printer&lt;BR /&gt;: Error sending SNMP request.&lt;BR /&gt;*** Can't find the session! &lt;BR /&gt;mvitux01@/home/fgrosb01# &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;mvitux01@/home/fgrosb01# more jdpstatus&lt;BR /&gt;#! /usr/bin/ksh &lt;BR /&gt;&lt;BR /&gt;# This script is utilized to gather printer information on all print queue's installed&lt;BR /&gt;# on a system using the hpnpadmin command.&lt;BR /&gt;&lt;BR /&gt;# Environmental section&lt;BR /&gt;&lt;BR /&gt;BASEDIR=/home/fgrosb01&lt;BR /&gt;DATE=`date +%m/%d/%Y`&lt;BR /&gt;YDATE=`TZ=CST+24 date +%m/%d/%Y`&lt;BR /&gt;SCRIPT_EXECUTION_TIME=$(date +'%H:%M:%S')&lt;BR /&gt;SCRIPT_REVISION="HPUX-b.11.00.01"&lt;BR /&gt;SCRIPT_HPUX_VERSION=$(uname -r)&lt;BR /&gt;SCRIPT_SYSTEM=$(uname - n)&lt;BR /&gt;SCRIPT_USER=$(whoami)&lt;BR /&gt;SCRIPT_EXECUTION_TIME=$(date +'%Y/%m/%d/%H:%M:%S')&lt;BR /&gt;&lt;BR /&gt;echo $SCRIPT_SYSTEM \(Version $SCRIPT_REVISION\) $SCRIPT_EXECUTION_TIME&lt;BR /&gt;echo _____________________________________________________________________&lt;BR /&gt;echo&lt;BR /&gt;if [ ${SCRIPT_USER} != "root" ] ; then&lt;BR /&gt;   echo&lt;BR /&gt;      echo "This program must be executed utilizing the root logon id only"&lt;BR /&gt;      echo&lt;BR /&gt;      return 501&lt;BR /&gt;      fi&lt;BR /&gt;      echo _______________________________________________________________________&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;# Gather information about printer queue's on system.&lt;BR /&gt;################################################################################## &lt;BR /&gt;# Defaults &lt;BR /&gt;&lt;BR /&gt;PS3="Please select desired printer: " &lt;BR /&gt;fulllist="`cd /etc/lp/interface;ls`" &lt;BR /&gt;&lt;BR /&gt;all_printers () &lt;BR /&gt;{ &lt;BR /&gt;hpnpadmin -iqS ${fulllist}&lt;BR /&gt;} &lt;BR /&gt;&lt;BR /&gt;single_printer () &lt;BR /&gt;{ &lt;BR /&gt;select prtname in ALL Quit ${fulllist} &lt;BR /&gt;do &lt;BR /&gt;[ "${prtname}" = "Quit" ] &amp;amp;&amp;amp; exit 0 &lt;BR /&gt;&lt;BR /&gt;if test -n "${prtname}" &lt;BR /&gt;then &lt;BR /&gt;if test "${prtname}" = "ALL" &lt;BR /&gt;then &lt;BR /&gt;prtlist="${fulllist}" &lt;BR /&gt;else &lt;BR /&gt;prtlist="${prtname}" &lt;BR /&gt;fi &lt;BR /&gt;&lt;BR /&gt;break &lt;BR /&gt;fi &lt;BR /&gt;done &lt;BR /&gt;&lt;BR /&gt;hpnpadmin -iqS ${prtlist} &lt;BR /&gt;} &lt;BR /&gt;&lt;BR /&gt;[ "${select_on}" = 'N' ] &amp;amp;&amp;amp; all_printers || single_printer &lt;BR /&gt;&lt;BR /&gt;# Main &lt;BR /&gt;if test ${#} -ne 0 &lt;BR /&gt;then &lt;BR /&gt;while getopts :s option &lt;BR /&gt;do &lt;BR /&gt;case ${option} in &lt;BR /&gt;s) select_on="Y";; &lt;BR /&gt;?) echo "Usage: ${0} [&amp;lt;-s&amp;gt;]" &lt;BR /&gt;exit 4 ;; &lt;BR /&gt;esac &lt;BR /&gt;done &lt;BR /&gt;fi &lt;BR /&gt;&lt;BR /&gt;exit 0 &lt;BR /&gt;mvitux01@/home/fgrosb01# &lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 30 Sep 2002 15:18:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/parameter-help-inside-script/m-p/2815973#M828557</guid>
      <dc:creator>fg_1</dc:creator>
      <dc:date>2002-09-30T15:18:01Z</dc:date>
    </item>
    <item>
      <title>Re: Parameter help inside script.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/parameter-help-inside-script/m-p/2815974#M828558</link>
      <description>In setting "fulllist", you do a&lt;BR /&gt;&lt;BR /&gt;fulllist="`cd /etc/lp/interface;ls`" &lt;BR /&gt;&lt;BR /&gt;Did you know a directory called "model.orig" exists in that folder? This could cause an unknown printer error.&lt;BR /&gt;&lt;BR /&gt;I have found when debugging a script to put some echo commands to display key variables at key points. That way I don't "assume" the values are what I expect.&lt;BR /&gt;&lt;BR /&gt;Good Luck&lt;BR /&gt;&lt;BR /&gt;-- Rod Hills</description>
      <pubDate>Mon, 30 Sep 2002 15:53:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/parameter-help-inside-script/m-p/2815974#M828558</guid>
      <dc:creator>Rodney Hills</dc:creator>
      <dc:date>2002-09-30T15:53:13Z</dc:date>
    </item>
    <item>
      <title>Re: Parameter help inside script.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/parameter-help-inside-script/m-p/2815975#M828559</link>
      <description>Ok&lt;BR /&gt;&lt;BR /&gt;Once I changed the FULLIST directory to:&lt;BR /&gt;&lt;BR /&gt;fulllist="`cd /etc/lp/interface/model.orig;ls`"&lt;BR /&gt;&lt;BR /&gt;The script will now return a value for the ALL function, but it is only the 1st printer that is listed, not all of the printers in the directory. As in the above post by me, option 1=all, option 4-6 are the individual printers, now when you select option 1, it only returns the info on the 1st printer.&lt;BR /&gt;&lt;BR /&gt;Any ideas.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 30 Sep 2002 16:24:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/parameter-help-inside-script/m-p/2815975#M828559</guid>
      <dc:creator>fg_1</dc:creator>
      <dc:date>2002-09-30T16:24:25Z</dc:date>
    </item>
    <item>
      <title>Re: Parameter help inside script.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/parameter-help-inside-script/m-p/2815976#M828560</link>
      <description>I think you are assuming that hpnpadmin can take more than 1 printer on the command line.&lt;BR /&gt;&lt;BR /&gt;If you were to look at the man page for hpnpadmin, you would find it only allows one printer.&lt;BR /&gt;&lt;BR /&gt;To work around, do the following&lt;BR /&gt;echo ${prtlist} | xargs -n1 hpnpadmin&lt;BR /&gt;&lt;BR /&gt;This will run hpnpadmin once for each printer.&lt;BR /&gt;&lt;BR /&gt;Another debugging hint-&lt;BR /&gt;If you have a command you are unfamiliar with, try running it directly to see the results, instead of "assuming" the command works the way you think it should.&lt;BR /&gt;&lt;BR /&gt;HTH&lt;BR /&gt;&lt;BR /&gt;-- Rod Hills</description>
      <pubDate>Mon, 30 Sep 2002 16:59:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/parameter-help-inside-script/m-p/2815976#M828560</guid>
      <dc:creator>Rodney Hills</dc:creator>
      <dc:date>2002-09-30T16:59:22Z</dc:date>
    </item>
    <item>
      <title>Re: Parameter help inside script.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/parameter-help-inside-script/m-p/2815977#M828561</link>
      <description>All&lt;BR /&gt;&lt;BR /&gt;YOU GUYS ARE THE TOPS IN THE WORLD. This is a working copy of the script. I wanted to post it here for everyone to see and use. &lt;BR /&gt;&lt;BR /&gt;Thanks to all of you who assisted on this.&lt;BR /&gt;&lt;BR /&gt;THIS IS THE BEST FORUM AROUND.&lt;BR /&gt;&lt;BR /&gt;God Bless.&lt;BR /&gt;&lt;BR /&gt;FG.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;mvitux01@/home/fgrosb01# more jdpstatus&lt;BR /&gt;#! /usr/bin/ksh &lt;BR /&gt;&lt;BR /&gt;# This script is utilized to gather printer information on all print queue's installed&lt;BR /&gt;# on a system using the hpnpadmin command.&lt;BR /&gt;&lt;BR /&gt;# Environmental section&lt;BR /&gt;&lt;BR /&gt;BASEDIR=/home/fgrosb01&lt;BR /&gt;DATE=`date +%m/%d/%Y`&lt;BR /&gt;YDATE=`TZ=CST+24 date +%m/%d/%Y`&lt;BR /&gt;SCRIPT_EXECUTION_TIME=$(date +'%H:%M:%S')&lt;BR /&gt;SCRIPT_REVISION="HPUX-b.11.00.01"&lt;BR /&gt;SCRIPT_HPUX_VERSION=$(uname -r)&lt;BR /&gt;SCRIPT_SYSTEM=$(uname - n)&lt;BR /&gt;SCRIPT_USER=$(whoami)&lt;BR /&gt;SCRIPT_EXECUTION_TIME=$(date +'%Y/%m/%d/%H:%M:%S')&lt;BR /&gt;&lt;BR /&gt;echo $SCRIPT_SYSTEM \(Version $SCRIPT_REVISION\) $SCRIPT_EXECUTION_TIME&lt;BR /&gt;echo _____________________________________________________________________&lt;BR /&gt;echo&lt;BR /&gt;if [ ${SCRIPT_USER} != "root" ] ; then&lt;BR /&gt;   echo&lt;BR /&gt;      echo "This program must be executed utilizing the root logon id only"&lt;BR /&gt;      echo&lt;BR /&gt;      return 501&lt;BR /&gt;      fi&lt;BR /&gt;      echo _______________________________________________________________________&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;# Gather information about printer queue's on system.&lt;BR /&gt;################################################################################## &lt;BR /&gt;# Defaults &lt;BR /&gt;&lt;BR /&gt;PS3="Please select desired printer: " &lt;BR /&gt;fulllist="`cd /etc/lp/interface/model.orig;ls`" &lt;BR /&gt;&lt;BR /&gt;single_printer () &lt;BR /&gt;{ &lt;BR /&gt;select prtname in ALL Quit ${fulllist} &lt;BR /&gt;do &lt;BR /&gt;[ "${prtname}" = "Quit" ] &amp;amp;&amp;amp; exit 0 &lt;BR /&gt;&lt;BR /&gt;if test -n "${prtname}" &lt;BR /&gt;then &lt;BR /&gt;if test "${prtname}" = "ALL" &lt;BR /&gt;then &lt;BR /&gt;prtlist="${fulllist}" &lt;BR /&gt;else &lt;BR /&gt;prtlist="${prtname}" &lt;BR /&gt;fi &lt;BR /&gt;break &lt;BR /&gt;fi &lt;BR /&gt;done &lt;BR /&gt;&lt;BR /&gt;echo "***********************************"&lt;BR /&gt;echo ${prtlist} | xargs -n1 hpnpadmin -aiqS&lt;BR /&gt;echo ""&lt;BR /&gt;echo "***********************************"&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;all_printers ()&lt;BR /&gt;{&lt;BR /&gt;echo "***********************************"&lt;BR /&gt;echo ${fulllist} | xargs -n1 hpnpadmin -aiqS&lt;BR /&gt;echo ""&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;# Main &lt;BR /&gt;if test ${#} -ne 0 &lt;BR /&gt;then &lt;BR /&gt;while getopts :s option &lt;BR /&gt;do &lt;BR /&gt;case ${option} in &lt;BR /&gt;s) select_on="Y";; &lt;BR /&gt;?) echo "Usage: ${0} [&amp;lt;-s&amp;gt;]" &lt;BR /&gt;exit 4 ;; &lt;BR /&gt;esac &lt;BR /&gt;done &lt;BR /&gt;fi &lt;BR /&gt;&lt;BR /&gt;[ "${select_on}" = 'N' ] &amp;amp;&amp;amp; all_printers || single_printer &lt;BR /&gt;exit 0 &lt;BR /&gt;mvitux01@/home/fgrosb01# &lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 30 Sep 2002 18:10:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/parameter-help-inside-script/m-p/2815977#M828561</guid>
      <dc:creator>fg_1</dc:creator>
      <dc:date>2002-09-30T18:10:08Z</dc:date>
    </item>
  </channel>
</rss>

