problem in shell script for dhcp
I am creating a script to configure dhcp and I am just getting one problem. I want to pass Domain name as "myscript.com" but in dhcpd.conf I am only getting myscript.com with out quotes. I am also mentioning my coding for the same
echo "Enter Domain name: " read $dname echo " option domain-name "$dname"; >> /etc/dhcp/dhcpd.conf Output option domain-name myscript.com; However I want this myscript.com in double quotes Can any one please tell me what I am doing wrong |
You will need to escape it. Or use echo with -e option and use these: http://tldp.org/HOWTO/Bash-Prompt-HO...sequences.html and specify the octal number for a backslash.
Easier option would be to switch it to this: "\"$dname\"" |
To explain a bit more... when a special character is preceded by a backslash, \, it is treated literally and not expanded to its special value.
|
@Kustom42
Thanks man you rocks it worked thanks for your time and support
|
No worries, this forum keeps me sane during my slow time at work. You can mark the thread as solved under the "thread tools" drop down menu on top.
|
All times are GMT -5. The time now is 09:15 AM. |