Hello ,
Im trying to dump the content from a url in bash shell script but was unable to get.
im using the following code
URL="'some url=$var'"; > temp
system "-dump -nolist $URL > temp";
Plz let me know how can i dump the content of the url

I am having a little trouble following your code. could you explain what both lines of code are supposed to be doing?

isn't the 'system' command used in the C language? Are you trying to write the whole script using bash?

Thanks for a reply,

actually im trying to dump the content of a url into a temp file and i have to grep some content from the temp file and print it out when i execute the script.

when you say contents, do you mean the page source code of the URL?

if so I will have to research that abit.

yes ur correct
Plz Do let me know if you find a answer

before even writing a scripts you need a program(command) to get the source code. for instance this will download the soucecode of a page

wget http://www.daniweb.com/techtalkforums/thread7215.html

this will only work because it is an html file it is getting.

this technique will not work with

wget http://www.daniweb.com

because there is no html file to download.

The whole process of getting the html source code might be tricky

before even writing a scripts you need a program(command) to get the source code. for instance this will download the soucecode of a page

wget http://www.daniweb.com/techtalkforums/thread7215.html

this will only work because it is an html file it is getting.

this technique will not work with

wget http://www.daniweb.com

because there is no html file to download.

The whole process of getting the html source code might be tricky

Actually im Passing value to a url:
here is what i want to do , im passing a phone number to the url
http://www.whitepages.com/1014/log_click/search/Reverse_Phone?phone=
and after passing argument the result page content must be dumped in to a file.
so that i grep some content from the file

can u help me

you can do it with a program called links, it is a text web browser. this code will substitute the number given, then put the code into a file called temp

#!/bin/bash
echo "enter the phone number to search for"
read NUMBER
/usr/bin/links -source http://www.whitepages.com/10001/search/Reverse_Phone?phone=$NUMBER > temp

if you want just the output of the page, instead of the full source code use the -dump option instaed of the -source option. This is a lot cleaner and less stuff to look through.

here is a link to the needed program. It may be installed by defualt in most linux sytems.
http://artax.karlin.mff.cuni.cz/~mikulas/links/

It’s working out,
I really appreciate for your time and consideration.
Thanks a lot,

your welcome. I had fun doing it, and learned some stuff in the process :-)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.