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@xxxxxxx 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@xxxxxxxxxxxxxx> > To: users@xxxxxxxxxxxxxxxxxxxxxxx > 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@xxxxxxx > > -- > Eyal Lebedinsky (fedora@xxxxxxxxxxxxxx) > _______________________________________________ > users mailing list -- users@xxxxxxxxxxxxxxxxxxxxxxx > To unsubscribe send an email to users-leave@xxxxxxxxxxxxxxxxxxxxxxx > _______________________________________________ users mailing list -- users@xxxxxxxxxxxxxxxxxxxxxxx To unsubscribe send an email to users-leave@xxxxxxxxxxxxxxxxxxxxxxx Fedora Code of Conduct: https://getfedora.org/code-of-conduct.html List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/users@xxxxxxxxxxxxxxxxxxxxxxx/message/S65ZWOMFM5NXP2LRC7GEGF2Q4ZGOZZ5T/