LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-30-2014, 02:15 PM   #1
Rachit7
LQ Newbie
 
Registered: Aug 2014
Posts: 1

Rep: Reputation: Disabled
Shell Script............


what is the command for copying multiple lines from a particular webpage ????
 
Old 08-30-2014, 02:29 PM   #2
jdkaye
LQ Guru
 
Registered: Dec 2008
Location: Westgate-on-Sea, Kent, UK
Distribution: Debian Testing Amd64
Posts: 5,464

Rep: Reputation: Disabled
Have you tried looking at the sed command. That should give you some ideas.
jdk
 
Old 08-30-2014, 02:38 PM   #3
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,275

Rep: Reputation: 370Reputation: 370Reputation: 370Reputation: 370
In addition to sed, grep and awk are good tools to know. It depends on which line(s) you want to copy and whether you know what they are in advance.
 
Old 08-30-2014, 03:37 PM   #4
joe_2000
Member
 
Registered: Jul 2012
Location: Aachen, Germany
Distribution: Void, Debian
Posts: 808

Rep: Reputation: 216Reputation: 216Reputation: 216
Quote:
Originally Posted by Rachit7 View Post
what is the command for copying multiple lines from a particular webpage ????
What step are you stuck with? To actually get the webpage you can use wget to download it to a local directory.
Then you can process the html with other command line tools. If you do not want to deal with the html code but only want to pull plain text lynx is a good solution. It has a command line option which lets you download a webpage and convert it to plain text.
E.g. like so
Code:
lynx -nonumbers -dump http://www.example.com/
The above command will print the content of the page to stdout, you may want to pipe it into another bash command or redirect it to a file on your disk.
If e.g. you wanted to only get the first three lines you could do
Code:
lynx -nonumbers -dump http://www.example.com/ | head -n 3
 
Old 08-30-2014, 04:45 PM   #5
Firerat
Senior Member
 
Registered: Oct 2008
Distribution: Debian Jessie / sid
Posts: 1,471

Rep: Reputation: 444Reputation: 444Reputation: 444Reputation: 444Reputation: 444
Quote:
Originally Posted by Rachit7 View Post
what is the command for copying multiple lines from a particular webpage ????
Code:
cp index.html copy.html
Copies multiple lines (ok, all lines)

I'm certain that is not what you need/want

Come back with actual details, including sample input and desired output and you will get real help
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Shell script for run an shell script on server using ssh bloodstreetboy Linux - Server 5 01-12-2013 04:23 AM
How to pass command line arguments from one shell script to another shell script VijayaRaghavanLakshman Linux - Newbie 5 01-20-2012 10:12 PM
Executing a Shell script with 654 permissions inside another shell script. changusee2k Linux - Newbie 2 06-07-2011 08:58 PM
shell script problem, want to use shell script auto update IP~! singying304 Programming 4 11-29-2005 06:32 PM


All times are GMT -5. The time now is 06:50 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration