LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 11-11-2008, 07:12 PM   #16
yousillygoose
LQ Newbie
 
Registered: Nov 2008
Posts: 17

Original Poster
Rep: Reputation: 0

Here is a question for you more specifically about lynx so I don't know if you can answer it. How do I have lynx load a webpage with the url to be found in a file?
 
Old 11-12-2008, 05:16 PM   #17
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by yousillygoose View Post
how do you output to a variable???
Continuing the previous example, say VARIABLE=$(grep "\]64 [100-200]" | cut -c35-36 ~/tempfile.$$)


Quote:
Originally Posted by yousillygoose View Post
Here is a question for you more specifically about lynx so I don't know if you can answer it. How do I have lynx load a webpage with the url to be found in a file?
If the file *only* contains the URI you could say 'lynx $(cat ~/somefile)', OTOH if the file contains more you best grep for the URI, like 'lynx $(grep the_URI ~/somefile)'. Maybe at this point it would be easier to post your script (preferably in BB code tags)?..
 
Old 11-12-2008, 08:00 PM   #18
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
Quote:
Originally Posted by yousillygoose View Post
Here is a question for you more specifically about lynx so I don't know if you can answer it. How do I have lynx load a webpage with the url to be found in a file?
You can make the contents of a file into a commandline argument by 'cat'ting it, inside backticks:
Code:
lynx `cat somefile_with_a_URL_in_it`
--- rod.
 
Old 12-19-2008, 01:01 AM   #19
yousillygoose
LQ Newbie
 
Registered: Nov 2008
Posts: 17

Original Poster
Rep: Reputation: 0
Hey Hey!!!

I appreciate all the help you have all given me. It definitely as the reason I finished all my script. I have a new problem!

I have a file that has either a 3 digit number or a 2 digit n umber with a bracket in front of it ([33). I need to remove this bracket from the file. I can't simply use the cut command because if it is not a brack and is an integer I need to keep the character. Do you know of any way I can cut only the bracket out? Or a possible way to only save numbers? Any help is appreciated.

ME!
 
Old 12-20-2008, 04:16 AM   #20
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Referring to post #17 where VARIABLE is 'VARIABLE=$(grep "\]64 [100-200]" | cut -c35-36 ~/tempfile.$$)', try adding a line before you reuse VARIABLE like:
'VARIABLE=$(echo ${VARIABLE}|sed -e "s|\[||" -e "s|]||")'
or
'VARIABLE=$(echo ${VARIABLE}|tr -d '[]')'
or
'VARIABLE=${VARIABLE:1:$[${#VARIABLE}-2]}'
or
'VARIABLE=${VARIABLE//[\]\[]/}'
 
  


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
Lynx Franklovesguinness Linux - Newbie 4 09-29-2008 06:49 PM
teaching shell scripting: cool scripting examples? fax8 Linux - General 1 04-20-2006 04:29 AM
lynx all the way!! mcd Linux - Newbie 1 08-30-2003 06:05 PM
No Lynx !!!!!! Ben_Ty Linux From Scratch 4 07-08-2003 11:59 AM
lynx nautilus_1987 Linux - Software 1 03-06-2003 11:48 AM

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

All times are GMT -5. The time now is 06:20 AM.

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