how can you pipe a variable from a python script with a bash command

Viewed 35

file.py:

file='file.zip'

bash:

./file.py | unzip file

how would you make the bash command work? take the variable from the python script and use it for piping in bash. I get the error:

$ ./file.py | unzip file
unzip:  cannot find or open file, file.zip or file.ZIP.
0 Answers
Related