The Winding Road of Procrastination

I sat down tonight to do some more learning about Ruby. I thought that I'd spend an hour or so and build something trivial, but useful. Well 90 minutes later and I have had an enjoyable evening, but I have yet to write a single line of Ruby code. It started out with a [Ruby tutorial]( which had a header on the first line with the standard directive pointing to the executable for the Ruby interpreter. That led me to realize I wasn't 100% sure where that executable was on a Mac. I remembered that there was some kind of command to find these exectuables so off I went to [Google]( My search results led mt to a Perl primer describing the use of the [which]( command. Having used the…
Read More

Ubuntu School – which: Finding Ruby

I've been getting my feet wet with Ruby the past couple of days and decided to post this as much for my own recollection as anything else. When you're creating a .rb script file the first line (as with nearly all \*nix script files) contains a reference to the executable which should be used to execute the script. ``` #!/usr/bin/ruby ``` But what if you don't know precisely where that file lives? The [which]( command will find it for you. Which is a command which provides you the fully qualified path to shell commands, and this includes script hosts like ruby. ``` callisto:~ kdmurray$ which ruby /usr/bin/ruby ``` This also works for Perl, Python and any number of other executables. Ever wonder where the pwd command lives? or nano? or…
Read More