Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

BabaG

macrumors member
Original poster
Jan 5, 2007
83
0
i have a bash script i'm moving over to my macpro from a linux box.
the script reads a windows-generated txt file. on the linux box i had
to run the txt file through a program called dos2unix to change the
dos style line endings to unix style. do i need to do something like
this to properly read the txt file on the mac (10.4.11)? if so, what's
the app i need to run it through and does it come with osx?

thanks,
BabaG
 
I don't think you would need to. I just tested with a file using Windows line endings and using the "cat" command it outputted just fine.
 
thanks kainjow.

i have lines in the script that call for specified line lengths from the
txt file. when i had this script on linux, the file would output ok but,
when looking for the specified line of the specified length, it would
not find it because the dos line ending caused it to either have an
extra character or be missing an extra character, i forget which.
bottom line was, it would output ok but counted characters incorrectly.
that's what i'm trying to avoid going through again now that it's
moving over to osx. so, i'm not sure output is enough of a test.

thanks again,
BabaG
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.