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.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better π
Register LoginAdvertisement