I just realised that my BBEdit Lite preferences was set to save files with Macintosh line breaks rather than UNIX line breaks.