Based on your snippet (as correctly pointed out in an earlier reply), it looks like line-termination characters have nothing at all to do with your problem (I don't understand why other replies have been dwelling on this I'm guessing the first two replies were thrown off by your reference to "line endings" -- d'oh!).
To figure out what is going on, you might try something like this on your various linux boxes:
./some_executable.out -f some_param | od -txC -a
(Look up the man page for "od" to see if other options might make its output more useful to you.)
Is the executable copied as a binary file from one linux box to the other, or is it compiled from source code on each box? If the latter, is it compiled with the same configuration each time, or do things like libraries, locale, etc, differ from one box to the next?
Whatever it is, that executable is printing one or more lines of output, your script is reading each line as an array element, you are removing the line-feed from each line, and then assigning the first two space-separated tokens on the line to $tm and $val.
And you're finding some goofy character at the end of that first token ($tm), which you'd like to remove, no matter what it may be; chop $tm should work fine for that (as pointed out by virtualsue above).
But you'll want to look at it carefully, in detail. If the executable is returning some sort of multi-byte wide character, you might need something like "od" to see all the bytes. Come back with more detail if you get stumped, but hopefully, "od" will make things clearer for you.
(Updated to clarify that I wasn't implying any misunderstanding on virtualsue's part.) |