954,525 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

(Need Help !Urgent) In dump Command

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

warangalboy
Newbie Poster
8 posts since Jul 2005
Reputation Points: 10
Solved Threads: 0
 

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?

shanenin
Posting Whiz in Training
217 posts since May 2005
Reputation Points: 10
Solved Threads: 17
 

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.

warangalboy
Newbie Poster
8 posts since Jul 2005
Reputation Points: 10
Solved Threads: 0
 

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

if so I will have to research that abit.

shanenin
Posting Whiz in Training
217 posts since May 2005
Reputation Points: 10
Solved Threads: 17
 

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

warangalboy
Newbie Poster
8 posts since Jul 2005
Reputation Points: 10
Solved Threads: 0
 

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

shanenin
Posting Whiz in Training
217 posts since May 2005
Reputation Points: 10
Solved Threads: 17
 

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

warangalboy
Newbie Poster
8 posts since Jul 2005
Reputation Points: 10
Solved Threads: 0
 

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/

shanenin
Posting Whiz in Training
217 posts since May 2005
Reputation Points: 10
Solved Threads: 17
 

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

warangalboy
Newbie Poster
8 posts since Jul 2005
Reputation Points: 10
Solved Threads: 0
 

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

shanenin
Posting Whiz in Training
217 posts since May 2005
Reputation Points: 10
Solved Threads: 17
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You