Konstantin
Konstantin

Reputation: 3123

How can I pipe text output from a Ruby irb / pry session to a linux filter?

I scrape some webpages, and got html text. I would like to see the html as plain text. How can I pipe the text which is in a variable to a linux filter ( with statements "system" or %x{ } ) ?

Upvotes: 0

Views: 357

Answers (1)

Jay
Jay

Reputation: 94

You could try doing a here document. Like so:

irb << ! > output_file
IO.popen('dmidecode -t bios').each{ |i| puts i }
!

Upvotes: 1

Related Questions