Annotation of 43BSD/usr.lib/learn/editor/L38.1a, revision 1.1.1.1

1.1       root        1: #print
                      2: Sometimes it is desirable to specify that
                      3: the characters to be changed are at the beginning
                      4: of the line.  This uses the '^' character.  For example,
                      5:   s/^ab/xy/p
                      6: will change "ab" to "xy" ONLY if "ab" begins the line.
                      7: Remember that 
                      8:   s/ab/xy/p
                      9: would just change the first "ab" anywhere in the line.
                     10: In this directory there is a file "text"; whenever the
                     11: letters "cat" begin a line, change them to "mouse; but leave
                     12: other instances of "cat" unaltered.  Do this on each line (it only
                     13: takes one command, as you know).  Then rewrite the file and
                     14: type "ready".
                     15: #create Ref
                     16: mouse's paw
                     17: alley cat
                     18: mouse has nine lives
                     19: let the cat out of the bag
                     20: #create text
                     21: cat's paw
                     22: alley cat
                     23: cat has nine lives
                     24: let the cat out of the bag
                     25: #user
                     26: #cmp Ref text
                     27: #log
                     28: #next
                     29: 39.1a 10

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.