<?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: variable integer not passed in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/variable-integer-not-passed/m-p/3693327#M247641</link>
    <description>I tried your script snippet as given, with the addition that I defined Work_file prior to using it, - and I get similar, not identical error.&lt;BR /&gt;&lt;BR /&gt;But, if I change it to a posix shell script, it works. Change first line to #!/bin/sh&lt;BR /&gt;&lt;BR /&gt;Not sure yet why sh likes it but ksh doesn't, ... still tinkering.&lt;BR /&gt;&lt;BR /&gt; - John</description>
    <pubDate>Fri, 16 Dec 2005 18:43:56 GMT</pubDate>
    <dc:creator>John Kittel</dc:creator>
    <dc:date>2005-12-16T18:43:56Z</dc:date>
    <item>
      <title>variable integer not passed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/variable-integer-not-passed/m-p/3693319#M247633</link>
      <description>Why doesn't the following script work?&lt;BR /&gt;#!/bin/ksh&lt;BR /&gt;integer Line=0&lt;BR /&gt;Lines=$(cat /root/.sh_history | wc | awk '{print $1}' )&lt;BR /&gt;print "total lines to read in History file is $Lines"&lt;BR /&gt;history -${Lines} &amp;gt; ${Work_file}&lt;BR /&gt;&lt;BR /&gt;Output is....&lt;BR /&gt;total lines to read in History file is 268&lt;BR /&gt;&lt;BR /&gt;./Audit_root_Daily[90]: 1^Ill: syntax error</description>
      <pubDate>Fri, 16 Dec 2005 16:43:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/variable-integer-not-passed/m-p/3693319#M247633</guid>
      <dc:creator>Matthew Bialczak</dc:creator>
      <dc:date>2005-12-16T16:43:21Z</dc:date>
    </item>
    <item>
      <title>Re: variable integer not passed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/variable-integer-not-passed/m-p/3693320#M247634</link>
      <description>Is variable Work_file defined?&lt;BR /&gt;&lt;BR /&gt;The command looks ok otherwise.&lt;BR /&gt;  &lt;BR /&gt;Rod Hills</description>
      <pubDate>Fri, 16 Dec 2005 16:55:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/variable-integer-not-passed/m-p/3693320#M247634</guid>
      <dc:creator>Rodney Hills</dc:creator>
      <dc:date>2005-12-16T16:55:57Z</dc:date>
    </item>
    <item>
      <title>Re: variable integer not passed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/variable-integer-not-passed/m-p/3693321#M247635</link>
      <description>yes, Work_file is defined..&lt;BR /&gt;&lt;BR /&gt;Work_file=/usr/local/work/${Prgrm_name}.wrk&lt;BR /&gt;&lt;BR /&gt;I clipped this from a 300 line routine that is failing me.  Originally it worked interactively but would never work batch.&lt;BR /&gt;The error has something unique to the variable Lines not passing a value to the history command.</description>
      <pubDate>Fri, 16 Dec 2005 17:00:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/variable-integer-not-passed/m-p/3693321#M247635</guid>
      <dc:creator>Matthew Bialczak</dc:creator>
      <dc:date>2005-12-16T17:00:42Z</dc:date>
    </item>
    <item>
      <title>Re: variable integer not passed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/variable-integer-not-passed/m-p/3693322#M247636</link>
      <description>"history" is an alias to "fc -l". Is it possible that aliases are not being setup when you run in batch? &lt;BR /&gt; &lt;BR /&gt;Rod Hills</description>
      <pubDate>Fri, 16 Dec 2005 17:30:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/variable-integer-not-passed/m-p/3693322#M247636</guid>
      <dc:creator>Rodney Hills</dc:creator>
      <dc:date>2005-12-16T17:30:12Z</dc:date>
    </item>
    <item>
      <title>Re: variable integer not passed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/variable-integer-not-passed/m-p/3693323#M247637</link>
      <description>Is it possible you have some control character in your script file on the history command? Try displaying with cat -v scriptfile to see.&lt;BR /&gt; &lt;BR /&gt;Rod Hills</description>
      <pubDate>Fri, 16 Dec 2005 17:53:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/variable-integer-not-passed/m-p/3693323#M247637</guid>
      <dc:creator>Rodney Hills</dc:creator>
      <dc:date>2005-12-16T17:53:23Z</dc:date>
    </item>
    <item>
      <title>Re: variable integer not passed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/variable-integer-not-passed/m-p/3693324#M247638</link>
      <description>I'm sure it is not the alias that is the problem.  With the current script, I get the following error interactively or batch...&lt;BR /&gt;&lt;BR /&gt;1^Ill: syntax error&lt;BR /&gt;&lt;BR /&gt;but if I hard code a number into the script that I know will work, all is fine.   I would like to use a huge number to cover the entire file, but history doesn't like that at all when run batch.  That's why I count the lines in the history file first, then use that variable to list out the file.   For instance, if I hard code 268 into the script, all will be fine.</description>
      <pubDate>Fri, 16 Dec 2005 17:57:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/variable-integer-not-passed/m-p/3693324#M247638</guid>
      <dc:creator>Matthew Bialczak</dc:creator>
      <dc:date>2005-12-16T17:57:02Z</dc:date>
    </item>
    <item>
      <title>Re: variable integer not passed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/variable-integer-not-passed/m-p/3693325#M247639</link>
      <description>No, cat -v displays no control characters.&lt;BR /&gt;&lt;BR /&gt;Have you tried this yourself? and does it work for you?  I have a feeling passing an option as a variable is not possible through scripting.</description>
      <pubDate>Fri, 16 Dec 2005 18:28:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/variable-integer-not-passed/m-p/3693325#M247639</guid>
      <dc:creator>Matthew Bialczak</dc:creator>
      <dc:date>2005-12-16T18:28:00Z</dc:date>
    </item>
    <item>
      <title>Re: variable integer not passed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/variable-integer-not-passed/m-p/3693326#M247640</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;The shell history file contains more than simple ASCII characters.  &lt;BR /&gt;&lt;BR /&gt;As an alternative to 'cat|wc|awk' try:&lt;BR /&gt;&lt;BR /&gt;# lines=$(awk 'END {print i};{i=1;while (getline) i++}' /root/.sh_history)&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;</description>
      <pubDate>Fri, 16 Dec 2005 18:38:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/variable-integer-not-passed/m-p/3693326#M247640</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2005-12-16T18:38:41Z</dc:date>
    </item>
    <item>
      <title>Re: variable integer not passed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/variable-integer-not-passed/m-p/3693327#M247641</link>
      <description>I tried your script snippet as given, with the addition that I defined Work_file prior to using it, - and I get similar, not identical error.&lt;BR /&gt;&lt;BR /&gt;But, if I change it to a posix shell script, it works. Change first line to #!/bin/sh&lt;BR /&gt;&lt;BR /&gt;Not sure yet why sh likes it but ksh doesn't, ... still tinkering.&lt;BR /&gt;&lt;BR /&gt; - John</description>
      <pubDate>Fri, 16 Dec 2005 18:43:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/variable-integer-not-passed/m-p/3693327#M247641</guid>
      <dc:creator>John Kittel</dc:creator>
      <dc:date>2005-12-16T18:43:56Z</dc:date>
    </item>
    <item>
      <title>Re: variable integer not passed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/variable-integer-not-passed/m-p/3693328#M247642</link>
      <description>Ok, it seems to work as a ksh script if my default shell is ksh, and it works as a posix script if my default shell is sh. I suspect your root default shell is also posix sh, so you should use posix script.&lt;BR /&gt;&lt;BR /&gt; - John</description>
      <pubDate>Fri, 16 Dec 2005 18:52:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/variable-integer-not-passed/m-p/3693328#M247642</guid>
      <dc:creator>John Kittel</dc:creator>
      <dc:date>2005-12-16T18:52:15Z</dc:date>
    </item>
    <item>
      <title>Re: variable integer not passed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/variable-integer-not-passed/m-p/3693329#M247643</link>
      <description>Matt-&lt;BR /&gt;I believe you should be looking around line ninety in the script.&lt;BR /&gt;./Audit_root_Daily[90]: 1^Ill: syntax error&lt;BR /&gt;Also, as you have found, large numbers are not acceptable.&lt;BR /&gt;I tested up to 127 as a value for Lines without issue.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;dl</description>
      <pubDate>Fri, 16 Dec 2005 19:21:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/variable-integer-not-passed/m-p/3693329#M247643</guid>
      <dc:creator>Dave La Mar</dc:creator>
      <dc:date>2005-12-16T19:21:33Z</dc:date>
    </item>
  </channel>
</rss>

