<?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 Script question in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/script-question/m-p/3244009#M174149</link>
    <description>My manager wanted me to modify our 'prt' script so that information from all the reports that are printed goes to a 'record' file.  That seems to be working fine but sometimes we get some reports that have headers that are much longer and have caused us problems.&lt;BR /&gt;I tried to make a change to the script to keep any file headers of a certian length are ignored.  With that change none of the header information is going into the 'record' file.  Any ideas as to what I am doing wrong?&lt;BR /&gt;I am attaching the script and I also highlighted the part that I am having problems with.&lt;BR /&gt;Thanks for the help.</description>
    <pubDate>Thu, 08 Apr 2004 13:13:46 GMT</pubDate>
    <dc:creator>Jeffrey F. Goldsmith</dc:creator>
    <dc:date>2004-04-08T13:13:46Z</dc:date>
    <item>
      <title>Script question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-question/m-p/3244009#M174149</link>
      <description>My manager wanted me to modify our 'prt' script so that information from all the reports that are printed goes to a 'record' file.  That seems to be working fine but sometimes we get some reports that have headers that are much longer and have caused us problems.&lt;BR /&gt;I tried to make a change to the script to keep any file headers of a certian length are ignored.  With that change none of the header information is going into the 'record' file.  Any ideas as to what I am doing wrong?&lt;BR /&gt;I am attaching the script and I also highlighted the part that I am having problems with.&lt;BR /&gt;Thanks for the help.</description>
      <pubDate>Thu, 08 Apr 2004 13:13:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-question/m-p/3244009#M174149</guid>
      <dc:creator>Jeffrey F. Goldsmith</dc:creator>
      <dc:date>2004-04-08T13:13:46Z</dc:date>
    </item>
    <item>
      <title>Re: Script question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-question/m-p/3244010#M174150</link>
      <description>Hi Jeff,&lt;BR /&gt;&lt;BR /&gt;you commented out 3 lines (around the rm -rf /tmpspool/.$$)? Is that the change you made?&lt;BR /&gt;&lt;BR /&gt;I see 2 other things:&lt;BR /&gt;1)&lt;BR /&gt;if [ "$12" = '' ]&lt;BR /&gt;then&lt;BR /&gt;     echo `date +%D-%X` $1 $2 $3 $4 $5 $6 $7 $8 &amp;gt;&amp;gt; /tmpspool/record&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;$12? Is there a $12 in the call to your script? Do a short test by creating a script that prints $12 and ${12}!&lt;BR /&gt;$12 equals $1 followed by the digit 2 I'm afraid. So indeed it's never equal to '' and nothing gets logged.&lt;BR /&gt;&lt;BR /&gt;2) There is a chmod command all alone on a line, without arguments.&lt;BR /&gt;&lt;BR /&gt;In ksh you can also define a variable with a fixed length (typeset -L40: left justified, leading blanks removed, 40 chars, padded on the right with blanks if necessary). Maybe that's of any help.&lt;BR /&gt;&lt;BR /&gt;JP</description>
      <pubDate>Thu, 08 Apr 2004 14:00:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-question/m-p/3244010#M174150</guid>
      <dc:creator>Jeroen Peereboom</dc:creator>
      <dc:date>2004-04-08T14:00:20Z</dc:date>
    </item>
    <item>
      <title>Re: Script question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-question/m-p/3244011#M174151</link>
      <description>Hi, where are the part you have trouble?, i can't find it.&lt;BR /&gt;&lt;BR /&gt;Frank.</description>
      <pubDate>Thu, 08 Apr 2004 14:05:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-question/m-p/3244011#M174151</guid>
      <dc:creator>Francisco J. Soler</dc:creator>
      <dc:date>2004-04-08T14:05:49Z</dc:date>
    </item>
    <item>
      <title>Re: Script question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-question/m-p/3244012#M174152</link>
      <description>The part that I was having problems with was the following:&lt;BR /&gt;&lt;BR /&gt;if [ "$12" = '' ]&lt;BR /&gt;then&lt;BR /&gt;     echo `date +%D-%X` $1 $2 $3 $4 $5 $6 $7 $8 &amp;gt;&amp;gt; /tmpspool/record&lt;BR /&gt;     fi&lt;BR /&gt;&lt;BR /&gt;With your help I was able to figure out what needed to be fixed.  This is what it now looks like and it seems to be working fine:&lt;BR /&gt;&lt;BR /&gt;if [ "${12}" = '' ]&lt;BR /&gt;then&lt;BR /&gt;     echo `date +%D-%X` $1 $2 $3 $4 $5 $6 $7 $8 &amp;gt;&amp;gt; /tmpspool/record&lt;BR /&gt;     fi&lt;BR /&gt;&lt;BR /&gt;I had to put brakets around the 12.  Thanks for the help.</description>
      <pubDate>Thu, 08 Apr 2004 14:24:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-question/m-p/3244012#M174152</guid>
      <dc:creator>Jeffrey F. Goldsmith</dc:creator>
      <dc:date>2004-04-08T14:24:02Z</dc:date>
    </item>
  </channel>
</rss>

