<?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: sed to remove control M characfer in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/sed-to-remove-control-m-characfer/m-p/4571082#M679140</link>
    <description>Hi:&lt;BR /&gt;&lt;BR /&gt;You can use 'dos2ux' or Perl:&lt;BR /&gt;&lt;BR /&gt;# dos2ux &amp;lt; file &amp;gt; file.new&lt;BR /&gt;&lt;BR /&gt;# perl -pe 's/\r$//g' file &amp;gt; file.new&lt;BR /&gt;&lt;BR /&gt;...or with an "inplace" update:&lt;BR /&gt;&lt;BR /&gt;# perl -pi.old -e 's/\r$//g' file&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Mon, 25 Jan 2010 22:03:51 GMT</pubDate>
    <dc:creator>James R. Ferguson</dc:creator>
    <dc:date>2010-01-25T22:03:51Z</dc:date>
    <item>
      <title>sed to remove control M characfer</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sed-to-remove-control-m-characfer/m-p/4571081#M679139</link>
      <description>Hello, &lt;BR /&gt;I am using the below sed code to remove the control M character from a file, however I am getting an error.&lt;BR /&gt;&lt;BR /&gt;sed -e 's///g' $filename &amp;gt; $TMP/$filename&lt;BR /&gt;sed: 0602-410 The first regular expression cannot be null.&lt;BR /&gt;&lt;BR /&gt;Any help would be appreciated.&lt;BR /&gt;&lt;BR /&gt;Thanks.&lt;BR /&gt;</description>
      <pubDate>Mon, 25 Jan 2010 21:50:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sed-to-remove-control-m-characfer/m-p/4571081#M679139</guid>
      <dc:creator>rhansen</dc:creator>
      <dc:date>2010-01-25T21:50:12Z</dc:date>
    </item>
    <item>
      <title>Re: sed to remove control M characfer</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sed-to-remove-control-m-characfer/m-p/4571082#M679140</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;You can use 'dos2ux' or Perl:&lt;BR /&gt;&lt;BR /&gt;# dos2ux &amp;lt; file &amp;gt; file.new&lt;BR /&gt;&lt;BR /&gt;# perl -pe 's/\r$//g' file &amp;gt; file.new&lt;BR /&gt;&lt;BR /&gt;...or with an "inplace" update:&lt;BR /&gt;&lt;BR /&gt;# perl -pi.old -e 's/\r$//g' file&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 25 Jan 2010 22:03:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sed-to-remove-control-m-characfer/m-p/4571082#M679140</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2010-01-25T22:03:51Z</dc:date>
    </item>
    <item>
      <title>Re: sed to remove control M characfer</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sed-to-remove-control-m-characfer/m-p/4571083#M679141</link>
      <description>Hi (again):&lt;BR /&gt;&lt;BR /&gt;In reality we can drop the 'g'lobal action from the one-liner Perl above, since the substitution is performed if there is a carriage-return ('\r') anchored to the end of a line.  Thus there will only be one.&lt;BR /&gt;&lt;BR /&gt;In HP's 'sed' you are relegated to something like:&lt;BR /&gt;&lt;BR /&gt;# sed -e 's/^M//' file &amp;gt; file.new&lt;BR /&gt;&lt;BR /&gt;...where the ^M is typed at the command line by pressing the "CONTROL v m" key sequence.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Mon, 25 Jan 2010 22:12:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sed-to-remove-control-m-characfer/m-p/4571083#M679141</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2010-01-25T22:12:33Z</dc:date>
    </item>
    <item>
      <title>Re: sed to remove control M characfer</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sed-to-remove-control-m-characfer/m-p/4571084#M679142</link>
      <description>&amp;gt;JRF: where the ^M is typed at the command line by pressing the "CONTROL v m" key sequence.&lt;BR /&gt;&lt;BR /&gt;Unfortunately you can't do that for ksh, I get control-J.  You can do it in vi.&lt;BR /&gt;&lt;BR /&gt;You can also use vi directly on the file or use tr(1).</description>
      <pubDate>Mon, 25 Jan 2010 23:34:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sed-to-remove-control-m-characfer/m-p/4571084#M679142</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2010-01-25T23:34:22Z</dc:date>
    </item>
    <item>
      <title>Re: sed to remove control M characfer</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sed-to-remove-control-m-characfer/m-p/4571085#M679143</link>
      <description>Hi (again):&lt;BR /&gt;&lt;BR /&gt;&amp;gt; Dennis: Unfortunately you can't do that for ksh, I get control-J.&lt;BR /&gt;&lt;BR /&gt;That is interesting.  I see this too if I switch to the 'ksh' shell.  With the standard Posix shell the control+v+m sequence works fine at the command line.&lt;BR /&gt;&lt;BR /&gt;I agree, rhansen could also do:&lt;BR /&gt;&lt;BR /&gt;# tr -d  "\015" &amp;lt; file &amp;gt; file.new&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Mon, 25 Jan 2010 23:52:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sed-to-remove-control-m-characfer/m-p/4571085#M679143</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2010-01-25T23:52:11Z</dc:date>
    </item>
    <item>
      <title>Re: sed to remove control M characfer</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sed-to-remove-control-m-characfer/m-p/4571086#M679144</link>
      <description>&lt;!--!*#--&gt;&amp;gt; sed: 0602-410 [...]&lt;BR /&gt;&lt;BR /&gt;It might be helpful if you would reveal the&lt;BR /&gt;particular AIX version where you're trying to&lt;BR /&gt;do the work.  "uname -a" should say enough.&lt;BR /&gt;&lt;BR /&gt;&amp;gt; You can use 'dos2ux' [...]&lt;BR /&gt;&lt;BR /&gt;Perhaps not on AIX:&lt;BR /&gt;&lt;BR /&gt;blue# man dos2ux&lt;BR /&gt;Manual entry for dos2ux not found or not installed.&lt;BR /&gt;&lt;BR /&gt;blue# type dos2ux&lt;BR /&gt;-bash: type: dos2ux: not found</description>
      <pubDate>Tue, 26 Jan 2010 04:13:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sed-to-remove-control-m-characfer/m-p/4571086#M679144</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2010-01-26T04:13:03Z</dc:date>
    </item>
  </channel>
</rss>

