Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Shell Script + Write to File a String

Tags:

shell

I have a string

server.ip=192.168.1.200

And I need to write the above statement completely into the file.

How can this be done?

This is what I'm trying to do...

set client_config = xmlrpc_server.properties
echo 'serverurl=http://'${IP}':8000' >> %${client_config}%
echo 'port=/RPC2' >> %${client_config}%

It doesn't get added to the file.

like image 600
Vivek Avatar asked Dec 29 '09 07:12

Vivek


Video Answer


1 Answers

This worked for me

$ FOO="192.168.1.1"
$ echo "serverurl=http://$FOO:8000" >> x.conf
$ more x.conf
serverurl=http://192.168.1.1:8000

I'm using zsh. I verified it with bash as well. What's the problem you get when you do this?

like image 184
Noufal Ibrahim Avatar answered Oct 22 '22 22:10

Noufal Ibrahim