LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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 09-08-2011, 07:54 AM   #1
tsurendra
LQ Newbie
 
Registered: Sep 2011
Posts: 1

Rep: Reputation: Disabled
branch point in sed


how the branch point works

Code:
sed -e :a -e '$d;N;2,20ba' -e 'P;D' text
thanks
 
Old 09-08-2011, 09:27 AM   #2
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 9,245

Rep: Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684
http://www.grymoire.com/Unix/Sed.html#uh-58
 
Old 09-08-2011, 11:47 AM   #3
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Debian sid + kde 3.5 & 4.4
Posts: 6,823

Rep: Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957
As far as I know, branching only works within a single expression, so the above line will never work.

It would help if you showed us exactly what you were trying to do. What does the input text look like, and how do you want it to look afterward?
 
Old 09-08-2011, 08:30 PM   #4
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 9,245

Rep: Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684
I think you are correct David, about the single expression, so here I believe it would act on the 2,20 part, ie. between those
lines it will branch
 
  


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
Gnome Desktop makes 10 point font look like 64 point - how do I fix it? TonyC Linux - Desktop 5 03-03-2009 01:22 AM
LXer: Set up a SSH-based point to point connection LXer Syndicated Linux News 0 11-30-2008 10:50 PM
how far will 2.6 branch go? mariogarcia Linux - Kernel 1 01-05-2008 06:29 AM
telnet not work in Point to Point connected FC6 boxes techteacher Linux - Networking 4 05-06-2007 10:50 AM
Debian Branch Ipolit Debian 1 03-15-2007 12:54 PM


All times are GMT -5. The time now is 10:09 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