User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Shell Scripting section within the Software Development category of DaniWeb, a massive community of 403,098 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,132 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Shell Scripting advertiser: Programming Forums
Views: 2413 | Replies: 9
Reply
Join Date: Jul 2005
Posts: 8
Reputation: warangalboy is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
warangalboy warangalboy is offline Offline
Newbie Poster

(Need Help !Urgent) In dump Command

  #1  
Jul 30th, 2005
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
AddThis Social Bookmark Button
Reply With Quote  
Join Date: May 2005
Posts: 215
Reputation: shanenin is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 0
shanenin shanenin is offline Offline
Posting Whiz in Training

Re: (Need Help !Urgent) In dump Command

  #2  
Jul 30th, 2005
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?
Reply With Quote  
Join Date: Jul 2005
Posts: 8
Reputation: warangalboy is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
warangalboy warangalboy is offline Offline
Newbie Poster

Re: (Need Help !Urgent) In dump Command

  #3  
Jul 30th, 2005
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.
Reply With Quote  
Join Date: May 2005
Posts: 215
Reputation: shanenin is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 0
shanenin shanenin is offline Offline
Posting Whiz in Training

Re: (Need Help !Urgent) In dump Command

  #4  
Jul 30th, 2005
when you say contents, do you mean the page source code of the URL?

if so I will have to research that abit.
Reply With Quote  
Join Date: Jul 2005
Posts: 8
Reputation: warangalboy is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
warangalboy warangalboy is offline Offline
Newbie Poster

Re: (Need Help !Urgent) In dump Command

  #5  
Jul 30th, 2005
yes ur correct
Plz Do let me know if you find a answer
Reply With Quote  
Join Date: May 2005
Posts: 215
Reputation: shanenin is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 0
shanenin shanenin is offline Offline
Posting Whiz in Training

Re: (Need Help !Urgent) In dump Command

  #6  
Jul 30th, 2005
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
Reply With Quote  
Join Date: Jul 2005
Posts: 8
Reputation: warangalboy is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
warangalboy warangalboy is offline Offline
Newbie Poster

Re: (Need Help !Urgent) In dump Command

  #7  
Jul 30th, 2005
Originally Posted by shanenin
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_c...e_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
Reply With Quote  
Join Date: May 2005
Posts: 215
Reputation: shanenin is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 0
shanenin shanenin is offline Offline
Posting Whiz in Training

Re: (Need Help !Urgent) In dump Command

  #8  
Jul 30th, 2005
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/
Reply With Quote  
Join Date: Jul 2005
Posts: 8
Reputation: warangalboy is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
warangalboy warangalboy is offline Offline
Newbie Poster

Re: (Need Help !Urgent) In dump Command

  #9  
Jul 30th, 2005
It’s working out,
I really appreciate for your time and consideration.
Thanks a lot,
Reply With Quote  
Join Date: May 2005
Posts: 215
Reputation: shanenin is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 0
shanenin shanenin is offline Offline
Posting Whiz in Training

Re: (Need Help !Urgent) In dump Command

  #10  
Jul 30th, 2005
your welcome. I had fun doing it, and learned some stuff in the process :-)
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb Shell Scripting Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Other Threads in the Shell Scripting Forum

All times are GMT -4. The time now is 1:55 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC