We have problem defining variables between two shell scripts, basically what we want to do is run ./get_variables.sh
, and fill in the details for "Enter the domain: " and "Enter the vestacp password:" then get the details as variables in vestacp.sh
get_variables.sh
content
#!/bin/sh
echo "Enter the domain: "
read $domain
echo "Enter the vestacp password:"
read $rvp
/root/vestacp.sh $domain $rvp
and
vestacp.sh
content
sed -i s/VAR1/$domain/g config.php
sed -i s/VAR2/$rvp/g config.php
config.php
file content
VAR1
VAR2
VAR1 and VAR2 should be replaced by the data that we enter when running ./get_variables.sh using sed on vestacp.sh
The problem that we are getting just an empty config.php
after running ./get_variables.sh
./get_variables.sh
with. ./get_variables.sh
, not run it.) – AlexP Nov 21 '18 at 23:29read $domain
and notread domain
? – thrig Nov 21 '18 at 23:41