<?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: Reading lines in a loop in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/reading-lines-in-a-loop/m-p/2789004#M834052</link>
    <description>Look like "\" is not working in this message area either&lt;BR /&gt;&lt;BR /&gt;It suppose to be&lt;BR /&gt; B132  "\"&lt;BR /&gt;(alderon.vdgc.com,-,) (alderon,-,) "\"&lt;BR /&gt;(babafett.vdgc.com,-,) (babafett,-,) "\"&lt;BR /&gt;(c3po.vdgc.com,-,) (c3po,-,) "\"&lt;BR /&gt;droid.vdgc.com,-,) (droid,-,) "\"&lt;BR /&gt;&lt;BR /&gt;And so on...&lt;BR /&gt;So  third try with double quote around my \\.&lt;BR /&gt;&lt;BR /&gt;Sachin&lt;BR /&gt;</description>
    <pubDate>Mon, 19 Aug 2002 16:26:47 GMT</pubDate>
    <dc:creator>Sachin Patel</dc:creator>
    <dc:date>2002-08-19T16:26:47Z</dc:date>
    <item>
      <title>Reading lines in a loop</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/reading-lines-in-a-loop/m-p/2788997#M834045</link>
      <description>HI&lt;BR /&gt;&lt;BR /&gt;I am trying to read line by line in for loop&lt;BR /&gt;&lt;BR /&gt;Here is my section of netgroup file which has \ at the end&lt;BR /&gt;&lt;BR /&gt;B132       (alderon.vdgc.com,-,)   (alderon,-,)                    (babafett.vdgc.com,-,)  (babafett,-,)                   (c3po.vdgc.com,-,)      (c3po,-,)                       (chewie.vdgc.com,-,)    (chewie,-,)                     (droid.vdgc.com,-,)     (droid,-,)                      (dthstar1.vdgc.com,-,)  (dthstar1,-,)                   (endor.vdgc.com,-,)     (endor,-,)      &lt;BR /&gt;&lt;BR /&gt;while read line&lt;BR /&gt;do &lt;BR /&gt;   echo "$line"&lt;BR /&gt;done &amp;lt; file_name&lt;BR /&gt;&lt;BR /&gt;It will gives me all line without \ at the end.&lt;BR /&gt;&lt;BR /&gt;How can I solve this?&lt;BR /&gt;&lt;BR /&gt;Sachin&lt;BR /&gt;</description>
      <pubDate>Mon, 19 Aug 2002 15:45:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/reading-lines-in-a-loop/m-p/2788997#M834045</guid>
      <dc:creator>Sachin Patel</dc:creator>
      <dc:date>2002-08-19T15:45:15Z</dc:date>
    </item>
    <item>
      <title>Re: Reading lines in a loop</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/reading-lines-in-a-loop/m-p/2788998#M834046</link>
      <description>Since \ is used for special characters within a shell command line, I would say either strip the \ or add another to the end of the line.&lt;BR /&gt;\\ will return a single \.&lt;BR /&gt;&lt;BR /&gt;-- Rod Hills</description>
      <pubDate>Mon, 19 Aug 2002 15:47:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/reading-lines-in-a-loop/m-p/2788998#M834046</guid>
      <dc:creator>Rodney Hills</dc:creator>
      <dc:date>2002-08-19T15:47:17Z</dc:date>
    </item>
    <item>
      <title>Re: Reading lines in a loop</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/reading-lines-in-a-loop/m-p/2788999#M834047</link>
      <description>Not answering your question but just wanted to quickly point out (you may know this already) that you can make the "netgroup" file looks nicer. For example ..&lt;BR /&gt;B132(alderon.vdgc.com,-,) (alderon,-,)(babafett.vdgc.com,-,) (babafett,-,).......&lt;BR /&gt;endor.vdgc.com,-,) (endor,-,)&lt;BR /&gt;&lt;BR /&gt;B2000(venus.vdgc.com,-,) (venus,-,)(mars.vdgc.com,-,) (mars,-,).......&lt;BR /&gt;(rock.vdgc.com,-,) (rock,-,)&lt;BR /&gt;&lt;BR /&gt;That way is more readable (that's how I got mine done).&lt;BR /&gt;</description>
      <pubDate>Mon, 19 Aug 2002 16:22:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/reading-lines-in-a-loop/m-p/2788999#M834047</guid>
      <dc:creator>S.K. Chan</dc:creator>
      <dc:date>2002-08-19T16:22:52Z</dc:date>
    </item>
    <item>
      <title>Re: Reading lines in a loop</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/reading-lines-in-a-loop/m-p/2789000#M834048</link>
      <description>Woo, Even cut paste didn't work either.&lt;BR /&gt;&lt;BR /&gt;It suppose to be&lt;BR /&gt; B132  (alderon.vdgc.com,-,) (alderon,-,) (babafett.vdgc.com,-,) (babafett,-,) (c3po.vdgc.com,-,) (c3po,-,) droid.vdgc.com,-,) (droid,-,) &lt;BR /&gt;And so on...&lt;BR /&gt;&lt;BR /&gt;Rodney, I can't use \\ on netgroup file. I do not want to change original file to make my script work. &lt;BR /&gt;&lt;BR /&gt;Sachin&lt;BR /&gt;</description>
      <pubDate>Mon, 19 Aug 2002 16:22:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/reading-lines-in-a-loop/m-p/2789000#M834048</guid>
      <dc:creator>Sachin Patel</dc:creator>
      <dc:date>2002-08-19T16:22:53Z</dc:date>
    </item>
    <item>
      <title>Re: Reading lines in a loop</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/reading-lines-in-a-loop/m-p/2789001#M834049</link>
      <description>Sorry Sachin, the output is meant to look like ..&lt;BR /&gt;B132&lt;BACKSLASH&gt;&lt;BR /&gt;(alderon.vdgc.com,-,) (alderon,-,)&lt;BACKSLASH&gt;&lt;BR /&gt;(babafett.vdgc.com,-,) (babafett,-,)&lt;BACKSLASH&gt;&lt;BR /&gt;.......&lt;BR /&gt;endor.vdgc.com,-,) (endor,-,)&lt;BR /&gt;&lt;BR /&gt;B2000&lt;BACKSLASH&gt;&lt;BR /&gt;(venus.vdgc.com,-,) (venus,-,)&lt;BACKSLASH&gt;&lt;BR /&gt;(mars.vdgc.com,-,) (mars,-,)&lt;BACKSLASH&gt;&lt;BR /&gt;.......&lt;BR /&gt;(rock.vdgc.com,-,) (rock,-,)&lt;/BACKSLASH&gt;&lt;/BACKSLASH&gt;&lt;/BACKSLASH&gt;&lt;/BACKSLASH&gt;&lt;/BACKSLASH&gt;&lt;/BACKSLASH&gt;</description>
      <pubDate>Mon, 19 Aug 2002 16:24:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/reading-lines-in-a-loop/m-p/2789001#M834049</guid>
      <dc:creator>S.K. Chan</dc:creator>
      <dc:date>2002-08-19T16:24:54Z</dc:date>
    </item>
    <item>
      <title>Re: Reading lines in a loop</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/reading-lines-in-a-loop/m-p/2789002#M834050</link>
      <description>According to the "ksh" man page, you can use-&lt;BR /&gt;&lt;BR /&gt;read -r line&lt;BR /&gt;&lt;BR /&gt;The -r indicates raw and it will leave "\" characters alone.&lt;BR /&gt;&lt;BR /&gt;-- Rod Hills</description>
      <pubDate>Mon, 19 Aug 2002 16:25:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/reading-lines-in-a-loop/m-p/2789002#M834050</guid>
      <dc:creator>Rodney Hills</dc:creator>
      <dc:date>2002-08-19T16:25:43Z</dc:date>
    </item>
    <item>
      <title>Re: Reading lines in a loop</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/reading-lines-in-a-loop/m-p/2789003#M834051</link>
      <description>PERL time&lt;BR /&gt;&lt;BR /&gt;#!/path2perl&lt;BR /&gt;open(INFILE, "&lt;FILE_NAME&gt;&lt;/FILE_NAME&gt;while (&lt;INFILE&gt;) {&lt;BR /&gt;print $_;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;live free or die&lt;BR /&gt;harry&lt;/INFILE&gt;</description>
      <pubDate>Mon, 19 Aug 2002 16:26:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/reading-lines-in-a-loop/m-p/2789003#M834051</guid>
      <dc:creator>harry d brown jr</dc:creator>
      <dc:date>2002-08-19T16:26:44Z</dc:date>
    </item>
    <item>
      <title>Re: Reading lines in a loop</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/reading-lines-in-a-loop/m-p/2789004#M834052</link>
      <description>Look like "\" is not working in this message area either&lt;BR /&gt;&lt;BR /&gt;It suppose to be&lt;BR /&gt; B132  "\"&lt;BR /&gt;(alderon.vdgc.com,-,) (alderon,-,) "\"&lt;BR /&gt;(babafett.vdgc.com,-,) (babafett,-,) "\"&lt;BR /&gt;(c3po.vdgc.com,-,) (c3po,-,) "\"&lt;BR /&gt;droid.vdgc.com,-,) (droid,-,) "\"&lt;BR /&gt;&lt;BR /&gt;And so on...&lt;BR /&gt;So  third try with double quote around my \\.&lt;BR /&gt;&lt;BR /&gt;Sachin&lt;BR /&gt;</description>
      <pubDate>Mon, 19 Aug 2002 16:26:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/reading-lines-in-a-loop/m-p/2789004#M834052</guid>
      <dc:creator>Sachin Patel</dc:creator>
      <dc:date>2002-08-19T16:26:47Z</dc:date>
    </item>
    <item>
      <title>Re: Reading lines in a loop</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/reading-lines-in-a-loop/m-p/2789005#M834053</link>
      <description>Thanks Rodney,&lt;BR /&gt;That works. &lt;BR /&gt;SK I have my netgroup file same way as you trying to describe. Harry no perl this time.&lt;BR /&gt;&lt;BR /&gt;Sachin</description>
      <pubDate>Mon, 19 Aug 2002 16:32:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/reading-lines-in-a-loop/m-p/2789005#M834053</guid>
      <dc:creator>Sachin Patel</dc:creator>
      <dc:date>2002-08-19T16:32:29Z</dc:date>
    </item>
    <item>
      <title>Re: Reading lines in a loop</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/reading-lines-in-a-loop/m-p/2789006#M834054</link>
      <description>Hi Sachin:&lt;BR /&gt;&lt;BR /&gt;Have a look at the man pages for 'read'.  The '-r' option causes the backslach "\" character not to be treated in any special&lt;BR /&gt;way.  That is, to consider each backslash to be part of the input line.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;</description>
      <pubDate>Mon, 19 Aug 2002 16:32:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/reading-lines-in-a-loop/m-p/2789006#M834054</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2002-08-19T16:32:47Z</dc:date>
    </item>
    <item>
      <title>Re: Reading lines in a loop</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/reading-lines-in-a-loop/m-p/2789007#M834055</link>
      <description>Sachin,&lt;BR /&gt;&lt;BR /&gt;Can you try this?  It should work, assuming that the "\" is at the end of the line if any.  Otherwise, you can try again without the "$" sign in the sed command.&lt;BR /&gt;&lt;BR /&gt;cat file_name | sed 's:\\$:\\\\:' | while read line&lt;BR /&gt;do&lt;BR /&gt;echo "$line"&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;Hai</description>
      <pubDate>Mon, 19 Aug 2002 16:35:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/reading-lines-in-a-loop/m-p/2789007#M834055</guid>
      <dc:creator>Hai Nguyen_1</dc:creator>
      <dc:date>2002-08-19T16:35:11Z</dc:date>
    </item>
  </channel>
</rss>

