concept backtick in category ruby
appears as: backticks, The backticks

This is an excerpt from Manning's book The Well-Grounded Rubyist, Third Edition.
The system method calls a system program. Backticks (``) call a system program and return its output. The exec method replaces the current process by returning an external command.
To issue a system command with backticks, put the command between backticks. The main difference between system and backticks is that the return value of the backtick call is the output of the program you run:
>> d = `date` => "Sun Apr 22 08:49:11 EDT 2018\n" >> puts d Sun Apr 22 08:49:11 EDT 2018 => nil >> output = `cat` I'm typing into cat. Since I'm using backticks, I won't see each line echoed back as I type it. Instead, cat's output is going into the variable output. => "I'm typing into cat. Since I'm using backticks,\nI won't etc. >> puts output I'm typing into cat. Since I'm using backticks, I won't see each line echoed back as I type it. Instead, cat's output is going into the variable output.