<?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: running a command without a prefix in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/running-a-command-without-a-prefix/m-p/5118923#M687055</link>
    <description>&amp;gt;the issue I have is when the script is run on the local host the ${PREFIX} variable is causing me issues:&lt;BR /&gt;&lt;BR /&gt;Why run on the "local" host?  You can ssh back to yourself and treat every system equally.&lt;BR /&gt;</description>
    <pubDate>Sat, 12 Jul 2008 03:21:18 GMT</pubDate>
    <dc:creator>Dennis Handly</dc:creator>
    <dc:date>2008-07-12T03:21:18Z</dc:date>
    <item>
      <title>running a command without a prefix</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/running-a-command-without-a-prefix/m-p/5118921#M687053</link>
      <description>Hello all,&lt;BR /&gt;&lt;BR /&gt;I have created a script that runs several functions to gather system information on a remote host ....&lt;BR /&gt;&lt;BR /&gt;I have to program the script to check for local host or remote host and if the server is a remote server then a prefix (ssh command) variable is set:&lt;BR /&gt;&lt;BR /&gt; for SERVER_NAME in ${SERVER_LIST}&lt;BR /&gt;        do&lt;BR /&gt;&lt;BR /&gt;                if [[ "${SERVER_NAME}" = "${HOSTNAME}" ]]&lt;BR /&gt;                then&lt;BR /&gt;&lt;BR /&gt;                        export PREFIX=""&lt;BR /&gt;                        echo "   - Generating report for       : ${SERVER_NAME}"&lt;BR /&gt;                        generate_report &amp;gt; ${REPORT_DIR}/${SERVER_NAME}.html&lt;BR /&gt;                else&lt;BR /&gt;&lt;BR /&gt;                        export PREFIX="ssh -l ${USER} ${SERVER_NAME}"&lt;BR /&gt;&lt;BR /&gt;                        echo "\n - Testing connectivity to server: ${SERVER_NAME}"&lt;BR /&gt;&lt;BR /&gt;                        if ping -c 1 -w 1 ${SERVER_NAME} &amp;gt;/dev/null 2&amp;gt;&amp;amp;1&lt;BR /&gt;                        then&lt;BR /&gt;                                echo "   - ping test ok for server     : ${SERVER_NAME}"&lt;BR /&gt;&lt;BR /&gt;                                ${PREFIX} 'echo' &amp;gt;/dev/null 2&amp;gt;&amp;amp;1&lt;BR /&gt;&lt;BR /&gt;                                if [ "$?" -eq "0" ]&lt;BR /&gt;                                then&lt;BR /&gt;                                        echo "   - rsh test ok for sever       : ${SERVER_NAME}"&lt;BR /&gt;                                        echo "   - Generating report for       : ${SERVER_NAME}"&lt;BR /&gt;                                        generate_report &amp;gt; ${REPORT_DIR}/${SERVER_NAME}.html&lt;BR /&gt;                                else&lt;BR /&gt;                                        echo "   - ERROR: Unable to ssh to     : ${SERVER_NAME}"&lt;BR /&gt;                                fi&lt;BR /&gt;                        else&lt;BR /&gt;                                echo "   - ERROR: Unable to ping       : ${SERVER_NAME}"&lt;BR /&gt;                        fi&lt;BR /&gt;                fi&lt;BR /&gt;        done&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;NOTE this="" script="" is="" programmed="" for="" aix=""&gt;&lt;BR /&gt;&lt;BR /&gt;the issue I have is when the script is run on the local host the ${PREFIX} variable is causing me issues:&lt;BR /&gt;&lt;BR /&gt;${PREFIX} 'if [ -f /usr/bin/lparstat ]&lt;BR /&gt;then&lt;BR /&gt;LANG=C uname -Ls | read junk partition_number partition_name&lt;BR /&gt;echo "Partition Number                           : ${partition_number}"&lt;BR /&gt;echo "Partition Name                             : ${partition_name}"&lt;BR /&gt;fi'&lt;BR /&gt;&lt;BR /&gt;its obvious that there is a problem running the commands with the '&amp;lt;script&amp;gt;' &lt;BR /&gt;&lt;BR /&gt;is there anyway around this otherwise I will have to create another script to be run if the server is the local host.&lt;BR /&gt;&lt;BR /&gt;Thanks in advance and I hope this isnt too confusing.&lt;BR /&gt;&lt;BR /&gt;NB the example about is one of many functions run in the script.&lt;BR /&gt;&lt;BR /&gt;Chris.&lt;BR /&gt;&lt;/NOTE&gt;</description>
      <pubDate>Fri, 11 Jul 2008 13:56:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/running-a-command-without-a-prefix/m-p/5118921#M687053</guid>
      <dc:creator>lawrenzo_1</dc:creator>
      <dc:date>2008-07-11T13:56:52Z</dc:date>
    </item>
    <item>
      <title>Re: running a command without a prefix</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/running-a-command-without-a-prefix/m-p/5118922#M687054</link>
      <description>Hi Chris:&lt;BR /&gt;&lt;BR /&gt;If you are running on a local server, make the PREFIX variable value 'eval':&lt;BR /&gt;&lt;BR /&gt;# PREFIX=eval&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Fri, 11 Jul 2008 14:08:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/running-a-command-without-a-prefix/m-p/5118922#M687054</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2008-07-11T14:08:48Z</dc:date>
    </item>
    <item>
      <title>Re: running a command without a prefix</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/running-a-command-without-a-prefix/m-p/5118923#M687055</link>
      <description>&amp;gt;the issue I have is when the script is run on the local host the ${PREFIX} variable is causing me issues:&lt;BR /&gt;&lt;BR /&gt;Why run on the "local" host?  You can ssh back to yourself and treat every system equally.&lt;BR /&gt;</description>
      <pubDate>Sat, 12 Jul 2008 03:21:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/running-a-command-without-a-prefix/m-p/5118923#M687055</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2008-07-12T03:21:18Z</dc:date>
    </item>
    <item>
      <title>Re: running a command without a prefix</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/running-a-command-without-a-prefix/m-p/5118924#M687056</link>
      <description>eval works for me - thanks James.&lt;BR /&gt;&lt;BR /&gt;also thanks for the advise dennis as I thought it would be more logical to run commands locally on the local server.&lt;BR /&gt;&lt;BR /&gt;Chris.</description>
      <pubDate>Mon, 14 Jul 2008 08:23:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/running-a-command-without-a-prefix/m-p/5118924#M687056</guid>
      <dc:creator>lawrenzo_1</dc:creator>
      <dc:date>2008-07-14T08:23:45Z</dc:date>
    </item>
  </channel>
</rss>

