I have a simple shell script script.sh
:
echo "ubuntu:$1" | sudo chpasswd
I need to open the script, read it, insert the argument, and save it as a string like so: 'echo "ubuntu:arg_passed_when_opening" | sudo chpasswd'
using Python.
All the options suggested here actually execute the script, which is not what I want.
Any suggestions?