You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by prbharsakle <pr...@gmail.com> on 2011/11/04 08:31:43 UTC

Ant fixcrlf

Hi All,

I have defined some logic in my a.csh file.

e.g. : foreach sqlfile (`cat $sql_File | awk '{print $2}' | sed -e
's/\\/\//g' | tr -d ^M `)

After that I am copying this file to some other location, before that I am
running fixcrlf on this a.csh file, it does removing the ^M characters from
end of the line but it is also removing the ^M characters which I have
defined in my foreach statement.

Can someone please suggest me how can I ignore removal of the file ?

Thanks for the co-operation,

Pravin Bharsakle



--
View this message in context: http://ant.1045680.n5.nabble.com/Ant-fixcrlf-tp4963233p4963233.html
Sent from the Ant - Users mailing list archive at Nabble.com.

Re: Ant fixcrlf

Posted by Parag Doke <pa...@gmail.com>.
Hi Pravin :-).
[For others who find the smiley amusing, I know Pravin in person.]

If I understand correctly, your intent is to substitute all occurrences of
backslash with a forward slash in a set of sql files. Is that right ? And
you also use ant to remove the ^M characters. Wouldn't it be okay to do
this via just ant (rather than shell + ant) ?

Thanks,
Parag Doke
Save paper, save trees. Do not print emails/documents unless absolutely
necessary.


On Fri, Nov 4, 2011 at 1:01 PM, prbharsakle <pr...@gmail.com> wrote:

> Hi All,
>
> I have defined some logic in my a.csh file.
>
> e.g. : foreach sqlfile (`cat $sql_File | awk '{print $2}' | sed -e
> 's/\\/\//g' | tr -d ^M `)
>
> After that I am copying this file to some other location, before that I am
> running fixcrlf on this a.csh file, it does removing the ^M characters from
> end of the line but it is also removing the ^M characters which I have
> defined in my foreach statement.
>
> Can someone please suggest me how can I ignore removal of the file ?
>
> Thanks for the co-operation,
>
> Pravin Bharsakle
>
>
>
> --
> View this message in context:
> http://ant.1045680.n5.nabble.com/Ant-fixcrlf-tp4963233p4963233.html
> Sent from the Ant - Users mailing list archive at Nabble.com.

Re: Ant fixcrlf

Posted by Stefan Bodewig <bo...@apache.org>.
On 2011-11-04, prbharsakle wrote:

> There are two letters "^" and "M". Crlf is treating it as a ^M and removing
> it but I want it there.

Then something else must be doing that.  The fixcrlf will not touch the
letters ^ or M, not even if they happen to be next to each other.  It
will only ever deal with real whitespace characters.

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: Ant fixcrlf

Posted by prbharsakle <pr...@gmail.com>.
There are two letters "^" and "M". Crlf is treating it as a ^M and removing
it but I want it there.

Thanks,
Pravin Bharsakle


--
View this message in context: http://ant.1045680.n5.nabble.com/Ant-fixcrlf-tp4963233p4963718.html
Sent from the Ant - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: Ant fixcrlf

Posted by Stefan Bodewig <bo...@apache.org>.
On 2011-11-04, prbharsakle wrote:

> Hi All,

> I have defined some logic in my a.csh file.

> e.g. : foreach sqlfile (`cat $sql_File | awk '{print $2}' | sed -e
> 's/\\/\//g' | tr -d ^M `)

> After that I am copying this file to some other location, before that I am
> running fixcrlf on this a.csh file, it does removing the ^M characters from
> end of the line but it is also removing the ^M characters which I have
> defined in my foreach statement.

You mean there is a literal carriage return in your foreach loop and not
the two letters ^ and M?

tr should accept \r (the two letters \ and r).

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org