Suppose I have a string called very_long_string
whose content I want to send to the standard output. But since the string is very long, I want to use less
to display the text on the terminal. When I use
`less #{very_long_string}`
I get File not found
error message, and if I use:
`less <<< #{very_long_string}`
I get unexpected redirection
error message.
So, how to use less
from inside Ruby?