I work with CentOS and the only shell I work with is Bash.
I am trying to develop a Bash script which configures a content management system and I seek a way to make this script web application directory agnostic so that script users would be prompted about their web application directory path instead of me presenting them an hardcoded directory path which might be different than the one in their environment.
The only way I know to prompt data from a user and store it in a variable is read but I have a problem using it because the data might be variables and the current release of read can't naturally produce variables.
read web_application_root
$HOME/www
Brings '$HOME/www' (string) instead HOME_DIRECTORY_NAME/www (expanded variable).
This situation is a problem for me by itself but it creates a bigger problem for me in case the user input the prompt with even more complicated variable structures such as:
read domainread domain_dir
$web_application_root/$domain/public_html
How to prompt a user for variables without read?