Answer the question
In order to leave comments, you need to log in
How to pass stdout to a variable in Linux?
Hello!
I have a python script that, when executed, outputs the name of the file being created.
How can I assign a value to a variable - the name of this file, so that I can then execute another command through the pipe?
Answer the question
In order to leave comments, you need to log in
Question about Linux or python functionality?
If the first, then:
#!/bin/bash
some_var=$(python some_script.py)
echo $some_var
python some_script.py
before the commandecho
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question