z/OS UNIX System Services User's Guide
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Inserting text at the beginning or end of a line

z/OS UNIX System Services User's Guide
SA23-2279-00

Use the s (substitute) subcommand and these two special substitution characters to insert text at the beginning or end of a line:
^ (circumflex)
Inserts text at the beginning of a line
$ (dollar sign)
Inserts text at the end of a line
  • To insert text at the beginning of the current working line, enter:
    s/^/newtext
  • To insert text at the beginning of a specified line, enter:
    ns/^/newtext
    where n is the number of the line. This line becomes the current working line.
  • To insert text at the end of the current working line, enter:
    s/$/newtext
  • To insert text at the end of a specified line, enter:
    ns/$/newtext
    where n is the number of the line. This line becomes the current working line.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014