Ich habe seltsames textEdit-Verhalten in Ruby unter OSX. Es fügt seltsame Zeichen in meine Datei ein. Bitte sagen Sie mir, was dies zu tun zu beheben:seltsames textEdit-Verhalten in Ruby unter OSX. Fügt seltsame Zeichen in meine Datei ein
[Goldie-MacBook:~/ruby] jja% cat hello.rb
#!/usr/bin/ruby
print "Hello World\n"
[Goldie-MacBook:~/ruby] jja% od -c hello.rb
0000000 # ! / u s r / b i n / r u b y \n
0000020 p r i n t " H e l l o W o r
0000040 l d \ n " \n
0000046
[Goldie-MacBook:~/ruby] jja% ruby hello.rb
Hello World
[Goldie-MacBook:~/ruby] jja% lets do some editing
lets: Command not found.
[Goldie-MacBook:~/ruby] jja% cat hello.rb
#!/usr/bin/ruby
print "Hellooo World!\n”
[Goldie-MacBook:~/ruby] jja% ruby hello.rb
hello.rb:2: unterminated string meets end of file
[Goldie-MacBook:~/ruby] jja% od -c hello.rb
0000000 # ! / u s r / b i n / r u b y \n
0000020 p r i n t " H e l l o o o W
0000040 o r l d ! \ n ” ** ** \n
0000053
[Goldie-MacBook:~/ruby] jja% od -xc hello.rb
0000000 2123 752f 7273 622f 6e69 722f 6275 0a79
# ! / u s r / b i n / r u b y \n
0000020 7270 6e69 2074 4822 6c65 6f6c 6f6f 5720
p r i n t " H e l l o o o W
0000040 726f 646c 5c21 e26e 9d80 000a
o r l d ! \ n ” ** ** \n
0000053
[Goldie-MacBook:~/ruby] jja% ruby -v
ruby 1.8.7 (2010-06-23 patchlevel 299) [i686-darwin10]
[Goldie-MacBook:~/ruby] jja%
Danke, Sie haben meine Frage beantwortet, bevor ich sie gestellt habe. Habe nur einen Tag damit verschwendet, mysteriöse Bugs in einem Shell-Skript aufzuspüren. Textedit wandelte manchmal Bindestriche in ein Zeichen um, das identisch aussah. Apple: anders und nicht immer gut. – JavaLatte