help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-bash] change


From: Val Krem
Subject: Re: [Help-bash] change
Date: Wed, 14 Jun 2017 21:38:58 +0000 (UTC)

Thank you Greg,

Yes the name will not change but the content will.

>dos2unix changes the MS-DOS carriage return + newline pairs to >newlines.This 
>is not the same as changing from some character set "to
> ASCII".


Yes I want to remove those "MS-DOS carriage return"


Val



On Wednesday, June 14, 2017 3:51 PM, Greg Wooledge <address@hidden> wrote:



On Wed, Jun 14, 2017 at 08:40:14PM +0000, Val Krem wrote:
> I am trying to change  some files to ASCII recursive. I tried this but not 
> getting there.

"To ASCII"?  What are they now?  Are you talking about their names, or
their contents?

> find  -maxdepth 2 -name "*.txt" -type f -exec dos2unix {} \;
> I want keep the file name as it is. 

dos2unix changes the MS-DOS carriage return + newline pairs to newlines.
This is not the same as changing from some character set "to ASCII".

How does this command NOT satisfy whatever it is that you're doing?  Other
than the lack of a starting directory (which is a bug, but you're clearly
using the GNU find which permits you to omit the . as starting directory,
since you are also using -maxdepth which is another GNU extension), this
looks sane.

> if the file  name is test1.txt then it should be the same after changing.

After changing what?  The command you have should run dos2unix on the
file.  The name should not change.  The contents may change.


> Can some one help me out?

Only if you tell us what you need.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]