I want to automate a specific task, and I have a bash file that I want to read data from user arguments by running the script
bash my_script.sh /etc/??? path/dst
till now, I'm getting the data in my script by access to positional parameters ($1
, $2
) and variables, and that's fine.
But inside the script, I want to run a python program. So...
python test.py arg1 arg2 arg3
the things is, I have to read the data via python and access the output in my_script.sh
There is a constraint that I shouldn't create a file on the system. So I wonder about using export
, but export is volatile since it's storing the variable till that process is opened and when I get back to my_script.sh
, there isn't any clue of that data also I have no privilege to write my variable, and it's data on ~/.bashrc
.
Also, I have read this and this, but they don't work the way I wanted.
if you regard the way I'm doing it, is wrong, let me know, please.