My goal is to write one liner for extracting URLs from text. The problem is that I'm not even able to read data from STDIN. My experiments so far:
└──> grep -i http: flashgot.log | python -c 'import sys; import re; for line in sys.stdin: print line'
File "<string>", line 1
import sys; import re; for line in sys.stdin: print line
^
SyntaxError: invalid syntax
└──> grep -i http: flashgot.log | python -c 'import sys; import re; x = [print line for line in sys.stdin]'
File "<string>", line 1
import sys; import re; x = [print line for line in sys.stdin]
^
SyntaxError: invalid syntax
Second plan was to use some of advises from here here here or here