You are not logged in.

#1 2011-12-05 18:10:12

skanky
Member
From: WAIS
Registered: 2009-10-23
Posts: 1,847

[SOLVED] (g)awk and tex files - \\ character

I use (g)awk (problem occurs with both) to merge different parts of tex files, and it's worked with no issues before.

However today is the first time I've used the script in a while - probably since gawk 4.0 was released. Now it is interpreting the \\ sequences inside the files (or at least the ones that are read in using getline) and removing one \.

I can't see anything in the changelog that specifically refers to this and the Gawk programmer's guide suggests that this is how it should work. So I'm left wondering how my script worked for the last two or three years, and whether I have to go through my tex documents and convert some/all \\ sequences to \\\\ or if there's some other simpler explanation/fix.

I'll try and build a test script that demonstrates the issue later, but in the meantime any ideas or pointers, anyone?

Last edited by skanky (2011-12-05 21:39:19)


"...one cannot be angry when one looks at a penguin."  - John Ruskin
"Life in general is a bit shit, and so too is the internet. And that's all there is." - scepticisle

Offline

#2 2011-12-05 21:44:21

skanky
Member
From: WAIS
Registered: 2009-10-23
Posts: 1,847

Re: [SOLVED] (g)awk and tex files - \\ character

Okay, when I stripped the script down to create one that I could post here, I realised that I was using sub and the behaviour of that has changed - to be POSIX compliant. So that's the issue. I solved it by working out how to not use sub for this part. It probably wasn't necessary in the first place. I can post the script here if anyone's interested, but it ends up pretty simple when boiled down.


"...one cannot be angry when one looks at a penguin."  - John Ruskin
"Life in general is a bit shit, and so too is the internet. And that's all there is." - scepticisle

Offline

Board footer

Powered by FluxBB