Dear all,
I am sorry for my mistake, and I wish to thank every body for the suggestions.
My mistake came from the fact that my original file (containing the
variables $1 and $2), had been generated by a windows system.
Then the ^M where propagated from file to file when I used
print "#" >
and not when I did not used this print.
Weird.
===========================================================================
Patrick DUPRÉ | | email: pdupre(a)gmx.com
Laboratoire de Physico-Chimie de l'Atmosphère | |
Université du Littoral-Côte d'Opale | |
Tel. (33)-(0)3 28 23 76 12 | | Fax: 03 28 65 82 44
189A, avenue Maurice Schumann | | 59140 Dunkerque, France
===========================================================================
> Sent: Thursday, May 17, 2018 at 2:35 AM
> From: "Eyal Lebedinsky" <fedora(a)eyal.emu.id.au>
> To: users(a)lists.fedoraproject.org
> Subject: Re: gawk
>
> On 17/05/18 07:05, Patrick Dupre wrote:
> > Sorry,
> >
> > This is correct, but
> > if I do:
> > print "#" > "tmptmp.txt" ;
> > after
> > print $1 $2 > "tmptmp.txt" ;
> >
> > then I get ^M
> > in my file
> > I do not have the ^M if I only make print $1 $2 > "tmptmp.txt" ;
> > and never make a print "#"
> >
> > Can I avoid these ^M
> > ?
>
> I ran this test:
>
> $ rm "tmptmp.txt"
> $ echo a b c d | gawk '{print $1 $2 > "tmptmp.txt" ; print
"#" > "tmptmp.txt"}'
>
> And then got the correct output:
>
> $ cat tmptmp.txt
> ab
> #
>
> You need to show exactly what you did, like
> - what command did you run?
> - how did you examine the output file?
>
> A console transcript will be a good start.
>
> HTH
>
> > Thank.
> >
> > ===========================================================================
> > Patrick DUPRÉ | | email: pdupre(a)gmx.com
>
> --
> Eyal Lebedinsky (fedora(a)eyal.emu.id.au)
> _______________________________________________
> users mailing list -- users(a)lists.fedoraproject.org
> To unsubscribe send an email to users-leave(a)lists.fedoraproject.org
>