Tuesday, May 8, 2007

": No such file or directory" error from bash

I hit a strange problem this morning that I hadn't seen before. I tried to run a ruby script and bash kept telling me ': No such file or directory'. I then tried feeding the script to the interpreter directly and things worked as expected. After double and triple checking my shebang line everything seemed correct. It then occurred to me to think about where I had gotten the particular script in question from. It was generated by the Selenium IDE while I was on a windows test machine a few weeks before. As many already know line breaks in the windows world end with simply a carriage return and not a carriage return linefeed pair. I used the wonderful dos2unix utility to sanitize my script and then everything worked as expected.


my google reader feed