Hi All
I have something that from the outset seems really trivial but in practice is not quite working.
I have the following code sample in my shell script which illustrates the problem
echo "enter home directory"
read home
mkdir $home/newdir
The user then enters a logical $HOME in the prompt. This is what is displayed on the screen
enter home directory
$HOME
mkdir: cannot create directory `$HOME/newdir': No such file or directory
If I type the full name into the prompt, it works fine. But this isn't ideal as in the real script, the directory structure could be 10 directories deep. Typing the full path could lead to potential issues.
Is there some way for the read command to interpret environment variables?
Thanks