Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
SE(1)			    General Commands Manual			 SE(1)

NAME
       se - screen editor

SYNOPSIS
       se [ --acdfghiklmstuvwxyz ] [ file ... ]

DESCRIPTION
       Se is a screen oriented version of ed(1).  It accepts the same commands
       with a few differences.

       Se must be run from a CRT terminal.  It uses  the  termlib(3)  terminal
       operations  library,  which  retrieves  terminal	 capabilities from the
       /etc/termcap database.  For se to function, all of the  following  must
       be true:

       1.     You must have the	environment variable "TERM" set	to the name of
	      your terminal type.

       2.     The /etc/termcap database	must be	accessible, and	contain	an en-
	      try  for	your  terminal;	 or the	"TERMCAP" environment variable
	      must contain a description for your terminal.   (See  termlib(3)
	      for details.)

       3.     Your terminal must have the capability to	do cursor motion.

       Se first	clears the screen, draws in its	margins, and executes the com-
       mands in	the file ./.serc, or failing that, $HOME/.serc,	if either file
       exists.	 It then processes the command line, obeying the options given
       there, and begins reading your file (if you specified one).  The	 .serc
       file is only evaluated if the euid of se	matches	the owner for the file
       and no other users have permission to write to the file.	 The screen it
       draws  looks  something like this.  (The	parenthesized numerals are not
       part of the screen layout, but are there	to aid in the  following  dis-
       cussion.)

	    (1)	(2)		 (3)
	    A	  |
	    B	  |#include <stdio.h>
	    C	  |
	    D	 *|   register int i;
	    E	  |
	    .  -> |   for (i = 1; i <= 12; i++)
	    G	  |	 putc ('\n', stderr);
	    $	  |
	    cmd>  |_  (4)
	    11:39   myfile ........................  (5)

       The  display  is	divided	into five parts: (1) the line number area, (2)
       the mark	name area, (3) the text	area, (4) the command  line,  and  (5)
       the  status  line.   The	current	line is	indicated by the symbol	"." in
       the line	number area of the screen.  In addition, a  rocket  ("->")  is
       displayed to make the current line more obvious.	 The current mark name
       of each line is shown in	the markname area just to the left of the ver-
       tical bar.  Other information, such as the number of lines read in, the
       name of the file, and the time of day,  are  displayed  in  the	status
       line.

       The  cursor is positioned at the	beginning of the command line, showing
       you that	se awaits your command.	 You may now enter any of the standard
       ed  commands  and se will perform them, while making sure that the cur-
       rent line is always displayed on	the screen.

       You can set options to control the behavior of se on the	command	 line,
       simply  by  using a "-",	followed by the	option letter, and any parame-
       ters that the option may	take.  These options can also be set after in-
       voking  se  with	 the  options command, "o", explained in detail	in the
       section on commands. Here is a summary:

	    opt	= a | c	| d[dir] | f | g | h | i[a | indent] |
		 k | l[lop] | lm[col] |	m | s[filetype]	|
		    t[tabs] | u[char] |	v[col] | w[col]	|
		    x |	y[key] | z | -[lnr]

       There are only a	few other things that you need	know  to  successfully
       use se:

       1.     If you make an error, se automatically displays an error message
	      in the status line.  It also leaves your command line intact  so
	      that  you	 may change it using in-line editing commands (see the
	      "v" command).  If	you don't want to  bother  with	 changing  the
	      command, just hit	DEL to erase the command.

       2.     The  "p"	command	has a different	meaning	than in	ed.  When used
	      with line	numbers, it displays as	many of	the lines in the spec-
	      ified  range as possible (always including the last line).  When
	      used without line	numbers, "p" displays  the previous page.

       3.     The ":" command positions	a specified line at  the  top  of  the
	      screen  (e.g.,  "12:" positions the screen so that line 12 is at
	      the top).	 If no line number is specified, ":" displays the next
	      page.

       Keeping these few differences in	mind, you will see that	se can perform
       all of the functions of ed, while giving	the advantage  of  a  "window"
       into the	edit buffer.

       Below  is a summary of line number expressions, regular expressions and
       commands.  Where	there is no difference between se and ed  no  explana-
       tion is given.

   Line	Number Expressions
       n      nth line.

       .      current line.

       $      last line.

       ^      previous line.

       -      previous line.

       capital letter A
	      Ath  line	 on the	screen.	 Se has	a number of features that take
	      advantage	of the window display to minimize keystrokes and speed
	      editing.	 In  the line number area of the screen, se displays a
	      capital letter for each line, but	in "absolute line number" mode
	      (controlled  by  the  "oa"  command; see the options command) se
	      displays the actual line number of each line.

       #      number of	the first line on the screen.

       /regular	expression[/]
	      next line	with pattern.

       ?regular	expression[?]
	      previous line with pattern.

       >name  number of	the next line having the given markname	(search	 wraps
	      around, like //).

       <name  number  of  the  previous	line having the	given markname (search
	      proceeds in reverse, like	??).

       expression
	      any of the above operands	may be combined	 with  plus  or	 minus
	      signs  to	 produce  a line number	expression.  Plus signs	may be
	      omitted if desired (e.g.,	 /parse/-5,  /lexical/+2,  /lexical/2,
	      $-5, .+6,	.6).  Unlike ed, se does not recognize trailing	"+" or
	      "-" signs.  They must always be followed by a integer.   Succes-
	      sive  "+"	 or  "-" signs (e.g. "--") are also not	allowed.  How-
	      ever, like vi(1),	se will	allow you to leave  off	 the  trailing
	      delimiter	in forward searches, backward searches,	in the substi-
	      tute command, the	join command, and in the transliteration  com-
	      mand.

   Regular Expression Notation
       ^      beginning	of line	if first character in regular expression.

       .      any single character other than newline.

       $      end of line if last character in regular expression.

       [ccl] [^ccl]
	      character	set.

       *      0	or more	matches	of the preceding regular expression element.

       \      ignore  special  meaning	of the immediately following character
	      except "\(" and "\)".

       \(regular expression\)
	      Tags the text actually matched by	the sub-pattern	 specified  by
	      regular  expression for use in the replacement part of a substi-
	      tute command.

       &      Appearing	in the replacement part	of a substitute	command,  rep-
	      resents  the  text  actually  matched by the pattern part	of the
	      command.

       %      Appearing	as the only character in the replacement part,	repre-
	      sents  the replacement part used in the previous substitute com-
	      mand.  (This allows an empty replacement pattern as  well.)   If
	      there  are  other	 characters in the replacement part along with
	      the "%", the "%" is left alone.

       \digit Appearing	in the replacement part	of a substitute	command,  rep-
	      resents  the  text  actually  matched  by	the tagged sub-pattern
	      specified	by digit.

   File	names
       Se will expand environment variables which appear anywhere  in  a  path
       name.  Identifiers  in a	path name are treated as environment variables
       if they start with a dollar sign	"$".  A	real "$" can be	used if	it  is
       escaped.	 If the	named environment variable is not found, it is deleted
       from the	path name.  The	expanded path name will	be placed in the  sta-
       tus line.

   The .serc File
       When  se	starts up, it tries to open the	file .serc in your current di-
       rectory.	 If that file cannot be	found, it will	attempt	 to  open  the
       file .serc in your home directory.  If either file exists, se will read
       it, one line at a time, and execute each	line as	a command.  If a  line
       has  a "#" as the first character on the	line, or if the	line is	empty,
       the entire line is treated as a	comment,  otherwise  it	 is  executed.
       Here is a sample	.serc file:

	    # turn on tabs every 8 columns, auto indent
	    ot+8
	    oia

       The  .serc  file	is useful for setting up personalized options, without
       having to type them on the command line every time, and without using a
       special	shell  file  in	 your bin (for sh(1)).	The .serc file is only
       evaluated if the	euid of	se matches the owner for the file and no other
       users have permission to	write to the file.

       Command	line  options  are processed after commands in the .serc file,
       so, in effect, command line options can be used to  over-ride  the  de-
       faults in your .serc file.

       NOTE:  Commands	in  the	 .serc	file do	not go through that part of se
       which processes the special control characters (see below), so  do  not
       use them	in your	.serc file.

       Commands

       (.)a[:text]  Append
	      If the command is	followed immediately by	a colon, then whatever
	      text follows the colon is	 inserted  without  entering  "append"
	      mode.

       (.,.)c[:text]  Change
	      If the command is	followed immediately by	a colon, then whatever
	      text follows the colon is	inserted in place of the  named	 lines
	      without entering "append"	mode.

       (.,.)d  Delete

       e["!"|"x"] [filename]  Enter
	      "e!", enter now, is the same as "E" in ed.  "ex" enters the file
	      with "XTABS" turned on, i.e. expand any tabs  to	blanks.	  File
	      names  with extensions "s", "c", "h", "f"	and "r", are automati-
	      cally entered with "XTABS" turned	on.

       f [filename]  File

       (.,$)g/reg expr/command	Global on pattern

       none h[stuff] Help
	      This command provides access to  on-line	documentation  on  the
	      screen  editor.  "Stuff" may be used to select which information
	      is displayed.

       (.)i[:text]  Insert
	      If the command is	immediately followed by	a colon, then whatever
	      text  follows  is	 inserted without entering "append" mode.  The
	      current line pointer is left at the last line inserted.

       (^,.)j[/stuff[/]]     Join
	      Join is basically	the same in se and ed except if	no  line  num-
	      bers  are	 specified,  the  default is to	join the previous line
	      with the current line (as	opposed	to the current	line  and  the
	      next line), and se allows	you to indicate	what is	to replace the
	      newline(s) in "stuff".  The default is a single blank.   If  you
	      do  specify "stuff", the trailing	delimiter is optional. "j/" is
	      considered the same as "j//", i.e., the newline is deleted.

       (.,.)k[m]   marK
	      Se allows	marks to be any	single character other than a newline.
	      If  "m"  is  not	present, the lines are marked with the default
	      name of blank.  (Ed allows only lower case letters to be marks.)

       none  l	Locate
	      The Locate command places	the system name	into the  status  line
	      (e.g.  "gatech"  or "emory").  This is so	that one can tell what
	      machine he is using from within the screen editor. This is  par-
	      ticularly	 useful	 for installations with	many machines that can
	      run the editor, where the	user can switch	back and forth between
	      them, and	become confused	as to where he is at a given moment.

       (.,.)mline
	      Move

       (.,.)n[m]  Name
	      If  "m"  is  present,  the  last	line in	the specified range is
	      marked with it and all other lines having	 that  mark  name  are
	      given  the  default  mark	name of	blank.	If "m" is not present,
	      the names	of all lines in	the range are cleared.

       none  o[stuff]  Option
	      Editing options may be queried or	set.  "Stuff" determines which
	      options  are affected.  Options for se can be specified in three
	      ways; in the .serc file, on the command line that	invokes	se, or
	      with  the	 "o"  command.	To specify an option with the "o" com-
	      mand, just enter "o" followed immediately	by the	option	letter
	      and  its	parameters.  To	specify	an option on the command line,
	      just use "-" followed by the option letter and  its  parameters.
	      With this	second method, if there	are imbedded spaces in the pa-
	      rameter list, the	entire option should be	 enclosed  in  quotes.
	      For  example,  to	 specify the "a" (absolute line	number)	option
	      and tab stops at column 8	and every fourth thereafter  with  the
	      "o" command, just	enter

		   oa
		   ot 8	+4

	      when  se is waiting for a	command.  To enter the same options on
	      the invoking command line, you might use

		   se myfile -a	"-t 8 +4"

	      You may also choose to put options that  you  will  always  want
	      into  your  .serc	 file.	Commands in the	.serc file should look
	      exactly the same as they would if	they were typed	at the se com-
	      mand  line.   Command  line options will always over-ride	option
	      commands given in	your .serc file.

	      The following summarizes the available se	options:

	      a	     causes absolute line numbers to be	displayed in the  line
		     number  area  of  the  screen. The	default	behavior is to
		     display upper-case	letters	with  the  letter  "A"	corre-
		     sponding to the first line	in the window.

	      c	     inverts  the case of all letters you type (i.e., converts
		     upper-case	to lower-case and  vice	 versa).  This	option
		     causes  commands  to be recognized	only in	upper-case and
		     alphabetic	line numbers to	be  displayed  and  recognized
		     only  in  lower-case.  In this mode, se displays the line
		     number letters in lower case and expects its command let-
		     ters  in upper case.  Unshifted letters from the terminal
		     are converted to upper case and shifted letters to	 lower
		     case.

	      d[dir] selects the placement of the current line pointer follow-
		     ing a "d" (delete)	command.  Dir must be  either  ">"  or
		     "<".   If	">"  is	specified, the default behavior	is se-
		     lected: the line following	the deleted lines becomes  the
		     new  current line.	 If "<"	is specified, the line immedi-
		     ately preceding the deleted lines becomes the new current
		     line.   If	neither	is specified, the current value	of dir
		     is	displayed in the status	line.

	      f	     selects Fortran oriented options. This is	equivalent  to
		     specifying	 the "ot7 +3" option, and "XTABS" is turned on
		     (i.e.  tabs are expanded).

	      g	     controls the behavior of  the  "s"	 (substitute)  command
		     when  it  is under	the control of a "g" (global) command.
		     Initially,	if a substitute	inside a global	command	fails,
		     se	 will  not  continue  with the rest of the lines which
		     might succeed.  If	"og" is	given, then the	global substi-
		     tute  will	 continue,  and	lines which failed will	not be
		     affected.	Successive "og"	commands will toggle this  be-
		     havior.   An  explanatory message is placed in the	status
		     line.

	      h	     controls the use of hardware line insert/delete on	termi-
		     nals  that	 have  that  capability.  By default, line in-
		     sert/delete will be used if available.  It	 is  occasion-
		     ally useful to turn this option off when using the	editor
		     on	a terminal which can't keep up,	or if  the  communica-
		     tions  lines  may	be  scrambling the control characters.
		     Each successive "oh" merely toggles a switch  within  the
		     editor.   An  explanatory message is placed in the	status
		     line.

	      i[ a | indent ]
		     selects indent value for lines inserted with "a", "c" and
		     "i"  commands  (initially	1).   "a"  selects auto-indent
		     which sets	the indent to the value	which equals  the  in-
		     dent of the previous line.	 If neither "a"	nor indent are
		     specified,	the current indent value is displayed  in  the
		     status line.

	      k	     indicates	whether	the current contents of	your edit buf-
		     fer have been saved or not	by printing either  a  "saved"
		     or	"not saved" message on your status line.

	      l[lop] sets  the	line  number display option.  Under control of
		     this option, se continuously displays the value of	one of
		     three  symbolic  line  numbers.   lop may be ".", "#", or
		     "$".  If lop is omitted, the line number display is  dis-
		     abled.

	      lm[col]
		     sets  the left margin to col which	must be	a positive in-
		     teger.  This option will shift your entire	screen to  the
		     left,  enabling  you  to see characters at	the end	of the
		     line that were previously off the screen; the  characters
		     in	 columns  1  through col - 1 will not be visible.  You
		     may continue editing in the  normal  fashion.   To	 reset
		     your  screen  enter the command "olm 1".  If col is omit-
		     ted, the current left margin column is displayed  in  the
		     status line.

	      m	     controls  notification  of	 the presence of existing mail
		     and/or the	arrival	of new mail in the user's  mail	 file.
		     The  mail	file  is taken from the	"MAIL" variable	in the
		     user's environment.  On startup, if the mail file is  not
		     empty,  se	 will  remark,	"You have mail."  Then,	if new
		     mail arrives, se will remark, "You	have  new  mail,"  and
		     ring  the terminal's bell.	 The "m" option	simply toggles
		     a notification switch, so that the	user can turn off this
		     notification.  The	"om" command displays the current set-
		     ting of the notify	switch in the status line.

	      s[d | data | as |	s | c |	h | n |	nr | nroff | p | r | f]
		     sets other	options	for case, tabs,	etc., for data	files,
		     "d" or "data", assembly files, "as" or "s", C files, "c",
		     include files, "h", nroff files, "n" or "nr" or  "nroff",
		     ratfor  files, "r", pascal	files, "p", and	fortran	files,
		     "f".  Options set for data	and nroff files	are "ow74" and
		     "ot+4";  for  assembly  files  "ot	 17+8"	and "XTABS" is
		     turned on;	 for  C,  include,  pascal  and	 ratfor	 files
		     "ow74",  "ot+4"  and  "XTABS"  is	turned on; for fortran
		     files "ot 7+3" and	"XTABS"	is turned on.  If  "XTABS"  is
		     turned  on	 then  tabs  are  expanded.  If	no argument is
		     specified the options effected by this command revert  to
		     their default value.

	      t[tabs]
		     sets tab stops according to tabs.	Tabs consists of a se-
		     ries of numbers indicating	columns	in which tab stops are
		     to	be set.	 If a number is	preceded by a plus sign	("+"),
		     it	indicates that the number is an	increment;  stops  are
		     set  at regular intervals separated by that many columns,
		     beginning with the	most recently specified	absolute  col-
		     umn  number.  If no such number precedes the first	incre-
		     ment specification, the stops are set relative to	column
		     1.	  By  default, tab stops are set in every third	column
		     starting with column 1, corresponding to a	tabs  specifi-
		     cation  of	 "+3".	 If  tabs  is omitted, the current tab
		     spacing is	displayed in the status	line. Examples

			  ot 1 4 7 10 13 16 19 22 25 28	31 34  ...
			  ot +3
			  ot 7 +3

		     Once the tab stops	are set, the control-i	and  control-e
		     keys  can be used to move the cursor from its current po-
		     sition forward or backward	to the nearest	stop,  respec-
		     tively.

	      u[chr] Normally, se displays a non-printing character (e.g. NEW-
		     LINE, TAB ...)  as	a blank.  With this  option,  you  can
		     select  the  character  that  se displays in place	of un-
		     printable characters.  Chr	may be any  printable  charac-
		     ter.  If chr is omitted, se displays the current replace-
		     ment character on the status line.	 Non-printing  charac-
		     ters  (such  as se	control	characters), or	any others for
		     that matter, may be entered by hitting the	ESC  key  fol-
		     lowed  immediately	 by  the  key  to generate the desired
		     character.	 Note, however,	that the character you type is
		     taken  literally, exactly as it is	generated by your ter-
		     minal, so case conversion does not	apply.

	      v[col] sets the default "overlay column".	 This is the column at
		     which  the	cursor is initially positioned by the "v" com-
		     mand.  Col	must be	a positive integer, or a  dollar  sign
		     ($)  to indicate the end of the line.  If col is omitted,
		     the current overlay column	is  displayed  in  the	status
		     line.

	      w[col] sets the "warning threshold" to col which must be a posi-
		     tive integer. Whenever the	cursor is   positioned	at  or
		     beyond this column, the column number is displayed	in the
		     status line and the terminal's bell is sounded.   If  col
		     is	omitted, the current warning threshold is displayed in
		     the status	line.  The default warning  threshold  is  74,
		     corresponding  to	the first column beyond	the right edge
		     of	the screen on an 80 column crt.

	      x	     toggles tab  compression  and  expansion  ("XTABS").   If
		     XTABS  is	off,  "ox" turns it on for subsequent "r", and
		     "w", commands.  Be	aware that the "e" command checks  the
		     source  option  for  files; use the "ex" command to force
		     tab expansion.

	      y[key] allows you	to edit	encrypted files. "oy"  followed	 by  a
		     key  will cause the "e", "r", and "w" commands to encrypt
		     and decrypt files using crypt(1).	"oy"  by  itself  will
		     toggle  the  current  encryption setting.	If there is no
		     current key, se will ask you for one.  Echoing is	turned
		     off  while	 you type your key in, and se asks you to type
		     it	in twice, just to be sure.  If	encryption  is	turned
		     on,  and  you  type  a plain "oy",	it will	be turned off.
		     Note that doing so	causes se to forget the	value  of  the
		     encryption	 key.	Encryption in indicated	by the message
		     "ENCRYPT" in the status line.  The	key is never shown  on
		     your screen.

	      z	     suspends  the  editor (puts it in the background) and re-
		     turns to the user's shell.	 (It has to be	a  shell  that
		     understands  Berkeley  job	 control, or else you'll be in
		     trouble.)	The editor will	warn you if  the  edit	buffer
		     has  not been saved.  This	is the only way	to suspend the
		     editor; the editor	uses control-z for  its	 own  purposes
		     (see  the	section	on control characters, below).	If you
		     normally run /bin/sh without job  control,	 this  command
		     has no effect at all.

		     On	 UNIX  systems without the Berkeley job	control	mecha-
		     nism, this	option will be recognized, but	will  have  no
		     effect.   Instead,	 an explanatory	message	will be	placed
		     in	the status line.

	      -[lnr] splits the	screen at the line specified by	lnr which must
		     be	 a  simple line	number within the current window.  All
		     lines above lnr remain frozen on  the  screen,  the  line
		     specified	by lnr is replaced by a	row of dashes, and the
		     space below this row becomes the new window on the	 file.
		     Further  editing  commands	 do  not affect	the lines dis-
		     played in the top part of the screen.  If lnr is omitted,
		     the screen	is restored to its full	size.

       (.,.)p  Print
	      Prints all the lines in the given	range.	As much	as possible of
	      the range	is displayed, always including the last	 line;	if  no
	      range  is	 given,	 the  previous page is displayed.  The current
	      line pointer is left at the last line printed.

       q[!]  Quit
	      "q!", exit immediately, is the same as "Q" in ed.

       (.)r[x] [filename]  Read
	      If no line number	is specified, the named	file is	read  starting
	      after  current  line (as opposed to ed where the file is read at
	      the end of the edit buffer).  "rx" causes	tabs to	be expanded in
	      the lines	read.

       (.,.)s[/reg expr/sub[/][g][p]]	  Substitute
	      If  no  pattern  and replacement are specified after the "s", se
	      will behave as if	you had	typed  "s//%/",	 i.e.  for  the	 saved
	      search  pattern,	substitute  the	saved replacement pattern.  To
	      just delete a pattern, you may type "s/stuff", and se  will  be-
	      have as if you had typed "s/stuff//".

       (.,.)t<n>   Copy
	      ("To" is the ed mnemonic).

       u[d]  Undo
	      "u" undoes the effects of	the previous command, on the last line
	      affected (for instance a substitute command).  "ud"  undoes  the
	      last  delete,  i.e.  it  inserts the last	deleted	line after the
	      current line.  Se	does not have a	global undo capability.

       (.,.)v	oVerlay	-- screen oriented editing
	      Full screen editing with se is accomplished through the  use  of
	      control  characters for editing functions.  With screen oriented
	      editing, control characters may be used to modify	text  anywhere
	      in the buffer.  A	control-v may be used to quit overlay mode.  A
	      control-f	may be used to restore the current line	to its	origi-
	      nal  state  and terminate	the command.  Since se supports	such a
	      large number of control functions, the mnemonic value of control
	      character	 assignments  has  dwindled to almost zero.  About the
	      only thing mnemonic is that most symmetric functions  have  been
	      assigned	to  opposing  keys on the keyboard  (e.g., forward and
	      backward tab to control-i	and control-e,	forward	 and  backward
	      space  to	 control-g  and	control-h, skip	right and left to con-
	      trol-o and control-w, and	so on).	 We feel pangs	of  conscience
	      about  this,  but	can find no more satisfactory alternative.  If
	      you feel the control character assignments are terrible and  you
	      can find a better	way, you may change them by modifying the def-
	      initions in se and recompiling.

	      Except for a few special purpose ones, control characters	can be
	      used anywhere, even on the command line.	(This is why erroneous
	      commands are not erased -- you may want to edit them.)  Most  of
	      the functions work on a single line, but the cursor may be posi-
	      tioned anywhere in the buffer.  Refer to the next	section	 which
	      describes	each control character in detail.

       (1,$)w[+	| > | !] [filename]  Write
	      Write the	portion	of the buffer specified	to the named file.  If
	      "+" or ">" is given, the portion of the buffer  is  appended  to
	      the file;	otherwise the portion of the buffer replaces the file.
	      "w!", write immediately, is the same as "W" in ed.

       (1,$)x/reg expr/command	   eXclude on pattern

       (.,.)y[/from/to[/][p]]  TranslYterate (sic)
	      The range	of characters specified	by  "from"  is	transliterated
	      into the range of	characters specified by	"to". The last line on
	      which something was transliterated is printed if the "p"	option
	      is  used.	  The  last  line in the range becomes the new current
	      line.  As	with the substitute and	 join  commands,  and  pattern
	      searches,	the trailing delimiter is optional.  Se	saves both the
	      "from" and "to" parts of the transliterate command: "y"  is  the
	      same  as "y//%/",	i.e. transliterate the saved "from" range into
	      the saved	"to" range.  The "%" is	special	only if	it is the only
	      character	in the "to" part of the	command.

       (.,.)zbleft[,right][char]DrawBox
	      A	 box  is drawn on the given lines, in the given	columns, using
	      the given	char.  This command can	be used	as an aid for  prepar-
	      ing block	diagrams, flowcharts, or tables.

	      Line numbers are used to specify top and bottom row positions of
	      the box.	Left and right specify left and	right column positions
	      of  the box.  If second line number is omitted, the box degener-
	      ates to a	horizontal line.  If right-hand	column is omitted, the
	      box  degenerates to a vertical line.  If char is omitted,	it de-
	      faults to	blank, allowing	erasure	of a previously-drawn box.

	      For example, "1,10zb15,25*" would	draw a box 10 lines  high  and
	      11  columns  across,  using asterisks.  The upper	left corner of
	      the box would be on line 1, column 15, and the lower right  cor-
	      ner on line 10, column 25.

       (.)=  Equals what line number?

       (1,$)~mcommand  global exclude on markname
	      Similar to the "x" prefix	except that "command" is performed for
	      all lines	in the range that do not have the mark name "m".

       (1,$)'mcommand  global on markname
	      Similar to the "g" prefix	except that "command" is performed for
	      all lines	in the range that have the mark	name "m".

       (.):   display next page
	      The  next	 page  of the buffer is	displayed and the current line
	      pointer is placed	at the top of the window.

       none ![UNIX command]   escape to	the shell
	      The user's choice	of shell is taken from the "SHELL" environment
	      variable	(if it exists),	and is used to execute UNIX command if
	      it is present. Otherwise,	an interactive shell is	created.   Af-
	      ter  an  interactive  shell exits, the screen is immediately re-
	      drawn.  If a command was	run,  the  results  are	 left  on  the
	      screen, and the user must	type RETURN to redraw the editing win-
	      dow.  This is how	vi(1) behaves.	If the first character of  the
	      UNIX command is a	`!', then the `!' is replaced with the text of
	      the previous shell command.  An unescaped	`%' in the  UNIX  com-
	      mand  will be replaced with the current saved file name.	If the
	      shell command is expanded, se will echo it first,	and then  exe-
	      cute  it.	  This	behavior  is identical to the version of ed in
	      UNIX System V.

   Control Characters
       The set of control characters defined below can be used for  correcting
       mistakes	while typing regular editing commands, for correcting commands
       that have caused	an error message to be displayed, for correcting lines
       typed in	append mode, or	for in-line editing using the "v" command.

       control-a
	      Toggle  insert  mode.   The status of the	insertion indicator is
	      inverted.	 Insert	mode, when enabled, causes the characters  you
	      type  to	be inserted at the current cursor position in the line
	      instead of overwriting the characters  that  were	 there	previ-
	      ously.   When  insert mode is in effect, "INSERT"	appears	in the
	      status line.

       control-b
	      Scan right and erase.  The current line is scanned from the cur-
	      rent  cursor position to the right margin	until an occurrence of
	      the next character typed is found.  When the character is	found,
	      all  characters  from the	current	cursor position	up to (but not
	      including) the scanned character are deleted and	the  remainder
	      of  the  line is moved to	the left to close the gap.  The	cursor
	      is left in the same column which is now occupied by the  scanned
	      character.  If the line to the right of the cursor does not con-
	      tain the character being sought, the terminal's bell is sounded.
	      Se  remembers  the last character	that was scanned using this or
	      any of the other scanning	keys; if control-b is hit twice	 in  a
	      row, this	remembered character is	used instead of	a literal con-
	      trol-b.

       control-c
	      Insert blank.  The characters at and to the right	of the current
	      cursor position are moved	to the right one column	and a blank is
	      inserted to fill the gap.

       control-d
	      Cursor up.  The effect of	this key depends on se's current mode.
	      When  in	command	mode, the current line pointer is moved	to the
	      previous line without affecting  the  contents  of  the  command
	      line.   If  the current line pointer is at line 1, the last line
	      in the file becomes the new current line.	 In overlay mode (viz.
	      the  "v" command), the cursor is moved up	one line while remain-
	      ing in the same column.  In append mode, this key	is ignored.

       control-e
	      Tab left.	 The cursor is moved to	the nearest tab	 stop  to  the
	      left of its current position.

       control-f
	      "Funny"  return.	The effect of this key depends on the editor's
	      current mode. In command mode, the current command line  is  en-
	      tered  as-is,  but is not	erased upon completion of the command;
	      in append	mode, the current line is duplicated; in overlay  mode
	      (viz.  the  "v"  command),  the  current line is restored	to its
	      original state and command mode is reentered  (except  if	 under
	      control of a global prefix).

       control-g
	      Cursor right.  The cursor	is moved one column to the right.

       control-h
	      Cursor  left.  The cursor	is moved one column to the left.  Note
	      that this	does not erase any characters;	it  simply  moves  the
	      cursor.

       control-i
	      Tab  right.   The	 cursor	 is  moved to the next tab stop	to the
	      right of its current position.  Again, no	characters are erased.

       control-k
	      Cursor down.  As with the	control-d key, this key's  effect  de-
	      pends  on	 the current editing mode.  In command mode,  the cur-
	      rent line	pointer	is moved to the	next line without changing the
	      contents	of the command line. If	the current line pointer is at
	      the last line in the file, line 1	becomes	the new	current	 line.
	      In overlay mode (viz. the	"v" command), the cursor is moved down
	      one line while remaining in the same column.   In	 append	 mode,
	      control-k	has no effect.

       control-l
	      Scan  left.  The cursor is positioned according to the character
	      typed immediately	after the control-l.  In effect,  the  current
	      line  is	scanned, starting from the current cursor position and
	      moving left, for the first occurrence  of	 this  character.   If
	      none  is	found before the beginning of the line is reached, the
	      scan resumes with	the last character in the line.	 If  the  line
	      does  not	 contain  the  character being looked for, the message
	      "NOT FOUND" is printed in	the status  line.   Se	remembers  the
	      last  character that was scanned for using this key; if the con-
	      trol-l is	hit twice in  a	 row,  this  remembered	 character  is
	      searched	for  instead of	a literal control-l.  Apart from this,
	      however, the character typed after control-l is taken literally,
	      so se's case conversion feature does not apply.

       control-m
	      Kill right and terminate;	identical to the NEWLINE key described
	      below.

       control-n
	      Scan left	and erase.  The	current	line is	scanned	from the  cur-
	      rent  cursor  position to	the left margin	until an occurrence of
	      the next character typed is found.  Then that character and  all
	      characters  to its right up to (but not including) the character
	      under the	cursor are erased.  The	remainder of the line, as well
	      as  the  cursor  are moved to the	left to	close the gap.	If the
	      line to the left of the cursor does not  contain	the  character
	      being  sought,  the terminal's bell is sounded.  If control-n is
	      hit twice	in a row, the last character scanned for is  used  in-
	      stead of a literal control-n.

       control-o
	      Skip  right.   The  cursor is moved to the first position	beyond
	      the current end of line.

       control-p
	      Interrupt.  If executing any command except  "a",	 "c",  "i"  or
	      "v",  se aborts the command and reenters command mode.  The com-
	      mand line	is not erased.	This is	the only way to	interrupt  the
	      editor.	Se ignores the SIGQUIT signal (see signal(2)); in fact
	      it disables generating quits from	the terminal.  The editor uses
	      ASCII  FS	(control-\) for	its own	purposes, and changes the ter-
	      minal driver to make control-p be	the interrupt character.

       control-]
	      Fix screen.  The screen is reconstructed from se's internal rep-
	      resentation of the screen.

       control-r
	      Erase  right.   The  character at	the current cursor position is
	      erased and all characters	to its right are moved left one	 posi-
	      tion.

       control-j
	      Scan  right.   This  key	is  identical to the control-l key de-
	      scribed above, except that the scan proceeds to the  right  from
	      the current cursor position.

       control-t
	      Kill  right.   The  character at the current cursor position and
	      all those	to its right are erased.

       control-u
	      Erase left.  The character to the	left of	the current cursor po-
	      sition  is  deleted and all characters to	its right are moved to
	      the left to fill the gap.	 The cursor is	also  moved  left  one
	      column, leaving it over the same character.

       control-v
	      Skip right and terminate.	The cursor is moved to the current end
	      of line and the line is terminated.

       control-w
	      Skip left.  The cursor is	positioned at column 1.

       control-x
	      Insert tab.  The character under the cursor is  moved  right  to
	      the next tab stop; the gap is filled with	blanks.	 The cursor is
	      not moved.

       control-y
	      Kill left.  All characters to the	left of	the cursor are erased;
	      those at and to the right	of the cursor are moved	to the left to
	      fill the void.  The cursor is left in column 1.

       control-z
	      Toggle case conversion mode.  The	status of the case  conversion
	      indicator	 is  inverted;	if case	inversion was on, it is	turned
	      off, and vice versa.  Case inversion, when in effect, causes all
	      upper  case letters to be	converted to lower case, and all lower
	      case letters to be converted to upper case (just like the	alpha-
	      lock key on some terminals).  You	can type control-z at any time
	      to toggle	the case conversion mode.  When	case inversion	is  in
	      effect,  se  displays  the word "CASE" in	the status line.  Note
	      that se continues	to recognize alphabetic	line numbers in	 upper
	      case  only,  in contrast to the "case inversion" option (see the
	      description of options under the option command).

       control-_ (US)
	      Insert newline.  A newline character is inserted before the cur-
	      rent  cursor  position,  and the cursor is moved one position to
	      the right.  The newline is displayed according  to  the  current
	      non-printing replacement character (see the "u" option).

       control-\ (FS)
	      Tab  left	 and  erase.   Characters are erased starting with the
	      character	at the nearest tab stop	to the left of the  cursor  up
	      to  but  not including the character under the cursor.  The rest
	      of the line, including the cursor, is moved to the left to close
	      the gap.

	      Use control-p to interrupt the editor.

       control-^ (control-~, RS)
	      Tab  right  and  erase.  Characters are erased starting with the
	      character	under the cursor up to but not including the character
	      at the nearest tab stop to the right of the cursor.  The rest of
	      the line is then shifted to the left to close the	gap.

       NEWLINE
	      Kill right and terminate.	 The characters	at and to the right of
	      the  current cursor position are deleted,	and the	line is	termi-
	      nated.

       DEL    Kill all.	 The entire line is erased, along with any error  mes-
	      sage that	appears	in the status line.

       ESC    Escape.	The ESC	key provides a means for entering se's control
	      characters literally as text into	the file.  In fact, any	 char-
	      acter that can be	generated from the keyboard is taken literally
	      when it immediately follows the ESC key.	If  the	 character  is
	      non-printing (as are all of se's control characters), it appears
	      on the screen as the current non-printing	replacement  character
	      (normally	a blank	-- see the options command "ou").

   Windowing Systems
       On 4.3 BSD, and on the AT&T Unix/PC or 3B1, se notices when its current
       window changes size or is repositioned, and adjusts  the	 screen	 image
       accordingly.

FILES
       $HOME/.serc
	      se initialization	file.

       /usr/tmp/process	id.sequence_number
	      for scratch file.

       ./se.hangup
	      where se dumps its buffer	if it catches a	hang-up	signal.

       /usr/local/lib/se_h/*
	      help scripts for the "h" command.

DIAGNOSTICS
       Self explanatory	diagnostics appear in the status line.

CAVEATS
       Se will never dump its buffer into an encrypted file when it encounters
       a hang-up, even if encryption was turned	on at the time.

SEE ALSO
       Software	Tools, Software	Tools  in  Pascal,  Software  Tools  Subsystem
       User's  Guide, ed(1), crypt(1), ksh(1), scriptse(1), sh(1), vi(1), sig-
       nal(2), termlib(3), termio(7), environ(5), termcap(5)

BUGS
       Can only	be run from a script if	the script  is	first  passed  through
       scriptse(1).

       Tabs  could be handled better.  This is because se was originally writ-
       ten for Prime computers.

       Does not	check whether or not it	has been put into the background (this
       is  to  allow se	to be used with	the USENET news	software, which	does a
       poor job	of signal handling for child processes).

       Occasionally flakes out the screen when doing line inserts and deletes,
       due  to problems	within the termlib(3) package in putting out the right
       number of padding characters.  Type a control-] to redraw the screen.

       The auto-indent feature does not	recognize a line  consisting  of  just
       blanks  and  then  a "."	to terminate input, when the "." is not	in the
       same position as	the first non-blank character of the previous line.

       There is	no global undo capability.

       The help	screens	could use a rewrite.

AUTHORS
       Se started out as the version of	ed that	came with the  book  "Software
       Tools,"	by  Kernighan and Plauger, which was written in	Ratfor.	On the
       Pr1me computers at the School of	Information and	 Computer  Science  at
       Georgia Tech, Dan Forsyth, Perry	Flinn, and Alan	Akin added all the en-
       hancements suggested in the exercises in	the book,  and	some  more  of
       their own. Jack Waugh made extensive modifications to turn the line ed-
       itor into a screen editor; further work was done	by Dan Forsyth.	All of
       this was	in an improved Georgia Tech version of Ratfor.

       Later,  Dan  Forsyth,  then at Medical Systems Development Corporation,
       converted the Ratfor version into C, for	Berkeley Unix  (4.1  BSD).  At
       Georgia Tech, Arnold Robbins took the C version and added many new fea-
       tures and improvements, the most	important of which was termlib support
       and  System  V  support.	The existing help screens were edited and com-
       pleted at that time, as well. This was finished in early	1985.

       In early	2013, Thomas Cort continued maintenance	of se, modernizing the
       code  base and build system to support current POSIX operating systems.
       Thomas' primary motivation is to	preserve this bit  of  computing  his-
       tory.  His goals	are to squash any remaining bugs and make se as	porta-
       ble as possible.	No major new features will be added. He	can be reached
       at tcort@se-editor.org

				     local				 SE(1)

NAME | SYNOPSIS | DESCRIPTION | FILES | DIAGNOSTICS | CAVEATS | SEE ALSO | BUGS | AUTHORS

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=se&sektion=1&manpath=FreeBSD+12.2-RELEASE+and+Ports>

home | help