grep in pipeline: why it does not work -


i want extract information output of program. method not work. write rather simple script.

#!/usr/bin/env python  print "first hello world." print "second" 

after making script executable, type ./test | grep "first|second". expect show 2 sentences. not show anything. why?

escape expression.

$ ./test | grep "first\|second" first hello world. second 

also bear in mind shebang #!/usr/bin/env python, not #/usr/bin/env python.


Comments

Popular posts from this blog

how to insert data php javascript mysql with multiple array session 2 -

c++ - How to test/verify that zero-initialization takes place -

node.js - Webpack/TypeScript Raising Errors When node_modules is Excluded -