Well that's embarrassing. It's hash bang... I had reversed it while typing
to fast. My apologize.

Todd to know more about chmod read the man page:
% man chmod

It stands for change mode. Basically it's turning on the execute bit when
you use +x.

~Stu


On Thu, Jun 27, 2013 at 12:13 AM, Stu <stu / rubyprogrammer.net> wrote:

> Hi Todd!
>
> !#/usr/bin/env ruby
>
> it needs the token (i.e. program executable name) in front of the env
> token. This makes your script portable.
>
> You will want to make it exectutable which is done with the command chmod
> like so:
>
> % chmod +x /path/to/your-program
>
> from there to exectute it you can do it one of three ways.
>
> 1. simply use dot slash in front of the program like: ./prog
> 2. type the whole path like: /home/todd/prog
> 3. set up a bin directory and set up your the PATH variable in your shells
> rc file.
>
> The last one is your homework =) With that you can just run your script
> from anywhere and even incorporate it into other scripts and so on.
>
> Congratulations and welcome to the wonderful world of UNIX and Ruby
> Programming =)
> Oh and one last word of advice. AUTOMATE EVERYTHING!
>
> ~Stu (15 years hacking shells networks and BSDs and GNUs )
>
>
>
>
> On Wed, Jun 26, 2013 at 10:58 PM, Todd Sterben <lists / ruby-forum.com>wrote:
>
>> I am new to both linux and ruby.  I am using Ubuntu and Ruby 1.9
>>
>> When I do which ruby, I get /usr/bin/ruby
>> When I do ruby -v I get ruby 1.9.3p0 (2011-10-30 revision 33570)
>> [i686-linux]
>>
>> When I try to kick off a simple script
>>
>> #!/usr/bin/env
>>
>> puts "Hello"
>>
>> I get
>>
>> ./test.rb: line 1: #!/usr/bin/env: No such file or directory
>> ./test.rb: line 4: puts: command not found
>>
>>
>> Why?
>>
>> Thanks
>>
>> Todd
>>
>> --
>> Posted via http://www.ruby-forum.com/.
>>
>
>