I have been playing around with erb from the command line recently. I wanted to make a dirt simple erb template, for example the following:
<%- name = "Joe"; quality = "fantastic" -%>
Hello. My name is <%= name %>. I hope your day is <%= quality %>.
erb -T - thatfile.erb
./thatfile.erb "Bill" "super"
If you are using unix, try following:
$ cat 1.erb Hello. My name is <%= name %>. I hope your day is <%= quality %>. $ (echo '<% name="Joe"; quality="fantastic" %>' && cat 1.erb) | erb Hello. My name is Joe. I hope your day is fantastic.