Putting characters into a Lynx string-SOLVED by originator.
Shell scriping isn't my forte, so I wonder if some über-bashers out there can help me.
I use Zoneedit for my website to get around the fact that my DNS changes.
Previously, I used to use a script to detect if the ip changed, and update zoneedit.com accordingly.
The relevant line of the script was:
lynx -source -auth=myname:mypasswd \ 'http://dynamic.zoneedit.com/auth/dynamic.html?host=sweenytodd.com'
However, recently there's been some changes at my ISP. What happens now is that not my IP, but the proxy IP gets written. However, I've been digging a workaround, and found that
lynx -source -auth=myname:mypasswd \ 'http://dynamic.zoneedit.com/auth/dynamic.html?host=sweenytodd.com&dnsto123.456.789.11'
(obviously substitute names, passwords and IP) works.
Now, I can easily get my IP address. I know how to do that.
But what I want to do is substitute into the IP somehow, some command that will replace the 123.456.789.11 with my real address, before it gets sent to Zoneedit.
I'm sure there must be someone out there with 'witchy fingers' who could do this in seconds. I'm not familiar with sed, (tho' I'm sure that could do it)
The idea being that I could substitute this bit of code:
`/sbin/ifconfig ppp0 | grep inet | cut -f2 -d: | cut -f1 -d' '`
which gets my actual IP address correctly -
somehow into the line above, instead of the 123.45...bit.
Help greatly appreciated.
Forgive me for being stupid..it was so obvious, I missed this particular one.
The answer, of course, is to simply append (with the '+' sign) the ipaddress found with the bit between the two backticks (`/sbin/ifconfig ppp0......etc... `)
lynx -source -auth=myname:mypasswd \ 'http://dynamic.zoneedit.com/auth/dynamic.html?host=sweenytodd.com&dnsto123.456.789.11'+`/sbin/ifconfig ppp0 | grep inet | cut -f2 -d: | cut -f1 -d' '`
Which works beautifully.
What a putz...Winner of the Moron-of-the Week competition - on the first day of the week...
Last edited by andycrofts; 08-31-2003 at 11:36 AM.
Great thread! It's going to How I Did It!
insert characters bash
Registered Linux user #230403! Since March 2001! YAY.
Try doing a forum search or a google search before asking a question. And please don't use HELP! in the topic of your post... it's so lame... Please don't PM me for help-- post a question in the forum instead.
...check out another great forum:
Daniweb.com: where the cool techies unite