Output text with Unix line feeds on jaguar
Sannyasin Sivakatirswami
katir at hindu.org
Thu Sep 26 01:00:00 EDT 2002
Problem:
Unable/How to enforce unix linefeeds as the line delimiters in files
output by xTalk scripts on OSX Jaguar. ?
Context:
Process data on from our mail server on a local station running Jaguar.
Attempts to run a shell commands on a file just previously output by
script failing because the file contains mac line breaks.
Try using "return" and numTochar(10) -- neither works. The resulting
file causes the shell script to fail. Open that same file in BBEdit,
convert line breaks and save as Unix... then the shell script processes
the file just fine.
Also tested opening a Unix file with proper line breaks in BBedit with
line translation off and it all comes in on one line -- expected
behavior... Then, importing the file created under xTalk, always
opens with mac line breaks... "presumable proof" that the xTalk script
is outputting mac line breaks, no matter what we do....
on mouseup
put the effective filename of this stack into stackFilePath
set itemdel to "/"
delete last item of stackFilePath
repeat for each line x in fld "Bounce Window"
set itemdel to tab
if (item 2 of x >= 5) and not (item 3 of x is "tb") then
## if true then we have an email address in x which we want to pass,
## line delimited to a unix compatible file
put item 1 of x & return after toRemoveEmails
## does not work: file contains mac line breaks
put item 1 of x & numbTochar(10) after toRemoveEmails
## also does not work... resulting file still contains mac line
breaks.
end if
end repeat
put toRemoveEmails into URL ("file:" & stackFilePath & "/emails")
triggerEmailShellScripts
## to process above saved file
## but shell scripts fail...
end mouseup
go out to BBedit; open file "emails" output above;
save as Unix file with Unix line breaks....
on mouseup
triggerEmailShellScripts ## process same file
end mouseup
Shell script now succeeds....
??
TIA
Himalayan Academy Publications
Sannyasin Sivakatirswami
Editor's Assistant/Production Manager
katir at hindu.org
www.HinduismToday.com, www.HimalayanAcademy.com,
www.Gurudeva.org, www.hindu.org
More information about the metacard
mailing list