<?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: ksh help: to extract 2 words from every line in a file in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/ksh-help-to-extract-2-words-from-every-line-in-a-file/m-p/6533418#M496687</link>
    <description>&lt;P&gt;&lt;FONT face="Verdana"&gt;#cat run_find&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Verdana"&gt;exec &amp;lt;./output1&lt;BR /&gt;while read filer path; do&lt;BR /&gt;/example/find_details.pl -f $filer -v $path -a&lt;BR /&gt;sleep 60&lt;BR /&gt;done&lt;BR /&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Verdana"&gt;#cat output1&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Verdana"&gt;filer1 path1&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Verdana"&gt;filer2 path2&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Verdana"&gt;filer3 path3&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Verdana"&gt;...&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Verdana"&gt;filer180 path180&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Verdana"&gt;sorry for the confusion. Let me try it again. &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Verdana"&gt;The script "find_details.pl" is the perl script and it is to grab some volume&amp;nbsp;information from about 180 NAS storages. It takes about &amp;gt; 1 mins to complete. &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Verdana"&gt;The issue is the script "run_find" only execute the "find_details.pl"&amp;nbsp;on the first line of "output1", then exit out. &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Verdana"&gt;Hope I made myself clear this time. thank you very much for your patience.&lt;/FONT&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 09 Jul 2014 14:05:57 GMT</pubDate>
    <dc:creator>Hanry Zhou</dc:creator>
    <dc:date>2014-07-09T14:05:57Z</dc:date>
    <item>
      <title>ksh help: to extract 2 words from every line in a file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ksh-help-to-extract-2-words-from-every-line-in-a-file/m-p/6531590#M496680</link>
      <description>&lt;P&gt;I have a lot of lines in a file, and all&amp;nbsp;with following format:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;host_name:/vol/v1/v2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I only wanted to extract "host_name" and "v1" from every line in the file, then put these two words into a output file "out_file".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;then create a for loop to process these two words in "out_file".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;can anybody please help me out, it'd be appreciated very much&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Mon, 07 Jul 2014 21:15:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ksh-help-to-extract-2-words-from-every-line-in-a-file/m-p/6531590#M496680</guid>
      <dc:creator>Hanry Zhou</dc:creator>
      <dc:date>2014-07-07T21:15:19Z</dc:date>
    </item>
    <item>
      <title>Re: ksh help: to extract 2 words from every line in a file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ksh-help-to-extract-2-words-from-every-line-in-a-file/m-p/6531812#M496681</link>
      <description />
      <pubDate>Tue, 08 Jul 2014 03:25:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ksh-help-to-extract-2-words-from-every-line-in-a-file/m-p/6531812#M496681</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2014-07-08T03:25:34Z</dc:date>
    </item>
    <item>
      <title>Re: ksh help: to extract 2 words from every line in a file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ksh-help-to-extract-2-words-from-every-line-in-a-file/m-p/6531908#M496682</link>
      <description>&lt;P&gt;You could do:&lt;/P&gt;&lt;P&gt;IFS_save=$IFS # save&lt;BR /&gt;IFS=":/"&lt;BR /&gt;while read name dummy vol v1 v2; do&lt;BR /&gt;&amp;nbsp;&amp;nbsp; echo $name $v1&lt;BR /&gt;done &amp;lt; in_file &amp;gt; out_file&lt;BR /&gt;IFS=$IFS_IFS&amp;nbsp;&amp;nbsp; # restore&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;gt;then create a for loop to process these two words in "out_file".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You could process these in the above while.&amp;nbsp; Or you can create another while read with just the two fields.&lt;/P&gt;&lt;P&gt;No need to fiddle with IFS for this second while.&lt;/P&gt;</description>
      <pubDate>Tue, 08 Jul 2014 05:43:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ksh-help-to-extract-2-words-from-every-line-in-a-file/m-p/6531908#M496682</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2014-07-08T05:43:31Z</dc:date>
    </item>
    <item>
      <title>Re: ksh help: to extract 2 words from every line in a file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ksh-help-to-extract-2-words-from-every-line-in-a-file/m-p/6532644#M496683</link>
      <description>&lt;P&gt;Thank you all for the response. I have one follow-up.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;while read filer path; do&lt;BR /&gt;/bin/scripx.sh&amp;nbsp;-f $filer -v $path -a&lt;BR /&gt;done &amp;lt; ./output1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;with this script, why in the end only one instance of /bin/scriptx.sh got excuted? I wanted to run same number of times as the number of lines in "output1" file.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you again!&lt;/P&gt;</description>
      <pubDate>Tue, 08 Jul 2014 18:15:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ksh-help-to-extract-2-words-from-every-line-in-a-file/m-p/6532644#M496683</guid>
      <dc:creator>Hanry Zhou</dc:creator>
      <dc:date>2014-07-08T18:15:34Z</dc:date>
    </item>
    <item>
      <title>Re: ksh help: to extract 2 words from every line in a file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ksh-help-to-extract-2-words-from-every-line-in-a-file/m-p/6532662#M496684</link>
      <description />
      <pubDate>Tue, 08 Jul 2014 18:25:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ksh-help-to-extract-2-words-from-every-line-in-a-file/m-p/6532662#M496684</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2014-07-08T18:25:18Z</dc:date>
    </item>
    <item>
      <title>Re: ksh help: to extract 2 words from every line in a file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ksh-help-to-extract-2-words-from-every-line-in-a-file/m-p/6532702#M496685</link>
      <description>&lt;P&gt;First off, no, I did not put scriptx.sh under /bin, it is just an example. it is actually located somewhere else. the following script results in the same.&lt;/P&gt;&lt;P&gt;$ cat hv1.sh&lt;BR /&gt;#!/bin/sh&lt;BR /&gt;&lt;BR /&gt;exec &amp;lt;./output1&lt;BR /&gt;while read filer path; do&lt;BR /&gt;./hv2.sh -f $filer -v $path -a&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;The cause of it is because that in-house script scriptx.sh (or ./hv2.sh in your case) takes quite some time to finish. I even put sleep 60 in the loop. It is still the same. I used exec &amp;lt; ./output1, it doesn't help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;output1 file is consists of multiple lines which contains filer-n and path-n, as you guessed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Jul 2014 19:28:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ksh-help-to-extract-2-words-from-every-line-in-a-file/m-p/6532702#M496685</guid>
      <dc:creator>Hanry Zhou</dc:creator>
      <dc:date>2014-07-08T19:28:38Z</dc:date>
    </item>
    <item>
      <title>Re: ksh help: to extract 2 words from every line in a file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ksh-help-to-extract-2-words-from-every-line-in-a-file/m-p/6532814#M496686</link>
      <description />
      <pubDate>Tue, 08 Jul 2014 23:03:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ksh-help-to-extract-2-words-from-every-line-in-a-file/m-p/6532814#M496686</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2014-07-08T23:03:04Z</dc:date>
    </item>
    <item>
      <title>Re: ksh help: to extract 2 words from every line in a file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ksh-help-to-extract-2-words-from-every-line-in-a-file/m-p/6533418#M496687</link>
      <description>&lt;P&gt;&lt;FONT face="Verdana"&gt;#cat run_find&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Verdana"&gt;exec &amp;lt;./output1&lt;BR /&gt;while read filer path; do&lt;BR /&gt;/example/find_details.pl -f $filer -v $path -a&lt;BR /&gt;sleep 60&lt;BR /&gt;done&lt;BR /&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Verdana"&gt;#cat output1&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Verdana"&gt;filer1 path1&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Verdana"&gt;filer2 path2&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Verdana"&gt;filer3 path3&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Verdana"&gt;...&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Verdana"&gt;filer180 path180&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Verdana"&gt;sorry for the confusion. Let me try it again. &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Verdana"&gt;The script "find_details.pl" is the perl script and it is to grab some volume&amp;nbsp;information from about 180 NAS storages. It takes about &amp;gt; 1 mins to complete. &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Verdana"&gt;The issue is the script "run_find" only execute the "find_details.pl"&amp;nbsp;on the first line of "output1", then exit out. &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Verdana"&gt;Hope I made myself clear this time. thank you very much for your patience.&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Jul 2014 14:05:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ksh-help-to-extract-2-words-from-every-line-in-a-file/m-p/6533418#M496687</guid>
      <dc:creator>Hanry Zhou</dc:creator>
      <dc:date>2014-07-09T14:05:57Z</dc:date>
    </item>
    <item>
      <title>Re: ksh help: to extract 2 words from every line in a file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ksh-help-to-extract-2-words-from-every-line-in-a-file/m-p/6533428#M496688</link>
      <description>&lt;P&gt;.../scripx.sh&amp;nbsp;-f $filer -v $path -a&lt;BR /&gt;&amp;gt;why in the end only one instance of .../scriptx.sh got executed?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If your evil scriptx is also reading stdin, you'll lose input.&amp;nbsp; You can fix this by:&lt;/P&gt;&lt;P&gt;.../scripx.sh&amp;nbsp;-f $filer -v $path -a &amp;lt; /dev/null&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Typically examples of this failing is use of telnet, ssh, remsh (without -n), etc.&amp;nbsp; Or scummy C shell scripts.&lt;/P&gt;&lt;P&gt;&lt;A target="_blank" href="http://h30499.www3.hp.com/t5/Languages-and-Scripting/telnet-script-while-read/m-p/5824797"&gt;http://h30499.www3.hp.com/t5/Languages-and-Scripting/telnet-script-while-read/m-p/5824797&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Jul 2014 14:15:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ksh-help-to-extract-2-words-from-every-line-in-a-file/m-p/6533428#M496688</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2014-07-09T14:15:10Z</dc:date>
    </item>
    <item>
      <title>Re: ksh help: to extract 2 words from every line in a file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ksh-help-to-extract-2-words-from-every-line-in-a-file/m-p/6534524#M496689</link>
      <description>&lt;P&gt;This is the answer I am looking for. Thank you !&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jul 2014 12:34:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ksh-help-to-extract-2-words-from-every-line-in-a-file/m-p/6534524#M496689</guid>
      <dc:creator>Hanry Zhou</dc:creator>
      <dc:date>2014-07-10T12:34:15Z</dc:date>
    </item>
    <item>
      <title>Re: ksh help: to extract 2 words from every line in a file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ksh-help-to-extract-2-words-from-every-line-in-a-file/m-p/6535410#M496690</link>
      <description>&lt;P&gt;&amp;gt;This is the answer I am looking for. Thank you !&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you're happy with the the answers given, please assign kudos by clicking in the kudos stars.&lt;/P&gt;</description>
      <pubDate>Fri, 11 Jul 2014 10:22:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ksh-help-to-extract-2-words-from-every-line-in-a-file/m-p/6535410#M496690</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2014-07-11T10:22:51Z</dc:date>
    </item>
  </channel>
</rss>

