LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 09-21-2011, 05:18 AM   #1
sunlinux
Member
 
Registered: Feb 2006
Distribution: RHCL 5
Posts: 239

Rep: Reputation: 30
Capture string from URL/CURL


using php or shell script:

I have a text file that contains list of urls like:

url.txt has below:
http://server1:8300/cfusion/bootstrap/index.cfm
http://server1:8302/cfusion/bootstrap/index.cfm
http://server1:8303/cfusion/bootstrap/index.cfm

I need a string from each url , that I got already. but need to display info like below :

server1:8300 string
server1:8303 string

how do i do that

Last edited by sunlinux; 09-21-2011 at 06:37 AM.
 
Old 09-21-2011, 10:05 AM   #2
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Arch + Xfce
Posts: 6,852

Rep: Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037
Well, think about it. What steps are necessary to accomplish this?

1) Download the pages and store them temporarily (in files or variables).
2) Extract the strings you need from the text and store them in variables.
3) Print them out in the format you want.
4) Clean up, as necessary.

Figure out how to do each of these steps, and you'll have your solution. So just where are you having problems?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
C url capture and decode rblampain Programming 2 07-17-2011 03:40 AM
[SOLVED] curl -K command outputs weird symbols instead of downloading URL from file meridionaljet Linux - Newbie 7 05-16-2011 08:13 PM
Capture reponse of 20 different URL hits in single shell script saurabhmehan Linux - Newbie 4 08-05-2010 02:13 PM
Calling Remote Flash Game URL Using CURL stranger_6_7 Linux - General 0 05-13-2008 07:15 AM
Is sending password in url in curl secure? bjdea1 Linux - Security 1 09-08-2004 03:22 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:21 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration