Ok so I am using Bash to call a synFlood python script for class. I want to incorporate user input into this so I used Bash (since I was not allowed to use python). I have called my source and target IP's from the user and stored them and then made new variable for the entire string inside of the python script to replace with sed.
Currently my command is working and replacing the string. But when I end the script the string I said to replace is still the original string.
EXAMPLE:
sourcepath="src = $source" #set user source IP to full path for python script
targetpath="tgt = $target" #set user target IP to full path for python script
sed -e "s/^src.*/$sourcepath/" #replace the src string with sourcepath variable
sed -e "s/^tgt.*/$targetpath/" #replace the tgt string with targetpath variable
python syn.py
Sed replaces both strings in my python file to what the user specifies; as it shows it in the terminal window (for testing anyways, final script will hide this output). But when I check the file after ending the script nothing was changed and the default values are still there.
Does sed just change the values only in the context of the script while it's running? If so, when I call the python script in the follow on line will it use the values currently in there from my sed changes or will it use the default files in the python script?
Thanks in advance for the help and clarification.