![]() ![]() The solution is a little script I call bbstdin: bash: Only the LF added by echo is recognized it makes wc think there’s one long line before the LF and one zero-length line after it. The example above will return 2 no matter how many lines there are in the front document, because wc treats everything ending in CR to be one long single line. This is fine for BBEdit’s internal consistency, but it doesn’t work well when you need to feed those lines to a script that assumes linefeeds to be the only just and proper way to end a line. BBEdit, as we’ve seen before, considers the lines of the files it’s editing to be ended by carriage returns, regardless of the files’ line ending settings.For some scripts this won’t matter for some, like wc, it will. echo adds a newline to the end of the text it’s echoing.There are two problems with this approach when scripting BBEdit: Set myRef to do shell script "echo "
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |