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 -

multithreading - Exception in Application constructor -

windows - CertCreateCertificateContext returns CRYPT_E_ASN1_BADTAG / 8009310b -