J
John Joyce
Wow, seems that you can use double-quoted string style substitution
for backtick system calls.
say we make a list of some files:
ls = Dir.glob('*.doc')
some_file = ls[2]
on OS X there is the really convenient 'open' tool available at the
command line for example.
`open #{some_file}`
Whatever application is set to default for opening .doc files will be
called to open the file.
That's not the point as much as system calls via back ticks can be
sent variables and expressions from a Ruby script!
Very convenient!
for backtick system calls.
say we make a list of some files:
ls = Dir.glob('*.doc')
some_file = ls[2]
on OS X there is the really convenient 'open' tool available at the
command line for example.
`open #{some_file}`
Whatever application is set to default for opening .doc files will be
called to open the file.
That's not the point as much as system calls via back ticks can be
sent variables and expressions from a Ruby script!
Very convenient!