Command line tr behaving different to Linux
I've been writing scripts to automate image building for various embedded software projects, but I found tr is behaving differently on my Mac to my Linux PC.
I'm essentially trying to generate an 0xFF padded image.
Linux yields (as expected):
tr '\000' '\377' < /dev/zero | hexdump
0000000 ffff ffff ffff ffff ffff ffff ffff ffff
But MacOS Terminal gives me:
tr '\000' '\377' < /dev/zero | hexdump
0000000 c3 bf c3 bf c3 bf c3 bf c3 bf c3 bf c3 bf c3 bf
I can't figure out exactly what's going on, I guess MacOS is interpreting the octal differently. I have a workaround using Python, but this is bugging me! Can anyone here tell me what's going on?
Thanks
MacBook Pro, OS X Mountain Lion (10.8.2), MacOS Terminal