What is branch in sed

Cameron Simpson cs at zip.com.au
Sun Aug 27 05:02:44 UTC 2006


On 23Aug2006 15:45, Dan Track <dan.track at gmail.com> 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 at zip.com.au> 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




More information about the fedora-list mailing list