xxxxxxxxxx
# Backticks syntax
`echo 'hi'`
# %x() syntax
%x( echo 'hi' )
# Kernel#system
# Executes the given command in a subshell.
system( "echo 'hi'" )
# Kernel#exec
# Replaces the current process by running the given external command.
exec( "echo 'hi'" )
# Open3
require "open3"
Open3.popen3('nroff -man') { |stdin, stdout, stderr| }
xxxxxxxxxx
Just call: ruby your_program.rb
# or
start your program with #!/usr/bin/env ruby,
make your file executable by running
`chmod +x your_program.rb`
# and do
`./your_program.rb some_param`