So I have a configuration file that I want to change after receiving a prompted response from the user.
read -p 'Your RPC Username: ' RPC_USER
sleep 1s
echo -e "${YELLOW}"
echo "$RPC_USER"
echo "----------------"
echo "Is this correct?"
echo -e "${RED}"
select yn in "Yes" "No"; do
case $yn in
Yes ) break;;
No ) read -p 'New RPC Username: ' RPC_USER
echo "$RPC_USER"
esac
done
After this I want to change a file configuration say: test.conf. So I try:
sed -i '1i RPC_USERNAME="$RPC_USER"' ~/test.conf
But only thing I get is:
RPC_USERNAME="$RPC_USER"
Again this is to be able to paste these user input variables directly into the configuration file for them during the script.
Any help is greatly appreciated!