<?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: read cmd truncating leading spaces in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/read-cmd-truncating-leading-spaces/m-p/2934456#M934773</link>
    <description>Also try:&lt;BR /&gt;perl -pe 1 file &lt;BR /&gt;&lt;BR /&gt;For one line at a time in Perl.&lt;BR /&gt;</description>
    <pubDate>Mon, 24 Mar 2003 21:00:45 GMT</pubDate>
    <dc:creator>Michael Steele_2</dc:creator>
    <dc:date>2003-03-24T21:00:45Z</dc:date>
    <item>
      <title>read cmd truncating leading spaces</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/read-cmd-truncating-leading-spaces/m-p/2934454#M934771</link>
      <description>I'm trying to use the read command such as:&lt;BR /&gt;while read LINE&lt;BR /&gt;do&lt;BR /&gt;    process stuff...&lt;BR /&gt;done &amp;lt; input.file&lt;BR /&gt;&lt;BR /&gt;input.file looks something like:&lt;BR /&gt;  line1 starting pos 3&lt;BR /&gt;  line2 starting pos 3&lt;BR /&gt;  line3 starting pos 3&lt;BR /&gt;etc...&lt;BR /&gt;&lt;BR /&gt;When I examine the var "$LINE"&lt;BR /&gt;it looks like:&lt;BR /&gt;line1 starting pos 3&lt;BR /&gt;line2 starting pos 3&lt;BR /&gt;line3 starting pos 3&lt;BR /&gt;&lt;BR /&gt;How can I get the read command to leave the leading spaces intact???&lt;BR /&gt;Also, the UNIX 'line' command was not a viable alternative.&lt;BR /&gt;Thanks,&lt;BR /&gt;jg</description>
      <pubDate>Mon, 24 Mar 2003 20:22:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/read-cmd-truncating-leading-spaces/m-p/2934454#M934771</guid>
      <dc:creator>Jim Green_1</dc:creator>
      <dc:date>2003-03-24T20:22:34Z</dc:date>
    </item>
    <item>
      <title>Re: read cmd truncating leading spaces</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/read-cmd-truncating-leading-spaces/m-p/2934455#M934772</link>
      <description>Hi Jim:&lt;BR /&gt;&lt;BR /&gt;You can reset the IFS (Inter-Field Seperator) to achieve this.  For instance:&lt;BR /&gt;&lt;BR /&gt;# OLDIFS=$IFS&lt;BR /&gt;# IFS=:&lt;BR /&gt;# while read LINE&lt;BR /&gt;&amp;gt; do&lt;BR /&gt;&amp;gt; echo "${X}"&lt;BR /&gt;&amp;gt; done &amp;lt; input.file&lt;BR /&gt;# IFS=$OLDIFS&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;</description>
      <pubDate>Mon, 24 Mar 2003 20:32:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/read-cmd-truncating-leading-spaces/m-p/2934455#M934772</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2003-03-24T20:32:43Z</dc:date>
    </item>
    <item>
      <title>Re: read cmd truncating leading spaces</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/read-cmd-truncating-leading-spaces/m-p/2934456#M934773</link>
      <description>Also try:&lt;BR /&gt;perl -pe 1 file &lt;BR /&gt;&lt;BR /&gt;For one line at a time in Perl.&lt;BR /&gt;</description>
      <pubDate>Mon, 24 Mar 2003 21:00:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/read-cmd-truncating-leading-spaces/m-p/2934456#M934773</guid>
      <dc:creator>Michael Steele_2</dc:creator>
      <dc:date>2003-03-24T21:00:45Z</dc:date>
    </item>
  </channel>
</rss>

