I am currently using bash scripts to edit files using vim, one such example of a line in my scripts is:
vim Inference.ini -c '%s/Train/Inf/g | wq'
which opens Inference.ini, replaces all instances of 'Train' with 'Inf' and saves and quits the file.
What I want to do is to pass a script variable into the vim command, which I thought would look something like:
${my_var}='Hello World'
vim Inference.ini -c '%s/Train/${my_var}/g | wq'
But unfortunately the above command does not work, the file opens but nothing is changed.