<?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: help with script in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/help-with-script/m-p/2583966#M856038</link>
    <description>Hi Sanman:&lt;BR /&gt;&lt;BR /&gt;I believe you want 'grep -i' and *not* 'grep -v' in your construction of the 'END' variable.&lt;BR /&gt;&lt;BR /&gt;BTW, Srhhdar, the syntax is POSIX's which is "preferred" over the tick yntax.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
    <pubDate>Mon, 24 Sep 2001 15:39:38 GMT</pubDate>
    <dc:creator>James R. Ferguson</dc:creator>
    <dc:date>2001-09-24T15:39:38Z</dc:date>
    <item>
      <title>help with script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-with-script/m-p/2583964#M856036</link>
      <description>Hello guys,&lt;BR /&gt;&lt;BR /&gt;This is just part of my script that I am working on right now. The issue here is when I ran this script, I am not getting what I'm asking for but this is somehow showing me a listing of everything in my directory. Can you please tell me what I could be doing wrong here. Let me know if you need additional info. &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Get the start time&lt;BR /&gt;&lt;BR /&gt; ssh $i "tail /var/opt/ignite/logs/makrec.log1 2&amp;gt; /dev/null |   grep 'Started' | tail -1" &amp;gt; $TMP_PAGE2 &lt;BR /&gt;&lt;BR /&gt; echo "&lt;HR width="50%" /&gt;" &amp;gt;&amp;gt; $TMP_PAGE2&lt;BR /&gt; echo $END&lt;BR /&gt;&lt;BR /&gt;# Get the end time - will also use later for COLOR selection&lt;BR /&gt;&lt;BR /&gt; END=$(ssh $i "tail -2 /var/opt/ignite/logs/makrec.log1 2&amp;gt; /dev/null |   grep -v -e 'Completed' -e 'makrec.log1'") &lt;BR /&gt;&lt;BR /&gt; echo $END&lt;BR /&gt;&lt;BR /&gt; echo "&lt;BR /&gt;" &amp;gt;&amp;gt; $TMP_PAGE2&lt;BR /&gt; echo "" &amp;gt;&amp;gt; $TMP_PAGE2&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 24 Sep 2001 15:22:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-with-script/m-p/2583964#M856036</guid>
      <dc:creator>Ragni Singh</dc:creator>
      <dc:date>2001-09-24T15:22:20Z</dc:date>
    </item>
    <item>
      <title>Re: help with script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-with-script/m-p/2583965#M856037</link>
      <description>Sanman,&lt;BR /&gt;&lt;BR /&gt;I couldn't quite understand this line&lt;BR /&gt;&lt;BR /&gt;END=$(ssh $i "tail -2 /var/opt/ignite/logs/makrec.log1 2&amp;gt; /dev/null | grep -v -e 'Completed' -e 'makrec.log1'") &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Shouldn't it be&lt;BR /&gt;&lt;BR /&gt;END=`ssh $i "tail.... " ` &lt;BR /&gt;&lt;BR /&gt;check the command substituation quotes "`".&lt;BR /&gt;&lt;BR /&gt;-Sri&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 24 Sep 2001 15:29:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-with-script/m-p/2583965#M856037</guid>
      <dc:creator>Sridhar Bhaskarla</dc:creator>
      <dc:date>2001-09-24T15:29:24Z</dc:date>
    </item>
    <item>
      <title>Re: help with script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-with-script/m-p/2583966#M856038</link>
      <description>Hi Sanman:&lt;BR /&gt;&lt;BR /&gt;I believe you want 'grep -i' and *not* 'grep -v' in your construction of the 'END' variable.&lt;BR /&gt;&lt;BR /&gt;BTW, Srhhdar, the syntax is POSIX's which is "preferred" over the tick yntax.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Mon, 24 Sep 2001 15:39:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-with-script/m-p/2583966#M856038</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2001-09-24T15:39:38Z</dc:date>
    </item>
    <item>
      <title>Re: help with script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-with-script/m-p/2583967#M856039</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;If you are looking for the completion time, you could do something like,&lt;BR /&gt;&lt;BR /&gt;END=$(ssh $i "tail -2 /var/opt/ignite/logs/makrec.log1 2&amp;gt; /dev/null | grep '^Completed'")&lt;BR /&gt;&lt;BR /&gt;Also in your first ssh line where you are redirecting the output to $TMP_PAGE2, you might want to use something like&lt;BR /&gt;ssh $i "grep 'Started' /var/opt/ignite/logs/makrec.log1 2&amp;gt; /dev/null | tail -1" &amp;gt; $TMP_PAGE2 &lt;BR /&gt;&lt;BR /&gt;(tail by default only shows the last 10 lines)&lt;BR /&gt;&lt;BR /&gt;-HTH&lt;BR /&gt;Ramesh</description>
      <pubDate>Mon, 24 Sep 2001 15:59:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-with-script/m-p/2583967#M856039</guid>
      <dc:creator>linuxfan</dc:creator>
      <dc:date>2001-09-24T15:59:24Z</dc:date>
    </item>
    <item>
      <title>Re: help with script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-with-script/m-p/2583968#M856040</link>
      <description>Ooops.. Just overlooked. Please discard my earlier messages.&lt;BR /&gt;&lt;BR /&gt;Yes. You need to replace -v with -i.&lt;BR /&gt;&lt;BR /&gt;The reason why you were getting the output of ls is because, your remsh command with grep -v would assign the string ***** to your variable 'END'.. So when you echo $END = $*****  which is equivalent to echo *, you will get the file listing.&lt;BR /&gt;&lt;BR /&gt;-Sri&lt;BR /&gt;</description>
      <pubDate>Mon, 24 Sep 2001 17:56:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-with-script/m-p/2583968#M856040</guid>
      <dc:creator>Sridhar Bhaskarla</dc:creator>
      <dc:date>2001-09-24T17:56:14Z</dc:date>
    </item>
    <item>
      <title>Re: help with script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-with-script/m-p/2583969#M856041</link>
      <description>Hi Sanman,&lt;BR /&gt;&lt;BR /&gt;just a tiny hint, probably nothing to do with your problem.&lt;BR /&gt;&lt;BR /&gt;When invoking a remote shell (applies to remsh as well as ssh) you need not quote the remote command because everything after the remote hostname is treated as a remote command and its arguments.&lt;BR /&gt;But you do have to be careful with any shell meta characters (such as your redirection of stderr).&lt;BR /&gt;If such meta characters in the remote command string aren't escaped they will be expanded by your local shell (from where you issue ssh).&lt;BR /&gt;This means that if you want to append other commands, or pipe into other commands, or execute a subshell etc on the remote system you have to prepend a '\' to every [|;&amp;amp;&amp;lt;&amp;gt;()].</description>
      <pubDate>Tue, 25 Sep 2001 07:43:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-with-script/m-p/2583969#M856041</guid>
      <dc:creator>Ralph Grothe</dc:creator>
      <dc:date>2001-09-25T07:43:45Z</dc:date>
    </item>
  </channel>
</rss>

