DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
Manipulating text with sed

The transform function

The transform function (y) takes two strings as arguments. It turns each instance of the first character in string 1 into the first character in string 2, then the second character in string 1 into the second character in string 2, and so on. In the following example, ``a'' is transformed into ``A'', irrespective of whether it is followed by ``b'':

y/abcde/ABCDE/

The components of the two strings are literals, and the transformation performed depends on position. As with the substitute command, y takes an optional address as an argument:

15y/abcde/ABCDE/


Next topic: Input-output functions
Previous topic: Substitute functions

© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 -- 03 June 2005