I was bitten in the hiney by *nix
-
I wrote a ruby script in TextWrangler (on a Mac) and saved it (OK, I've written dozens, maybe hundreds... ). Howevber, this time, I inadvertently hit the space bar after the ".rb" and saved it. Then, not realizing a blank got added to the name, I attempted to load it and it could not be found. After messing with it, I realized the blank was saved as the third character after the "b" in .rb.
Entering load 'myscript.rb' failed, while entering load 'myscript.rb ' worked! Fat thumbs beware! Leading and trailing blanks are significant on *nix system. Only took me 10 minutes to figure it out.
Who would have thunk.
Todd
-
That's a good one! I would argue that the software should have trimmed the trailing whitespace - after all, who in there right mind names a file with a trailing space?
One thing I've done is manage to create files with names like "-v" and other silly things, so when I typed rm -v, rm thinks the filename was an option! There is an option on the Gnu version of rm to get around this.
What flavor of unix is Mac based on?
-
FreeBSD I believe.
Advertisement