Inside a bash script I have a line that creates and then inside a loop, append strings to a text file, something like
echo $myTextString >> file.txt
I need this final file to be formatted using Western (Mac OS Roman).
The file does not exist when the script starts, so the first appending line will create the file. Is there a way to make the file be that format or convert it at the end to this Mac OS Roman format? How do I do that inside the bash script?

iconv -ldo not list no similar encoding. – enzotib Dec 2 '11 at 19:24