<?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: Shell script in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2990751#M124276</link>
    <description>Add 1 line before you script;&lt;BR /&gt;&lt;BR /&gt;IFS=""&lt;BR /&gt;&lt;BR /&gt;Then it works.&lt;BR /&gt;&lt;BR /&gt;IFS=""&lt;BR /&gt;for entry in $(cat /tmp/sa)&lt;BR /&gt;do&lt;BR /&gt;echo $entry&lt;BR /&gt;done&lt;BR /&gt;</description>
    <pubDate>Fri, 06 Jun 2003 07:22:36 GMT</pubDate>
    <dc:creator>Stefan Farrelly</dc:creator>
    <dc:date>2003-06-06T07:22:36Z</dc:date>
    <item>
      <title>Shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2990750#M124275</link>
      <description>I am writing a shell script in which I am using as for loop&lt;BR /&gt;as below&lt;BR /&gt;&lt;BR /&gt;for entry in `cat /tmp/sa`&lt;BR /&gt;do&lt;BR /&gt;echo $entry&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;The content of file /tmp/sa is&lt;BR /&gt;08:06:03 10 20 10 20&lt;BR /&gt;09:07:03 20 30 20 20&lt;BR /&gt;10:07:03 20 10 20 10&lt;BR /&gt;&lt;BR /&gt;However when I do echo $entry in script&lt;BR /&gt;it is showing single field 08:06:03 instead&lt;BR /&gt;of entire line &lt;BR /&gt;08:06:03 10 20 10 20&lt;BR /&gt;&lt;BR /&gt;Is there any Ouput field separator ins shell&lt;BR /&gt;so that my for loop variable fetches&lt;BR /&gt;a line&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;Nitin</description>
      <pubDate>Fri, 06 Jun 2003 07:18:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2990750#M124275</guid>
      <dc:creator>Fenil Manek_4</dc:creator>
      <dc:date>2003-06-06T07:18:46Z</dc:date>
    </item>
    <item>
      <title>Re: Shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2990751#M124276</link>
      <description>Add 1 line before you script;&lt;BR /&gt;&lt;BR /&gt;IFS=""&lt;BR /&gt;&lt;BR /&gt;Then it works.&lt;BR /&gt;&lt;BR /&gt;IFS=""&lt;BR /&gt;for entry in $(cat /tmp/sa)&lt;BR /&gt;do&lt;BR /&gt;echo $entry&lt;BR /&gt;done&lt;BR /&gt;</description>
      <pubDate>Fri, 06 Jun 2003 07:22:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2990751#M124276</guid>
      <dc:creator>Stefan Farrelly</dc:creator>
      <dc:date>2003-06-06T07:22:36Z</dc:date>
    </item>
    <item>
      <title>Re: Shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2990752#M124277</link>
      <description>Hi,&lt;BR /&gt;you can change you script like this&lt;BR /&gt;&lt;BR /&gt;while read TEXT&lt;BR /&gt;do&lt;BR /&gt;echo $TEXT&lt;BR /&gt;done &amp;lt;&amp;lt; /tmp/sa&lt;BR /&gt;&lt;BR /&gt;HTH,&lt;BR /&gt; Massimo&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 06 Jun 2003 07:23:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2990752#M124277</guid>
      <dc:creator>Massimo Bianchi</dc:creator>
      <dc:date>2003-06-06T07:23:08Z</dc:date>
    </item>
    <item>
      <title>Re: Shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2990753#M124278</link>
      <description>Hi,&lt;BR /&gt;  Easiest way is&lt;BR /&gt;-------------&lt;BR /&gt;cat /tmp/sa|while read line&lt;BR /&gt;do&lt;BR /&gt;echo $line&lt;BR /&gt;sleep 3&lt;BR /&gt;done&lt;BR /&gt;----------------&lt;BR /&gt;&lt;BR /&gt;HTH&lt;BR /&gt;&lt;BR /&gt;-tamil&lt;BR /&gt;</description>
      <pubDate>Fri, 06 Jun 2003 07:25:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2990753#M124278</guid>
      <dc:creator>V.Tamilvanan</dc:creator>
      <dc:date>2003-06-06T07:25:16Z</dc:date>
    </item>
    <item>
      <title>Re: Shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2990754#M124279</link>
      <description>Hi,&lt;BR /&gt;in order to get all arguments from the line, you need to use quotes, e.g.:&lt;BR /&gt;&lt;BR /&gt;for entry in "`cat /tmp/sa`" &lt;BR /&gt;do &lt;BR /&gt;echo "$entry" &lt;BR /&gt;done &lt;BR /&gt;&lt;BR /&gt;a better looking notation with same effect:&lt;BR /&gt;for entry in "$(cat ./infile)"&lt;BR /&gt;&lt;BR /&gt;regards,&lt;BR /&gt;John K.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 06 Jun 2003 08:44:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2990754#M124279</guid>
      <dc:creator>john korterman</dc:creator>
      <dc:date>2003-06-06T08:44:24Z</dc:date>
    </item>
    <item>
      <title>Re: Shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2990755#M124280</link>
      <description>hi,&lt;BR /&gt;&lt;BR /&gt;while read STR&lt;BR /&gt;do&lt;BR /&gt;echo $STR&lt;BR /&gt;done &amp;lt; /tmp/sa&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Regards</description>
      <pubDate>Fri, 06 Jun 2003 08:58:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2990755#M124280</guid>
      <dc:creator>V. V. Ravi Kumar_1</dc:creator>
      <dc:date>2003-06-06T08:58:43Z</dc:date>
    </item>
    <item>
      <title>Re: Shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2990756#M124281</link>
      <description>you could do it like this:&lt;BR /&gt;&lt;BR /&gt;cat file |&lt;BR /&gt;while read line&lt;BR /&gt;do&lt;BR /&gt;echo $line&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;you could also do it like this if you wanted only specific fields:&lt;BR /&gt;&lt;BR /&gt;cat file | &lt;BR /&gt;whle read a b c d e&lt;BR /&gt;do&lt;BR /&gt;echo $a $b $e&lt;BR /&gt;done</description>
      <pubDate>Fri, 06 Jun 2003 10:13:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2990756#M124281</guid>
      <dc:creator>John Meissner</dc:creator>
      <dc:date>2003-06-06T10:13:45Z</dc:date>
    </item>
  </channel>
</rss>

