New answers tagged pipe
Ok, stupid me, I should had read the documentation more carefully: The plain message is send to the script via stdin, I don't have to pass it in via command line parameters. in python it would be like import sys for line in sys.stdin: the_file.write(line)
In zsh, you can do the following: unzip =( curl http://example.com/someZipFile.zip )
I actually needed something a little more complex - extract a specific file if it exists. The difficulty being, the input file stream may not be a zip file, and in which case, I needed it to continue through the pipe. Here is my solution (thanks mostly to Jason R. Coombs solution) python -c "import zipfile,sys,StringIO data=sys.stdin.read() try: ...
Top 50 recent answers are included