Copy text from web page and add to file

I need help to make a script for Ubuntu to OSCam that copy the text on this website that only contains "C: ip port randomUSERNAME password" and want to exclude the text "C:" and replace the rest with the old in my test.server file.

(line 22) device   = ip,port  
(line 23) user     = randomUSERNAME  
(line 24) password = password

the file location is /usr/local/etc/test.server . Please help someone! Regards

Not clear. Any attempts/ideas/thoughts from your side?

If the file is in your /usr/local, why do you need IP address and port? If this refers to a file system on a different host, have a look at the commands **rcp** and **scp**. They are usually used for transferring files between different hosts.

Don't know if I shall use wget or curl to just copy that text from the website. Can't be that hard because it's just a blank page with that text. And then divide up all (spaces) and store them into variables. Then erase the right line and add like device = StoredVariableA.. Don't know if it's possible in scripting from terminal.

---------- Post updated at 03:25 AM ---------- Previous update was at 03:24 AM ----------

I copy and paste the new information from that website and paste it into my config and I need to do it daily.

Sure it is possible, but from your posting, it is unclear, at which steps of this process you have questions. You should be more precise. If there is more than one issue, it is possible to create several threads instead of lumping everything into one question.

I have figured out how to remove C: from the text so I have now "randomIP randomPORT randomUSERNAME randomPASSWORD" but how to assign each one to a variable, like var1, var2, var3 and var4? The separator should be (space) ?

---------- Post updated at 11:33 AM ---------- Previous update was at 10:06 AM ----------

I fixed the script now.. Thanks anyways!

You need to be more precise, on what you have and what you want.

Is it correct, that you have in a shell variable a string consisting of words separated by spaces, and you want to assign the words to individual shell variables?

For which shell should the solution work?