a2p
accept
access
acct
addftinfo
addr2line
adjtime
afmtodit
after
aio_cancel
aio_error
aio_read
aio_return
aio_suspend
aio_waitcomplete
aio_write
alias
aliases
alloc
anvil
append
apply
apropos
ar
array
as
asa
asn1parse
at
atq
atrm
attemptckalloc
attemptckrealloc
authlib
authtest
autopoint
awk
b64decode
b64encode
basename
batch
bc
bdes
bell
bg
bgerror
biff
big5
binary
bind
bindkey
bindtags
bindtextdomain
bio
bitmap
blowfish
bn
bootparams
bootptab
bounce
brandelf
break
breaksw
brk
bsdiff
bsdtar
bsnmpd
bspatch
bthost
btsockstat
buffer
builtin
builtins
bunzip2
button
byacc
bzcat
bzegrep
bzfgrep
bzgrep
bzip2
c2ph
c89
c99
ca
cal
calendar
canvas
cap_mkdb
case
cat
catch
catman
cc
cd
cdcontrol
chdir
checkbutton
checknr
chflags
chfn
chgrp
chio
chkey
chmod
chown
chpass
chroot
chsh
ci
ciphers
ckalloc
ckdist
ckfree
ckrealloc
cksum
cleanup
clear
clipboard
clock
clock_getres
clock_gettime
clock_settime
close
cmp
co
col
colcrt
colldef
colors
colrm
column
comm
command
compile_et
complete
compress
concat
config
connect
console
continue
core
courierlogger
couriertcpd
cp
cpan
cpio
cpp
creat
crl
crontab
crunchgen
crunchide
crypt
crypto
csh
csplit
ctags
ctm
ctm_dequeue
ctm_rmail
ctm_smail
cu
cursor
cursors
cut
cvs
date
dbiprof
dbiproxy
dc
dcgettext
dcngettext
dd
dde
default
defer
deliverquota
des
destroy
devfs
df
dgettext
dgst
dh
dhparam
dialog
diff
diff3
dig
dir
dirent
dirname
dirs
discard
disktab
dngettext
do
domainname
done
dprofpp
dsa
dsaparam
dtmfdecode
du
dup
dup2
eaccess
ec
ecdsa
echo
echotc
ecparam
ed
edit
editrc
ee
egrep
elf
elfdump
elif
else
enc
enc2xs
encoding
end
endif
endsw
engine
enigma
entry
env
envsubst
eof
eqn
err
errno
error
errstr
esac
ethers
euc
eui64
eval
event
evp
ex
exec
execve
exit
expand
export
exports
expr
extattr
extattr_delete_fd
extattr_delete_file
extattr_get_fd
extattr_get_file
extattr_set_fd
extattr_set_file
f77
false
famm
famx
fblocked
fbtab
fc
fchdir
fchflags
fchmod
fchown
fcntl
fconfigure
fcopy
fdescfs
fdformat
fdread
fdwrite
fetch
fg
fgrep
fhopen
fhstat
fhstatfs
fi
file
file2c
fileevent
filename
filetest
find
find2perl
finger
flex
flock
flush
fmt
focus
fold
font
fontedit
for
foreach
fork
format
forward
fpathconf
frame
from
fs
fstab
fstat
fstatfs
fsync
ftp
ftpchroot
ftpusers
ftruncate
futimes
g711conv
gb2312
gb18030
gbk
gcc
gcore
gcov
gdb
gencat
gendsa
genrsa
gensnmptree
getconf
getdents
getdirentries
getdtablesize
getegid
geteuid
getfacl
getfh
getfsstat
getgid
getgroups
getitimer
getlogin
getopt
getopts
getpeername
getpgid
getpgrp
getpid
getppid
getpriority
getresgid
getresuid
getrlimit
getrusage
gets
getsid
getsockname
getsockopt
gettext
gettextize
gettimeofday
gettytab
getuid
glob
global
gmake
goto
gperf
gprof
grab
grep
grid
grn
grodvi
groff
groff_font
groff_out
groff_tmac
grog
grolbp
grolj4
grops
grotty
group
groups
gunzip
gzcat
gzexe
gzip
h2ph
h2xs
hash
hashstat
hd
head
help2man
hesinfo
hexdump
history
host
hostname
hosts
hosts_access
hosts_options
hpftodit
http
hup
i386_get_ioperm
i386_get_ldt
i386_set_ioperm
i386_set_ldt
i386_vm86
iconv
id
ident
idprio
if
ifnames253
ifnames259
image
imapd
incr
indent
indxbib
info
infokey
inode
install
instmodsh
interp
intro
introduction
ioctl
ipcrm
ipcs
ipf
ipftest
ipnat
ippool
ipresend
issetugid
jail
jail_attach
jobid
jobs
join
jot
kbdcontrol
kbdmap
kcon
kdestroy
kdump
kenv
kevent
keycap
keylogin
keylogout
keymap
keysyms
kgdb
kill
killall
killpg
kinit
kldfind
kldfirstmod
kldload
kldnext
kldstat
kldsym
kldunload
klist
kpasswd
kqueue
kse
kse_create
kse_exit
kse_release
kse_switchin
kse_thr_interrupt
kse_wakeup
ktrace
label
labelframe
lam
lappend
last
lastcomm
lastlog
lchflags
lchmod
lchown
ld
ldap
ldapadd
ldapcompare
ldapdelete
ldapmodify
ldapmodrdn
ldappasswd
ldapsearch
ldapwhoami
ldd
leave
less
lesskey
lex
lgetfh
lhash
libnetcfg
library
limit
limits
lindex
link
linprocfs
linsert
lint
lio_listio
list
listbox
listen
lj4_font
lkbib
llength
lmtp
ln
load
loadfont
local
locale
locate
lock
lockf
log
logger
login
logins
logname
logout
look
lookbib
lorder
lower
lp
lpq
lpr
lprm
lptest
lrange
lreplace
ls
lsearch
lseek
lset
lsort
lstat
lsvfs
lutimes
lynx
m4
madvise
magic
mail
maildiracl
maildirkw
maildirmake
mailq
mailx
make
makeinfo
makewhatis
man
manpath
master
mc
mcedit
mcview
md2
md4
md5
mdc2
memory
menu
menubar
menubutton
merge
mesg
message
mincore
minherit
minigzip
mkdep
mkdir
mkfifo
mkimapdcert
mklocale
mknod
mkpop3dcert
mkstr
mktemp
mlock
mlockall
mmap
mmroff
modfind
modfnext
modnext
modstat
moduli
more
motd
mount
mprotect
mptable
msdos
msdosfs
msgattrib
msgcat
msgcmp
msgcomm
msgconv
msgen
msgexec
msgfilter
msgfmt
msggrep
msginit
msgmerge
msgs
msgunfmt
msguniq
mskanji
msql2mysql
msync
mt
munlock
munlockall
munmap
mv
myisamchk
myisamlog
myisampack
mysql
mysqlaccess
mysqladmin
mysqlbinlog
mysqlcheck
mysqld
mysqldump
mysqld_multi
mysqld_safe
mysqlhotcopy
mysqlimport
mysqlshow
mysql_config
mysql_fix_privilege_tables
mysql_zap
namespace
nanosleep
nawk
nc
ncal
ncplist
ncplogin
ncplogout
neqn
netconfig
netgroup
netid
netstat
networks
newaliases
newgrp
nex
nfsstat
nfssvc
ngettext
nice
nl
nm
nmount
nohup
nologin
notify
nroff
nseq
nslookup
ntp_adjtime
ntp_gettime
nvi
nview
objcopy
objdump
objformat
ocsp
od
onintr
open
openssl
opieaccess
opieinfo
opiekey
opiekeys
opiepasswd
option
options
oqmgr
pack
package
packagens
pagesize
palette
pam_auth
panedwindow
parray
passwd
paste
patch
pathchk
pathconf
pawd
pax
pbm
pcre
pcreapi
pcrebuild
pcrecallout
pcrecompat
pcrecpp
pcregrep
pcrematching
pcrepartial
pcrepattern
pcreperform
pcreposix
pcreprecompile
pcresample
pcretest
perl
perl56delta
perl58delta
perl561delta
perl570delta
perl571delta
perl572delta
perl573delta
perl581delta
perl582delta
perl583delta
perl584delta
perl585delta
perl586delta
perl587delta
perl588delta
perl5004delta
perl5005delta
perlaix
perlamiga
perlapi
perlapio
perlapollo
perlartistic
perlbeos
perlbook
perlboot
perlbot
perlbs2000
perlbug
perlcall
perlcc
perlce
perlcheat
perlclib
perlcn
perlcompile
perlcygwin
perldata
perldbmfilter
perldebguts
perldebtut
perldebug
perldelta
perldgux
perldiag
perldoc
perldos
perldsc
perlebcdic
perlembed
perlepoc
perlfaq
perlfaq1
perlfaq2
perlfaq3
perlfaq4
perlfaq5
perlfaq6
perlfaq7
perlfaq8
perlfaq9
perlfilter
perlfork
perlform
perlfreebsd
perlfunc
perlglossary
perlgpl
perlguts
perlhack
perlhist
perlhpux
perlhurd
perlintern
perlintro
perliol
perlipc
perlirix
perlivp
perljp
perlko
perllexwarn
perllinux
perllocale
perllol
perlmachten
perlmacos
perlmacosx
perlmint
perlmod
perlmodinstall
perlmodlib
perlmodstyle
perlmpeix
perlnetware
perlnewmod
perlnumber
perlobj
perlop
perlopenbsd
perlopentut
perlos2
perlos390
perlos400
perlothrtut
perlpacktut
perlplan9
perlpod
perlpodspec
perlport
perlqnx
perlre
perlref
perlreftut
perlrequick
perlreref
perlretut
perlrun
perlsec
perlsolaris
perlstyle
perlsub
perlsyn
perlthrtut
perltie
perltoc
perltodo
perltooc
perltoot
perltrap
perltru64
perltw
perlunicode
perluniintro
perlutil
perluts
perlvar
perlvmesa
perlvms
perlvos
perlwin32
perlxs
perlxstut
perror
pfbtops
pftp
pgrep
phones
photo
pic
pickup
piconv
pid
pipe
pkcs7
pkcs8
pkcs12
pkg_add
pkg_check
pkg_create
pkg_delete
pkg_info
pkg_sign
pkg_version
pkill
pl2pm
place
pod2html
pod2latex
pod2man
pod2text
pod2usage
podchecker
podselect
poll
popd
popup
posix_madvise
postalias
postcat
postconf
postdrop
postfix
postkick
postlock
postlog
postmap
postqueue
postsuper
pr
pread
preadv
printcap
printenv
printf
proc
procfs
profil
protocols
prove
proxymap
ps
psed
psroff
pstruct
ptrace
publickey
pushd
puts
pwd
pwrite
pwritev
qmgr
qmqpd
quota
quotactl
radiobutton
raise
rand
ranlib
rcp
rcs
rcsclean
rcsdiff
rcsfile
rcsfreeze
rcsintro
rcsmerge
read
readelf
readlink
readonly
readv
realpath
reboot
recv
recvfrom
recvmsg
red
ree
refer
regexp
registry
regsub
rehash
remote
rename
repeat
replace
req
reset
resolver
resource
return
rev
revoke
rfcomm_sppd
rfork
rhosts
ripemd
ripemd160
rlog
rlogin
rm
rmd160
rmdir
rpc
rpcgen
rs
rsa
rsautl
rsh
rtld
rtprio
rup
ruptime
rusers
rwall
rwho
s2p
safe
sasl
sasldblistusers2
saslpasswd2
sbrk
scache
scale
scan
sched
sched_getparam
sched_getscheduler
sched_get_priority_max
sched_get_priority_min
sched_rr_get_interval
sched_setparam
sched_setscheduler
sched_yield
scon
scp
script
scrollbar
sdiff
sed
seek
select
selection
semctl
semget
semop
send
sendbug
sendfile
sendmail
sendmsg
sendto
services
sess_id
set
setegid
setenv
seteuid
setfacl
setgid
setgroups
setitimer
setlogin
setpgid
setpgrp
setpriority
setregid
setresgid
setresuid
setreuid
setrlimit
setsid
setsockopt
settc
settimeofday
setty
setuid
setvar
sftp
sh
sha
sha1
sha256
shar
shells
shift
shmat
shmctl
shmdt
shmget
showq
shutdown
sigaction
sigaltstack
sigblock
sigmask
sigpause
sigpending
sigprocmask
sigreturn
sigsetmask
sigstack
sigsuspend
sigvec
sigwait
size
slapadd
slapcat
slapd
slapdn
slapindex
slappasswd
slaptest
sleep
slogin
slurpd
smbutil
smime
smtp
smtpd
socket
socketpair
sockstat
soelim
sort
source
spawn
speed
spinbox
spkac
splain
split
squid
squid_ldap_auth
squid_ldap_group
squid_unix_group
sscop
ssh
sshd_config
ssh_config
stab
startslip
stat
statfs
stop
string
strings
strip
stty
su
subst
sum
suspend
swapoff
swapon
switch
symlink
sync
sysarch
syscall
sysconftool
sysconftoolcheck
systat
s_client
s_server
s_time
tabs
tail
talk
tar
tbl
tclsh
tcltest
tclvars
tcopy
tcpdump
tcpslice
tcsh
tee
tell
telltc
telnet
term
termcap
terminfo
test
texindex
texinfo
text
textdomain
tfmtodit
tftp
then
threads
time
tip
tk
tkerror
tkvars
tkwait
tlsmgr
tmac
top
toplevel
touch
tput
tr
trace
trafshow
trap
troff
true
truncate
truss
tset
tsort
tty
ttys
type
tzfile
ui
ul
ulimit
umask
unalias
uname
uncomplete
uncompress
undelete
unexpand
unhash
unifdef
unifdefall
uniq
units
unknown
unlimit
unlink
unmount
unset
unsetenv
until
unvis
update
uplevel
uptime
upvar
usbhidaction
usbhidctl
users
utf8
utimes
utmp
utrace
uudecode
uuencode
uuidgen
vacation
variable
verify
version
vfork
vgrind
vgrindefs
vi
vidcontrol
vidfont
view
virtual
vis
vt220keys
vwait
w
wait
wait3
wait4
waitpid
wall
wc
wget
what
whatis
where
whereis
which
while
who
whoami
whois
window
winfo
wish
wm
write
writev
wtmp
x509
xargs
xgettext
xmlwf
xstr
xsubpp
yacc
yes
ypcat
ypchfn
ypchpass
ypchsh
ypmatch
yppasswd
ypwhich
yyfix
zcat
zcmp
zdiff
zegrep
zfgrep
zforce
zgrep
zmore
znew
_exit
__syscall
 
FreeBSD/Linux/UNIX General Commands Manual
Hypertext Man Pages
window
 
WINDOW(1)		FreeBSD General Commands Manual 	     WINDOW(1)

NAME
     window -- window environment

SYNOPSIS
     window [-t] [-f] [-d] [-e escape-char] [-c command]

DESCRIPTION
     The window utility implements a window environment on ASCII terminals.

     A window is a rectangular portion of the physical terminal screen associ-
     ated with a set of processes.  Its size and position can be changed by
     the user at any time.  Processes communicate with their window in the
     same way they normally interact with a terminal-through their standard
     input, output, and diagnostic file descriptors.  The window program han-
     dles the details of redirecting input and output to and from the windows.
     At any one time, only one window can receive input from the keyboard, but
     all windows can simultaneously send output to the display.

     When window starts up, the commands (see long commands below) contained
     in the file .windowrc in the user's home directory are executed.  If it
     does not exist, two equal sized windows spanning the terminal screen are
     created by default.

     The command line options are

     -t 	 Turn on terse mode (see terse command below).

     -f 	 Fast.	Do not perform any startup action.

     -d 	 Ignore .windowrc and create the two default windows instead.

     -e escape-char
		 Set the escape character to escape-char.  Escape-char can be
		 a single character, or in the form ^X where X is any charac-
		 ter, meaning control-X.

     -c command  Execute the string command as a long command (see below)
		 before doing anything else.

     Windows can overlap and are framed as necessary.  Each window is named by
     one of the digits ``1'' to ``9''.	This one-character identifier, as well
     as a user definable label string, are displayed with the window on the
     top edge of its frame.  A window can be designated to be in the
     foreground, in which case it will always be on top of all normal, non-
     foreground windows, and can be covered only by other foreground windows.
     A window need not be completely within the edges of the terminal screen.
     Thus a large window (possibly larger than the screen) may be positioned
     to show only a portion of its full size.

     Each window has a cursor and a set of control functions.  Most intelli-
     gent terminal operations such as line and character deletion and inser-
     tion are supported.  Display modes such as underlining and reverse video
     are available if they are supported by the terminal.  In addition, simi-
     lar to terminals with multiple pages of memory, each window has a text
     buffer which can have more lines than the window itself.

   Process Environment
     With each newly created window, a shell program is spawned with its
     process environment tailored to that window.  Its standard input, output,
     and diagnostic file descriptors are bound to one end of either a pseudo-
     terminal (see pty(4)) or a UNIX domain socket (see socketpair(2)).  If a
     pseudo-terminal is used, then its special characters and modes (see
     stty(1)) are copied from the physical terminal.  A termcap(5) entry tai-
     lored to this window is created and passed as environment (see
     environ(7)) variable TERMCAP.  The termcap entry contains the window's
     size and characteristics as well as information from the physical termi-
     nal, such as the existence of underline, reverse video, and other display
     modes, and the codes produced by the terminal's function keys, if any.
     In addition, the window size attributes of the pseudo-terminal are set to
     reflect the size of this window, and updated whenever it is changed by
     the user.	In particular, the editor vi(1) uses this information to
     redraw its display.

   Operation
     During normal execution, window can be in one of two states: conversation
     mode and command mode.  In conversation mode, the terminal's real cursor
     is placed at the cursor position of a particular window--called the cur-
     rent window--and input from the keyboard is sent to the process in that
     window.  The current window is always on top of all other windows, except
     those in foreground.  In addition, it is set apart by highlighting its
     identifier and label in reverse video.

     Typing window's escape character (normally ^P) in conversation mode
     switches it into command mode.  In command mode, the top line of the ter-
     minal screen becomes the command prompt window, and window interprets
     input from the keyboard as commands to manipulate windows.

     There are two types of commands: short commands are usually one or two
     key strokes; long commands are strings either typed by the user in the
     command window (see the ``:'' command below), or read from a file (see
     source below).

   Short Commands
     Below, # represents one of the digits ``1'' to ``9'' corresponding to the
     windows 1 to 9.  ^X means control-X, where X is any character.  In par-
     ticular, ^^ is control-^.	Escape is the escape key, or ^[.

     #	     Select window # as the current window and return to conversation
	     mode.

     %#      Select window # but stay in command mode.

     ^^      Select the previous window and return to conversation mode.  This
	     is useful for toggling between two windows.

     escape  Return to conversation mode.

     ^P      Return to conversation mode and write ^P to the current window.
	     Thus, typing two ^P's in conversation mode sends one to the cur-
	     rent window.  If the window escape is changed to some other char-
	     acter, that character takes the place of ^P here.

     ?	     List a short summary of commands.

     ^L      Refresh the screen.

     q	     Exit window.  Confirmation is requested.

     ^Z      Suspend window.

     w	     Create a new window.  The user is prompted for the positions of
	     the upper left and lower right corners of the window.  The cursor
	     is placed on the screen and the keys ``h'', ``j'', ``k'', and
	     ``l'' move the cursor left, down, up, and right, respectively.
	     The keys ``H'', ``J'', ``K'', and ``L'' move the cursor to the
	     respective limits of the screen.  Typing a number before the
	     movement keys repeats the movement that number of times.  Return
	     enters the cursor position as the upper left corner of the win-
	     dow.  The lower right corner is entered in the same manner.  Dur-
	     ing this process, the placement of the new window is indicated by
	     a rectangular box drawn on the screen, corresponding to where the
	     new window will be framed.  Typing escape at any point cancels
	     this command.

	     This window becomes the current window, and is given the first
	     available ID.  The default buffer size is used (see default_nline
	     command below).

	     Only fully visible windows can be created this way.

     c#      Close window #.  The process in the window is sent the hangup
	     signal (see kill(1)).  The csh(1) utility should handle this sig-
	     nal correctly and cause no problems.

     m#      Move window # to another location.  A box in the shape of the
	     window is drawn on the screen to indicate the new position of the
	     window, and the same keys as those for the w command are used to
	     position the box.	The window can be moved partially off-screen.

     M#      Move window # to its previous position.

     s#      Change the size of window #.  The user is prompted to enter the
	     new lower right corner of the window.  A box is drawn to indicate
	     the new window size.  The same keys used in w and m are used to
	     enter the position.

     S#      Change window # to its previous size.

     ^Y      Scroll the current window up by one line.

     ^E      Scroll the current window down by one line.

     ^U      Scroll the current window up by half the window size.

     ^D      Scroll the current window down by half the window size.

     ^B      Scroll the current window up by the full window size.

     ^F      Scroll the current window down by the full window size.

     h	     Move the cursor of the current window left by one column.

     j	     Move the cursor of the current window down by one line.

     k	     Move the cursor of the current window up by one line.

     l	     Move the cursor of the current window right by one column.

     y	     Yank.  The user is prompted to enter two points within the cur-
	     rent window.  Then the content of the current window between
	     those two points is saved in the yank buffer.

     p	     Put.  The content of the yank buffer is written to the current
	     window as input.

     ^S      Stop output in the current window.

     ^Q      Start output in the current window.

     :	     Enter a line to be executed as long commands.  Normal line edit-
	     ing characters (erase character, erase word, erase line) are sup-
	     ported.

   Long Commands
     Long commands are a sequence of statements parsed much like a programming
     language, with a syntax similar to that of C.  Numeric and string expres-
     sions and variables are supported, as well as conditional statements.

     There are two data types: string and number.  A string is a sequence of
     letters or digits beginning with a letter.  ``_'' and ``.'' are consid-
     ered letters.  Alternately, non-alphanumeric characters can be included
     in strings by quoting them in ``"'' or escaping them with ``\''.  In
     addition, the ``\'' sequences of C are supported, both inside and outside
     quotes (e.g., ``\n'' is a new line, ``\r'' a carriage return).  For exam-
     ple, these are legal strings: abcde01234, "&#$^*&#", ab"$#"cd, ab\$\#cd,
     "/usr/ucb/window".

     A number is an integer value in one of three forms: a decimal number, an
     octal number preceded by ``0'', or a hexadecimal number preceded by
     ``0x'' or ``0X''.	The natural machine integer size is used (i.e., the
     signed integer type of the C compiler).  As in C, a non-zero number rep-
     resents a boolean true.

     The character ``#'' begins a comment which terminates at the end of the
     line.

     A statement is either a conditional or an expression.  Expression state-
     ments are terminated with a new line or ``;''.  To continue an expression
     on the next line, terminate the first line with ``\''.

   Conditional Statement
     The window utility has a single control structure: the fully bracketed if
     statement in the form

	   if  then
	   
	   ...
	   elsif  then
	   
	   ...
	   else
	   
	   ...
	   endif

     The else and elsif parts are optional, and the latter can be repeated any
     number of times.   must be numeric.

   Expressions
     Expressions in window are similar to those in the C language, with most C
     operators supported on numeric operands.  In addition, some are over-
     loaded to operate on strings.

     When an expression is used as a statement, its value is discarded after
     evaluation.  Therefore, only expressions with side effects (assignments
     and function calls) are useful as statements.

     Single valued (no arrays) variables are supported, of both numeric and
     string values.  Some variables are predefined.  They are listed below.

     The operators in order of increasing precedence:

     <expr1> = <expr2>
		 Assignment.  The variable of name <expr1>, which must be
		 string valued, is assigned the result of <expr2>.  Returns
		 the value of <expr2>.

     <expr1> ? <expr2> : <expr3>
		 Returns the value of <expr2> if <expr1> evaluates true (non-
		 zero numeric value); returns the value of <expr3> otherwise.
		 Only one of <expr2> and <expr3> is evaluated.	<Expr1> must
		 be numeric.

     <expr1> || <expr2>
		 Logical or.  Numeric values only.  Short circuit evaluation
		 is supported (i.e., if <expr1> evaluates true, then <expr2>
		 is not evaluated).

     <expr1> && <expr2>
		 Logical and with short circuit evaluation.  Numeric values
		 only.

     <expr1> | <expr2>
		 Bitwise or.  Numeric values only.

     <expr1> ^ <expr2>
		 Bitwise exclusive or.	Numeric values only.

     <expr1> & <expr2>
		 Bitwise and.  Numeric values only.

     <expr1> == <expr2>, <expr1> != 
		 Comparison (equal and not equal, respectively).  The boolean
		 result (either 1 or 0) of the comparison is returned.	The
		 operands can be numeric or string valued.  One string operand
		 forces the other to be converted to a string in necessary.

     <expr1> < <expr2>, <expr1> > <expr2>, <expr1> <= <expr2>,
		 Less than, greater than, less than or equal to, greater than
		 or equal to.  Both numeric and string values, with automatic
		 conversion as above.

     <expr1> << <expr2>, <expr1> >> <expr2>
		 If both operands are numbers, <expr1> is bit shifted left (or
		 right) by <expr2> bits.  If <expr1> is a string, then its
		 first (or last) <expr2> characters are returns (if <expr2> is
		 also a string, then its length is used in place of its
		 value).

     <expr1> + <expr2>, <expr1> - <expr2>
		 Addition and subtraction on numbers.  For ``+'', if one argu-
		 ment is a string, then the other is converted to a string,
		 and the result is the concatenation of the two strings.

     <expr1> * <expr2>, <expr1> / <expr2>, <expr1> % <expr2>
		 Multiplication, division, modulo.  Numbers only.

     -<expr>, ~<expr>, !<expr>, $<expr>, $?<expr>
		 The first three are unary minus, bitwise complement and logi-
		 cal complement on numbers only.  The operator, ``$'', takes
		 <expr> and returns the value of the variable of that name.
		 If <expr> is numeric with value n and it appears within an
		 alias macro (see below), then it refers to the nth argument
		 of the alias invocation.  ``$?''  tests for the existence of
		 the variable <expr>, and returns 1 if it exists or 0 other-
		 wise.

     <expr>(<arglist>)
		 Function call.  <Expr> must be a string that is the unique
		 prefix of the name of a builtin window function or the full
		 name of a user defined alias macro.  In the case of a builtin
		 function, <arglist> can be in one of two forms:

		       , , ...
		       argname1 = , argname2 = , ...

		 The two forms can in fact be intermixed, but the result is
		 unpredictable.  Most arguments can be omitted; default values
		 will be supplied for them.  The argnames can be unique pre-
		 fixes of the argument names.  The commas separating arguments
		 are used only to disambiguate, and can usually be omitted.

		 Only the first argument form is valid for user defined
		 aliases.  Aliases are defined using the alias builtin func-
		 tion (see below).  Arguments are accessed via a variant of
		 the variable mechanism (see ``$'' operator above).

		 Most functions return value, but some are used for side
		 effect only and so must be used as statements.  When a func-
		 tion or an alias is used as a statement, the parentheses sur-
		 rounding the argument list may be omitted.  Aliases return no
		 value.

   Builtin Functions
     The arguments are listed by name in their natural order.  Optional argu-
     ments are in square brackets `[]'.  Arguments that have no names are in
     angle brackets `<>'.  An argument meant to be a boolean flag (often named
     flag) can be one of on, off, yes, no, true, or false, with obvious mean-
     ings, or it can be a numeric expression, in which case a non-zero value
     is true.

     alias([<string>], [<string-list>])
		 If no argument is given, all currently defined alias macros
		 are listed.  Otherwise, <string> is defined as an alias, with
		 expansion <string-list >>.  The previous definition of
		 <string>, if any, is returned.  Default for <string-list> is
		 no change.

     close(<window-list>)
		 Close the windows specified in <window-list>.	If
		 <window-list> is the word all, than all windows are closed.
		 No value is returned.

     cursormodes([modes])
		 Set the window cursor to modes.  Modes is the bitwise or of
		 the mode bits defined as the variables m_ul (underline),
		 m_rev (reverse video), m_blk (blinking), and m_grp (graphics,
		 terminal dependent).  Return value is the previous modes.
		 Default is no change.	For example, cursor($m_rev$m_blk) sets
		 the window cursors to blinking reverse video.

     default_nline([nline])
		 Set the default buffer size to nline.	Initially, it is 48
		 lines.  Returns the old default buffer size.  Default is no
		 change.  Using a very large buffer can slow the program down
		 considerably.

     default_shell([<string-list>])
		 Set the default window shell program to <string-list>.
		 Returns the first string in the old shell setting.  Default
		 is no change.	Initially, the default shell is taken from the
		 environment variable SHELL.

     default_smooth([flag])
		 Set the default value of the smooth argument to the command
		 window (see below).  The argument is a boolean flag (one of
		 on, off, yes, no, true, false, or a number, as described
		 above).  Default is no change.  The old value (as a number)
		 is returned.  The initial value is 1 (true).

     echo([window], [<string-list>])
		 Write the list of strings, <string-list>, to window, sepa-
		 rated by spaces and terminated with a new line.  The strings
		 are only displayed in the window, the processes in the window
		 are not involved (see write below).  No value is returned.
		 Default is the current window.

     escape([escapec])
		 Set the escape character to escape-char.  Returns the old
		 escape character as a one-character string.  Default is no
		 change.  Escapec can be a string of a single character, or in
		 the form -^X, meaning control-X.

     foreground([window], [flag])
		 Move window in or out of foreground.  Flag is a boolean
		 value.  The old foreground flag is returned.  Default for
		 window is the current window, default for flag is no change.

     label([window], [label])
		 Set the label of window to label.  Returns the old label as a
		 string.  Default for window is the current window, default
		 for label is no change.  To turn off a label, set it to an
		 empty string ("").

     list()	 No arguments.	List the identifiers and labels of all win-
		 dows.	No value is returned.

     select([window])
		 Make window the current window.  The previous current window
		 is returned.  Default is no change.

     source(filename)
		 Read and execute the long commands in filename.  Returns -1
		 if the file cannot be read, 0 otherwise.

     terse([flag])
		 Set terse mode to flag.  In terse mode, the command window
		 stays hidden even in command mode, and errors are reported by
		 sounding the terminal's bell.	Flag can take on the same val-
		 ues as in foreground above.  Returns the old terse flag.
		 Default is no change.

     unalias(alias)
		 Undefine alias.  Returns -1 if alias does not exist, 0 other-
		 wise.

     unset(variable)
		 Undefine variable.  Returns -1 if variable does not exist, 0
		 otherwise.

     variables()
		 No arguments.	List all variables.  No value is returned.

     window([row], [column], [nrow], [ncol], [nline], [label], [pty], [frame],
		 [mapnl], [keepopen], [smooth], [shell]).
		 Open a window with upper left corner at row, column and size
		 nrow, ncol.  If nline is specified, then that many lines are
		 allocated for the text buffer.  Otherwise, the default buffer
		 size is used.	Default values for row, column, nrow, and ncol
		 are, respectively, the upper, left-most, lower, or right-most
		 extremes of the screen.  Label is the label string.  Frame,
		 pty, and mapnl are flag values interpreted in the same way as
		 the argument to foreground (see above); they mean, respec-
		 tively, put a frame around this window (default true), allo-
		 cate pseudo-terminal for this window rather than socketpair
		 (default true), and map new line characters in this window to
		 carriage return and line feed (default true if socketpair is
		 used, false otherwise).  Normally, a window is automatically
		 closed when its process exits.  Setting keepopen to true
		 (default false) prevents this action.	When smooth is true,
		 the screen is updated more frequently (for this window) to
		 produce a more terminal-like behavior.  The default value of
		 smooth is set by the default_smooth command (see above).
		 Shell is a list of strings that will be used as the shell
		 program to place in the window (default is the program speci-
		 fied by default_shell, see above).  The created window's
		 identifier is returned as a number.

     write([window], [<string-list>])
		 Send the list of strings, <string-list>, to window, separated
		 by spaces but not terminated with a new line.	The strings
		 are actually given to the window as input.  No value is
		 returned.  Default is the current window.

   Predefined Variables
     These variables are for information only.	Redefining them does not
     affect the internal operation of window.

     baud   The baud rate as a number between 50 and 38400.

     modes  The display modes (reverse video, underline, blinking, graphics)
	    supported by the physical terminal.  The value of modes is the
	    bitwise or of some of the one bit values, m_blk, m_grp, m_rev, and
	    m_ul (see below).  These values are useful in setting the window
	    cursors' modes (see cursormodes above).

     m_blk  The blinking mode bit.

     m_grp  The graphics mode bit (not very useful).

     m_rev  The reverse video mode bit.

     m_ul   The underline mode bit.

     ncol   The number of columns on the physical screen.

     nrow   The number of rows on the physical screen.

     term   The terminal type.	The standard name, found in the second name
	    field of the terminal's TERMCAP entry, is used.

ENVIRONMENT
     The window utility utilizes these environment variables: HOME, SHELL,
     TERM, TERMCAP, WINDOW_ID.

FILES
     ~/.windowrc       startup command file.
     /dev/[pt]ty[pq]?  pseudo-terminal devices.

DIAGNOSTICS
     Should be self explanatory.

HISTORY
     The window command appeared in 4.3BSD.

FreeBSD 6.1		       December 30, 1993		   FreeBSD 6.1
=19215
+533
(84)