I get a Input String from @read
command in makefile.
@read -p \"Enter Web Url:\" weburl; \\
I want to use the weburl variable in m
Be careful with $
sign in Makefile, especially when used in a shell statement.
You can replace your sed
command with this:
sed 's/^\(ServerName:\)$$/\1 '$$weburl'/' $(LOCALCONFIGDIR)/myfile.conf
Note the end of the line is $$
. Note also that variable substitution can't be done with single quote '
, that's why the variable is outside of it.
With some sed
optimisation, I'd rather advise you this:
sed "/^ServerName:/s/$$/ $$weburl/" $(LOCALCONFIGDIR)/myfile.conf