Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

puts makes the Output not Pipeable, with print the Output can be pars… #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tyl0re
Copy link

@tyl0re tyl0re commented Jul 14, 2020

I don't know anything about ruby, but it seems puts Buffers the Output ,so piping
"|grep xy" doesn't work. With print the output can now be parsed

@ciembor
Copy link
Collaborator

ciembor commented Jul 20, 2020

Thanks for your PR. I checked and it looks grep works with puts. This is how I tested it:

(1..10).each_with_index do |i|
  puts "number #{i}"
end
[~]$ ruby a.rb | grep "number"                                                                                                                                *[master][2.6.3] 
number 1
number 2
number 3
number 4
number 5
number 6
number 7
number 8
number 9
number 10
[~]$ ruby a.rb | grep "5"                                                                                                                                     *[master][2.6.3] 
number 5
[~]$

@tyl0re so it looks it works with grep. Or you had some other usecase where it didn't work, if yes, could you share it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants