<?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: Remote Command To Check File in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/remote-command-to-check-file/m-p/5228424#M679640</link>
    <description>JRF,&lt;BR /&gt;&lt;BR /&gt;Brilliant, thanks for that. Exactly what we need.....&lt;BR /&gt;&lt;BR /&gt;Andy</description>
    <pubDate>Mon, 08 Mar 2010 11:12:21 GMT</pubDate>
    <dc:creator>Acxiom Unix Team</dc:creator>
    <dc:date>2010-03-08T11:12:21Z</dc:date>
    <item>
      <title>Remote Command To Check File</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/remote-command-to-check-file/m-p/5228422#M679638</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I am trying to work out some script to check for the existence of a file on a remote box. This will be run as a pre-exec job by some maestro jobs. And depending on the results, depends if the job then submits the main job or not.&lt;BR /&gt;&lt;BR /&gt;I need to get 3 results though;&lt;BR /&gt;&lt;BR /&gt;1) Cannot i firstly remsh to the server?&lt;BR /&gt;2) If i can, is the file there? Yes or No?&lt;BR /&gt;&lt;BR /&gt;I have attached a copy of what i thought might work but i seem to hit some problems. I have sent all output to a text file so i can see what i am getting back. &lt;BR /&gt;&lt;BR /&gt;When the file exists i get the response to say it has found it. However, if i change the name of the file its looking for, i still get the same response saying it has found it.&lt;BR /&gt;&lt;BR /&gt;So if anyone has any good tips/tricks on how i can get this script to work that would be great.&lt;BR /&gt;&lt;BR /&gt;Thanks</description>
      <pubDate>Fri, 05 Mar 2010 17:07:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/remote-command-to-check-file/m-p/5228422#M679638</guid>
      <dc:creator>Acxiom Unix Team</dc:creator>
      <dc:date>2010-03-05T17:07:51Z</dc:date>
    </item>
    <item>
      <title>Re: Remote Command To Check File</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/remote-command-to-check-file/m-p/5228423#M679639</link>
      <description>Hi Andrew:&lt;BR /&gt;&lt;BR /&gt;You could do something as simple as:&lt;BR /&gt;&lt;BR /&gt;# cat ./queryit&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;typeset HOST=$1&lt;BR /&gt;typeset FILE=$2&lt;BR /&gt;remsh ${HOST} -n "[ -f ${FILE} ] &amp;amp;&amp;amp; echo ${FILE} found || echo ${FILE} missing" 2&amp;gt;/dev/null&lt;BR /&gt;[ $? = 0 ] || echo "${HOST} wasn't available"&lt;BR /&gt;exit&lt;BR /&gt;&lt;BR /&gt;...run as :&lt;BR /&gt;&lt;BR /&gt;# ./queryit mybox myfile&lt;BR /&gt;&lt;BR /&gt;Notice that I used 'remsh' per your request.  A more secure way would be to substitute 'ssh' for 'remsh' and thus use a secure shell connection.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Fri, 05 Mar 2010 17:26:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/remote-command-to-check-file/m-p/5228423#M679639</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2010-03-05T17:26:34Z</dc:date>
    </item>
    <item>
      <title>Re: Remote Command To Check File</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/remote-command-to-check-file/m-p/5228424#M679640</link>
      <description>JRF,&lt;BR /&gt;&lt;BR /&gt;Brilliant, thanks for that. Exactly what we need.....&lt;BR /&gt;&lt;BR /&gt;Andy</description>
      <pubDate>Mon, 08 Mar 2010 11:12:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/remote-command-to-check-file/m-p/5228424#M679640</guid>
      <dc:creator>Acxiom Unix Team</dc:creator>
      <dc:date>2010-03-08T11:12:21Z</dc:date>
    </item>
  </channel>
</rss>

