On 2009-07-08, Oliver Saunders <oliver.saunders / gmail.com> wrote:
> $ ./args_test.rb <<donenow
>> i
>> like
>> jam
>> donenow
> []
>
> Can anyone explain this?

The script args_test.rb sees no command line arguments because the shell
didn't give it any.  Instead,

   This type of redirection instructs the shell to read input from the
   current source until a line containing only WORD (with no trailing
   blanks) is seen.  All of the lines read up to that point are then used
   as the standard input for a command.

- from the bash docs about here documents (not specific to bash though).
The opinion on jam was still available to the script on its standard
input, but nothing as an argument.
-- 
KM