Re: What is branch in sed

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 23Aug2006 15:45, Dan Track <dan.track@xxxxxxxxx> wrote:
| Thanks for the info. As a small query I'm kind of understanding what b
| means, but what does "$b" mean and how does it affect the script. I
| thought what preceded b was the matching clause which dictates when a
| jump should be performed. So how does the "$" come into play?

The command:

	$b

is an ordinary branch that happens on the specified line. "$" is the
last line of the file. Without a label, "b" branches to the end of the
script. So this (being at the start of the script), effectively runs the
whole script on all lines _except_ the last line, because at the last
line the first thing it does is skip to the end of the script.

Cheers,
-- 
Cameron Simpson <cs@xxxxxxxxxx> DoD#743
http://www.cskk.ezoshosting.com/cs/

... I am oft regarded with amused scorn by most publishers and printers ...
        - Gareth Powell (2/5/94) SMH


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux