- Put a script file in your
$PATH
directories. - Write shebang in that script.
- Give execute permission to script.
$ touch /usr/local/bin/ruby-echo
$ chmod +x /usr/local/bin/ruby-echo
Just echo command arguments.
#!/usr/bin/env ruby
ARGV.each do |argv|
puts argv
end
$ chmod +x ruby-echo
$ ruby-echo Are you happy hacking
Are
you
happy
hacking
- ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-darwin17]
- Mac OS X High Sierra