<?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: dos2unix with find command in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/dos2unix-with-find-command/m-p/3613565#M19336</link>
    <description>Hi Rodney,&lt;BR /&gt;&lt;BR /&gt;I tried your method using PERL, but obtained the error shown below:&lt;BR /&gt;&lt;BR /&gt;bash-2.03$ perl -i -pe 'chomp;print $_,"\n";''\find . -type f -name "pollera"'&lt;BR /&gt;String found where operator expected at -e line 1, near "name "pollera""&lt;BR /&gt;        (Do you need to predeclare name?)&lt;BR /&gt;syntax error at -e line 1, near "name "pollera""&lt;BR /&gt;Execution of -e aborted due to compilation errors.&lt;BR /&gt;&lt;BR /&gt;May I know where exactly is my error, as I believe I've copied exactly what you showed.&lt;BR /&gt;&lt;BR /&gt;Could you or anyone else help out?&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Tue, 30 Aug 2005 04:08:34 GMT</pubDate>
    <dc:creator>Danny Fang</dc:creator>
    <dc:date>2005-08-30T04:08:34Z</dc:date>
    <item>
      <title>dos2unix with find command</title>
      <link>https://community.hpe.com/t5/operating-system-linux/dos2unix-with-find-command/m-p/3613557#M19328</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I would like to use the find command along with the dos2unix utility to locate file containing the ^M character and convert them to the standard UNIX file. &lt;BR /&gt;&lt;BR /&gt;This is what I've done:&lt;BR /&gt;find . -type f -name "*.sh" -exec dos2unix {} \;&lt;BR /&gt;&lt;BR /&gt;However, the command above only displayed the file contents(without the ^M) at the std I/O, and in the file itself.&lt;BR /&gt;&lt;BR /&gt;May I know how do I include both the original file to modify and the new output file to the dos2unix command arguments, executed with the find command?&lt;BR /&gt;bash-2.03$ dos2unix pollerka pollerka&lt;BR /&gt;could not open /dev/kbd to get keyboard type US keyboard assumed&lt;BR /&gt;could not get keyboard type US keyboard assumed&lt;BR /&gt;bash-2.03$ &lt;BR /&gt;&lt;BR /&gt;Also, how do I execute dos2unix in silent mode?&lt;BR /&gt;&lt;BR /&gt;Could anyone help out?&lt;BR /&gt;</description>
      <pubDate>Sun, 28 Aug 2005 22:52:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/dos2unix-with-find-command/m-p/3613557#M19328</guid>
      <dc:creator>Danny Fang</dc:creator>
      <dc:date>2005-08-28T22:52:03Z</dc:date>
    </item>
    <item>
      <title>Re: dos2unix with find command</title>
      <link>https://community.hpe.com/t5/operating-system-linux/dos2unix-with-find-command/m-p/3613558#M19329</link>
      <description>for filename in `find . -type f -name "*.sh"`;&lt;BR /&gt;do dos2unix $filename $filename&lt;BR /&gt;done;&lt;BR /&gt;&lt;BR /&gt;By the way in HP its dos2ux</description>
      <pubDate>Sun, 28 Aug 2005 23:50:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/dos2unix-with-find-command/m-p/3613558#M19329</guid>
      <dc:creator>Vibhor Kumar Agarwal</dc:creator>
      <dc:date>2005-08-28T23:50:55Z</dc:date>
    </item>
    <item>
      <title>Re: dos2unix with find command</title>
      <link>https://community.hpe.com/t5/operating-system-linux/dos2unix-with-find-command/m-p/3613559#M19330</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;dos2ux writes output to stdout, you must redirect output to a file if you want dos2ux "silent".&lt;BR /&gt;dos2ux infile &amp;gt;outfile&lt;BR /&gt;&lt;BR /&gt;then you can move the outfile to the original name&lt;BR /&gt;&lt;BR /&gt;mv outfile infile</description>
      <pubDate>Mon, 29 Aug 2005 02:34:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/dos2unix-with-find-command/m-p/3613559#M19330</guid>
      <dc:creator>Leif Halvarsson_2</dc:creator>
      <dc:date>2005-08-29T02:34:40Z</dc:date>
    </item>
    <item>
      <title>Re: dos2unix with find command</title>
      <link>https://community.hpe.com/t5/operating-system-linux/dos2unix-with-find-command/m-p/3613560#M19331</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;have a look at the manpage. It states, that dos2ux writes to standart output. So the command works as designed.&lt;BR /&gt;&lt;BR /&gt;In your case you have to redirect the output to a filename e.g. dos2ux inputfile &amp;gt; outputfile.&lt;BR /&gt;&lt;BR /&gt;If you want to combine this with a find command you can do a loop for each file find returns. Something like:&lt;BR /&gt;&lt;BR /&gt;for filename in 'find ....'&lt;BR /&gt;do&lt;BR /&gt;dos2ux $filename &amp;gt; $filename.new&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;Hope this helps&lt;BR /&gt;&lt;BR /&gt;Regards Stefan&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 29 Aug 2005 04:13:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/dos2unix-with-find-command/m-p/3613560#M19331</guid>
      <dc:creator>Stefan Schulz</dc:creator>
      <dc:date>2005-08-29T04:13:03Z</dc:date>
    </item>
    <item>
      <title>Re: dos2unix with find command</title>
      <link>https://community.hpe.com/t5/operating-system-linux/dos2unix-with-find-command/m-p/3613561#M19332</link>
      <description>You can try as,&lt;BR /&gt;&lt;BR /&gt;# find . -type f -name "*.sh" | awk '{ print "dos2unix "$0" "$0".unix" }' | ksh&lt;BR /&gt;&lt;BR /&gt;It will create modified file as &lt;INPUTFILENAME&gt;.unix&lt;BR /&gt;&lt;BR /&gt;hth.&lt;/INPUTFILENAME&gt;</description>
      <pubDate>Mon, 29 Aug 2005 05:18:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/dos2unix-with-find-command/m-p/3613561#M19332</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2005-08-29T05:18:59Z</dc:date>
    </item>
    <item>
      <title>Re: dos2unix with find command</title>
      <link>https://community.hpe.com/t5/operating-system-linux/dos2unix-with-find-command/m-p/3613562#M19333</link>
      <description>You have to use dos2ux in hp-ux ;)&lt;BR /&gt;&lt;BR /&gt;# find . -type f -name "*.sh" | awk '{ print "dos2ux "$0" "$0".out" }' | ksh&lt;BR /&gt;&lt;BR /&gt;hth.</description>
      <pubDate>Mon, 29 Aug 2005 05:20:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/dos2unix-with-find-command/m-p/3613562#M19333</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2005-08-29T05:20:03Z</dc:date>
    </item>
    <item>
      <title>Re: dos2unix with find command</title>
      <link>https://community.hpe.com/t5/operating-system-linux/dos2unix-with-find-command/m-p/3613563#M19334</link>
      <description>Yet another way to do this would be to pipe the output of find to xargs in order to get rid of the &lt;CR&gt; character:&lt;BR /&gt;&lt;BR /&gt;# find . -type f -name "*.sh" | xargs -i dos2unix {} {}.ux&lt;BR /&gt;&lt;BR /&gt;regards!&lt;BR /&gt;&lt;/CR&gt;</description>
      <pubDate>Mon, 29 Aug 2005 11:39:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/dos2unix-with-find-command/m-p/3613563#M19334</guid>
      <dc:creator>Sandman!</dc:creator>
      <dc:date>2005-08-29T11:39:15Z</dc:date>
    </item>
    <item>
      <title>Re: dos2unix with find command</title>
      <link>https://community.hpe.com/t5/operating-system-linux/dos2unix-with-find-command/m-p/3613564#M19335</link>
      <description>You could use perl-&lt;BR /&gt; &lt;BR /&gt;perl -i -pe 'chomp;print $_,"\n";' `find . -type f -name "*.sh"`&lt;BR /&gt; &lt;BR /&gt;This will in effect "chomp" the trailing cr. The -i option tells perl to read in the original and update it "in place".&lt;BR /&gt; &lt;BR /&gt;HTH&lt;BR /&gt; &lt;BR /&gt;-- Rod Hills</description>
      <pubDate>Mon, 29 Aug 2005 14:57:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/dos2unix-with-find-command/m-p/3613564#M19335</guid>
      <dc:creator>Rodney Hills</dc:creator>
      <dc:date>2005-08-29T14:57:21Z</dc:date>
    </item>
    <item>
      <title>Re: dos2unix with find command</title>
      <link>https://community.hpe.com/t5/operating-system-linux/dos2unix-with-find-command/m-p/3613565#M19336</link>
      <description>Hi Rodney,&lt;BR /&gt;&lt;BR /&gt;I tried your method using PERL, but obtained the error shown below:&lt;BR /&gt;&lt;BR /&gt;bash-2.03$ perl -i -pe 'chomp;print $_,"\n";''\find . -type f -name "pollera"'&lt;BR /&gt;String found where operator expected at -e line 1, near "name "pollera""&lt;BR /&gt;        (Do you need to predeclare name?)&lt;BR /&gt;syntax error at -e line 1, near "name "pollera""&lt;BR /&gt;Execution of -e aborted due to compilation errors.&lt;BR /&gt;&lt;BR /&gt;May I know where exactly is my error, as I believe I've copied exactly what you showed.&lt;BR /&gt;&lt;BR /&gt;Could you or anyone else help out?&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 30 Aug 2005 04:08:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/dos2unix-with-find-command/m-p/3613565#M19336</guid>
      <dc:creator>Danny Fang</dc:creator>
      <dc:date>2005-08-30T04:08:34Z</dc:date>
    </item>
    <item>
      <title>Re: dos2unix with find command</title>
      <link>https://community.hpe.com/t5/operating-system-linux/dos2unix-with-find-command/m-p/3613566#M19337</link>
      <description>Their are a lot of quotes and spaces in the command, and it would be easy to miss one.&lt;BR /&gt; &lt;BR /&gt;Try copying the command from the web page.&lt;BR /&gt; &lt;BR /&gt;Also, try this command instead-&lt;BR /&gt; &lt;BR /&gt;perl -i -pe 's/\r//g' `find . -type f -name "*.sh"`&lt;BR /&gt; &lt;BR /&gt;The 's/\r//g' is the perl statement to execute. The `find ...` executes the find returning the list of file names to be processed. &lt;BR /&gt; &lt;BR /&gt;HTH&lt;BR /&gt; &lt;BR /&gt;-- Rod Hills</description>
      <pubDate>Tue, 30 Aug 2005 09:21:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/dos2unix-with-find-command/m-p/3613566#M19337</guid>
      <dc:creator>Rodney Hills</dc:creator>
      <dc:date>2005-08-30T09:21:36Z</dc:date>
    </item>
  </channel>
</rss>

