Plan 9 - Bell Labs

Document Sample
Plan 9 - Bell Labs Powered By Docstoc
					        2='

2HCH=AH I =K=
      8KA 


           Fourth Edition
               2002




 Computing Science Research Center
         Bell Laboratories
       Lucent Technologies
     Murray Hill, New Jersey
+FOHECDJ     K?AJ 6A?DCEAI 1? ) 4ECDJI 4AIAHLA@
2HJEI +FOHECDJ   ''& ''# )=@@E -JAHFHEIAI ) 4ECDJI 4AIAHLA@
2HJEI +FOHECDJ ''" >O 5K E?HIOIJAI +FKJAH +F=O ) HECDJI HAIAHLA@
2HJEI +FOHECDJ   +F=G +FKJAH +HFH=JE
2HJEI +FOHECDJ ''' AEJD 2=?=H@




+LAH,AIEC/AH=H@0=
6H=@A=HIHABAHA?A@EJDEI@?KAJ


2= ' EI = JH=@A=H B K?AJ 6A?DCEAI 1?
)=@@E /DIJI?HEFJ EI = JH=@A=H B )=@@E -JAHFHEIAI
)4 EI = JH=@A=H B )4 EEJA@
)L=IJ=H EI = HACEIJAHA@ JH=@A=H B 5J=H /=JA 6A?DCEAI 1?
+/) =@ 8/) =HA JH=@A=HI B 1JAH=JE= *KIEAII =?DEAI +HFH=JE
5EE? /H=FDE?I 1415 1@EC 1415 141: +D=ACA =@ 1@EC
    =HA HACEIJAHA@ JH=@A=HI B 5EE? /H=FDE?I 1?
1@O =@ 29-4 5AHEAI =HA JH=@A=HI B 5EE? /H=FDE?I 1?
-JDAHAJ EI = JH=@A=H B :AHN +HFH=JE
1* 25  =@ 2MAH2+ =HA HACEIJAHA@ JH=@A=HI B
    1JAH=JE= *KIEAII =?DEAI +HFH=JE
1JA =@ 2AJEK =HA HACEIJAHA@ JH=@A=HI B 1JA +HFH=JE
&&& & &$ &!&$ =@ &"&$ =HA JH=@A=HI B 1JA +HFH=JE
K?E@= EI = HACEIJAHA@ JH=@A=H B *ECAM  0AI
2AK?E@= EI = JH=@A=H B *ECAM  0AI
125 4! 4" =@ 4"" =HA HACEIJAHA@ JH=@A=HI B 125 6A?DCEAI 1?
4  =@ 4$ =HA JH=@A=HI B 125 6A?DCEAI 1?
E?HIBJ E?HIBJ 9H@ =@ E?HIBJ BBE?A =@ 5,5 =HA
    HACEIJAHA@ JH=@A=HI B E?HIBJ +HFH=JE
.5 EI = HACEIJAHA@ JH=@A=H B 5K E?HIOIJAI 1?
2,2 =@ 8): =HA HACEIJAHA@ JH=@A=HI B ,ECEJ= -GKEFAJ +HF
2IJ5?HEFJ EI = HACEIJAHA@ JH=@A=H B )@>A 5OIJAI 1?HFH=JA@
4  4$ 4" =@ 4"" =HA JH=@A=HI B 125 6A?DCEAI 1?
5A?KHAAJ EI = JH=@A=H B ,ECEJ= 2=JDM=OI 1?
5K@ *=IJAH EI = HACEIJAHA@ JH=@A=H B +HA=JELA =>I 1?
52)4+ EI = HACEIJAHA@ JH=@A=H B 52)4+ 1JAH=JE= 1?
7E?@A EI = HACEIJAHA@ ?AHJEBE?=JE =H B 7E?@A 1?
71: EI = HACEIJAHA@ JH=@A=H E JDA 75) =@ JDAH ?KJHEAI E?AIA@
    AN?KIELAO JDHKCD :FA +F=O EEJA@
                      Preface to the Fourth (2002) Edition




2= ' ?JEKAI J CHM =@ =@=FJ 6DA BKHJD =H HAA=IA B JDA IOIJA E?HF
H=JAI = K>AH B ?D=CAI >KJ JDA IJ ?AJH= EI JDA ?LAHIE J = AM LAHIE B
JDA '2 BEA IOIJA FHJ? 6DEI AM LAHIE M=I JEL=JA@ >O = @AIEHA J IKFFHJ BEAI
MEJD =A AAAJI CAH JD= % >OJAI JDA @ NAMELEN >KJ JDA FFHJKEJO M=I
J=A J ?D=CA = K>AH B JDAH JDECI =>KJ JDA FHJ? =EC EJ HA ABBE?EAJ
HA BANE>A =@ A=IEAH J A?=FIK=JA A IEFA >KJ E@EIFAI=>A AM BA=JKHA
=@A FIIE>A >O JDA FHJ? ?D=CA EI JD=J JDA IOIJA M HA?H@I JDA KIAH MD =IJ
@EBEA@=BEAJHO ls -m JE@AJEBOJDA?KFHEJ
=O =IFA?JI B IOIJA IA?KHEJO D=LA >AA EFHLA@ 6DA AM IA?KHEJO =CAJ
factotum" =EJ=EI KIAH F=IIMH@I MDEA secstore" AAFI JDA I=BA =@ A=>AI
IECA IEC J KJEFA @=EI =@ =?DEAI KIEC = L=HEAJO B IA?KHA FHJ?I
=@IAHLE?AI
6DHKCDKJ JDA IOIJA ?FAJI D=LA >AA HAMHEJJA =@ EJAHB=?AI @EBEA@ J
AEE=JA HAIJHE?JEI EFHLA FAHBH=?A =@ ?=HEBO @AIEC 6DA BK EIJ EI J C
J E?K@A DAHA >KJ IECEBE?=J ?D=CAI D=LA ??KHHA@ E = K>AH B IOIJA ?=I
wait  stat  mount  =@ errstr  JDA JDHA=@ E>H=HO thread  BH=JJA@ FHEJ
EC print  =@ fmtinstall  IA?KHEJO =O F=CAI E IA?JE  E?K@EC auth 
authsrv =@=OJDAHI
6DA ?D=CAI =HA IMAAFEC =@ =HA =??F=EA@ >O =O AM FHCH=I JI IAHLE?AI
=@ E>H=HEAI 5AA JDA =K= F=CAI =@ JDA =??F=OEC @?KAJI BH HA EBH
=JE

                                             *A=>I
                                             +FKJEC5?EA?A4AIA=H?D+AJAH
                                             KHH=O0E
                                             )FHE 
                      Preface to the Third (2000) Edition




) CHA=J @A= D=I D=FFAA@ J 2= ' E JDA BELA OA=HI IE?A EJI =IJ HAA=IA )JDKCD
K?D B JDA IOIJA ME IAA B=EE=H D=H@O =O =IFA?J B EJ EI K?D=CA@ 6DA AHA
D=I >AA DA=LEO HAMHA@ JDA CH=FDE?= ALEHAJ ?FAJAO HAMHEJJA =O ?
=@I =@@A@ @AAJA@ H HAF=?A@ =@ JDA E>H=HEAI CHA=JO ANF=@A@ 7@AHA=JD
JDKCD JDA I=A =FFH=?D J ?FKJEC HA=EI = @EIJHE>KJA@ IOIJA JD=J KIAI BEA
EA=ECJ=??AII=@?JHHAIKH?AI>JD?==@HAJA
5ABJDA?D=CAI=HAIMAAFEC
     )AB EI CA = ?=IK=JO B JDA ?IJ B =EJ=EEC KJEFA =CK=CAI ?FEAHI
     =@ E>H=HEAI E = @ELAHIA MH@ >KJ EJI @A BH FH?AIIAI J=II =@ ?KE
     ?=JEELAIE=AMJDHA=@E>H=HOBH+
     5KFFHJ BH ?H @EIF=OI EI K?D HA CAAH= >KE@EC  = AM =FD=>A@EC
     CH=FDE?= FAH=JH ?=A@ draw JD=J HAF=?AI JDA @ bitblt 2= ' I?HAAI =HA
     M@EI?HAAJO?HBK
     ) AM A?D=EI ?=A@ FK>EC ?A?JI =FFE?=JEI JCAJDAH E = L=HEAJO B
     M=OIIJ>LEKIOEJDAIKFFHJBKJEA@E=
     6DA EJAHB=?AI J JDA F=FO B HJ=JEC IJH=CA @ALE?AI D=LA >AA KEBEA@ =@
     ANJA@A@ MDEA FHLE@EC >AJJAH IKFFHJ BH D=LEC 2= ' ?ANEIJ MEJD JDAH FAH
     =JECIOIJAI=IECA@EI
     2AHD=FI IJ EFHJ=J JDEI HAA=IA B JDA IOIJA EI >AEC @A K@AH = FA
     IKH?A=CHAAAJFHLE@EC?IJBHAAIKH?AALA=??AIIJJDAIBJM=HA
2= ' ?JEKAI J >A JDA MH B =O FAFA *AIE@AI JDIA AJEA@ E JDA @
FHAB=?A JDAIA FAFA @AIAHLA F=HJE?K=H JA 4KII +N @E@ K?D B JDA MH KF@=JEC
JDA CH=FDE?I =@ ?HA=JEC JDA AM @EI =@ >JIJH=F @A =I MA =I FHLE@EC = K
>AH B AM ?=@I ,=LE@ 0C= FHJA@ 2= ' J JDA ,A? )FD= =@ 5=FA KA@AH
MHJAJDAAMJDHA=@E>H=HO
JDAH AM ?JHE>KJHI E?K@A *HK?A -EI +D=HAI .HIOJD -HE? 8= 0AI>AHCA =@
6=@0KJ

                                           *A=>I
                                           +FKJEC5?EA?A4AIA=H?D+AJAH
                                           KHH=O0E
                                           KA 
                     Preface to the Second (1995) Edition




     2= ' M=I >H E JDA I=A => MDAHA 7EN >AC= @ 7EN D=@I ME HA?CEA
JDA ?KJKH= DAHEJ=CA E JDEI =K= MDAHA LAAH=>A 7EN ?=@I ELA  @AI?HE>A@
E JDA ?=IIE? 7EN IJOA 7@AHA=JD JDKCD EAI = AM E@ B IOIJA HC=EA@
=HK@?KE?=JE=@=ECH=JDAHJD=BEAI=@FH?AIIAI
     1 2= ' @EIJHE>KJA@ ?FKJEC EI = ?AJH= FHAEIA J = ALKJE=HO =@@
6DA IOIJA HAEAI  = KEBH FHJ? J HABAH J =@ ?KE?=JA MEJD >A?JI
MDAJDAH JDAO >A @=J= H FH?AIIAI =@ MDAJDAH H J JDAO ELA  JDA I=A =?DEA H
ALA IEE=H =?DEAI ) IECA F=H=@EC MHEJEC J =A@ F=?AI KEBEAI = E@I B
?JH=@EJAHFH?AIIIEC=EC
      =A IF=?AI ?= >A >KEJ =H>EJH=HEO 1 F=HJE?K=H = FHCH=I =L=E=>A J = CELA
KIAH =HA ?KIJ=HEO KEJA@ E = IECA CE?= @EHA?JHO 6AFH=HO BEAI =@ KJHKIJA@
=?JELEJEAI ?= >A ?BEA@ E EI=JA@ IF=?AI 9DA = FHJ=>A =?DEA ?A?JI J JDA
?AJH= =H?DEL= BEA IOIJA JDA =?DEA I ?= =A IF=?A EI EA@ IJDO J JD=J
BJDA=H?DEL=BEAIOIJA 6DA=H?DEJA?JKHA=BBH@IJDAHKKIK==>EEJEAIE?K@EC
     >A?JI E =A IF=?AI EFHJA@ BH JDAH =?DEAI ALA BH BHAEC IOIJAI
     IK?D=I5,5=HAJH=IF=HAJO=??AIIE>A
     9E@MI=FFA=HE=AIF=?AI=F=HMEJDBEAI=@FH?AIIAI
     ) DEIJHE?= BEA IOIJA =MI A J =LEC=JA JDA =H?DEL= BEA IOIJA E JEA =I
     MA=IEIF=?A>=?KFBEAI=HA=M=OI=JD=@
     ) @A>KCCAH ?= D=@A IEKJ=AKIO =?JELA FH?AIIAI  @EIF=H=JA E@I B D=H@
     M=HA
     6DA ?D=H=?JAH IAJ B 2= ' EI 7E?@A MDE?D ?LAHI IJ B JDA MH@ I =H
I?HEFJI 6DA IOIJA D=I EJI M FHCH=EC =CK=CAI = @E=A?J B + MEJD IEFA
EDAHEJ=?A = IEFEBEA@ IDA =@ = +52EA ??KHHAJ =CK=CA )AB ) )51251:
AK=JH)2-=@EJIKHA?IJHK?JA@7EN?@A
     2= ' EI JDA MH B =O FAFA 6DA FHJ? M=I >ACK >O A 6DFI
=EC M=I EJACH=JA@ >O 4> 2EA =@ AJMHEC >O ,=LA 2HAIJJ 2DE 9EJAH>JJ
IEFEBEA@ JDA ==CAAJ B =A IF=?AI =@ HAACEAAHA@ JDA IOIJA 6DAO MAHA
EA@ >O 6 EE= E ?EA =@ 0M=H@ 6HE?AO E >HECEC JDA IOIJA KF  L=HE
KI =?DEAI =@ =EC @ALE?A @HELAHI 6DFI =@A JDA + ?FEAH 2EA ME
@M IOIJAI 6 ,KBB JDA IDA =@ H=IJAH CH=FDE?I 9EJAH>JJ )AB 6HE?AO ,KBB
=@ )@HAM 0KA )2- *> .=@HA= FHJA@ = OHE=@ B FHCH=I J 2= ' JDAH
?JHE>KJHI E?K@A )= *AHA>=K HE@= +DAHHO *E +DAIME? 5A= ,HM=H@
,=LE@ /=O 2=K /E? -HE? /HIIA D 0>>O /AH=H@ 0= *HE= AHECD= *=HJ
?=JDE ,KC ?1HO K@O 2=A 5A= 3KE= *> 4AIJHE? ,AEI 4EJ?DEA *=HA
5JHKIJHKF=@+EBB;KC
     2=' EI =@A =L=E=>A =I EI MEJDKJ BH= IKFFHJ >KJ IK>IJ=JE= ?AJI H
?JHE>KJEI=O>A?KE?=JA@JJDA=KJDHI

                                                            ,KC?1HO
                                                            =H?D''#
164                                                                                            164




NAME
       EJH   EJH@K?JE J 2= '
DESCRIPTION
      2= ' EI = @EIJHE>KJA@ ?FKJEC ALEHAJ =IIA>A@ BH IAF=H=JA =?DEAI =?JEC =I JAHE
      =I +27 IAHLAHI =@ BEA IAHLAHI ) KIAH MHI =J = JAHE= HKEC = ME@M IOIJA  = H=I
      JAH @EIF=O 5A ME@MI =HA ?A?JA@ J +27 IAHLAHI JDA EJAJ EI JD=J DA=LO ?FKJEC
      IDK@ >A @A E JDIA ME@MI >KJ EJ EI =I FIIE>A J ?FKJA  JDA JAHE= ) IAF=H=JA
      BEA IAHLAH FHLE@AI BEA IJH=CA BH JAHE=I =@ +27 IAHLAHI =EA
  Name Spaces
     1 2= ' =IJ = >A?JI  EA BEAI 6DA >A?J HAJHEALA@ >O = CELA =A EI @AJAHEA@ >O
     = =FFEC ?=A@ JDA name space ) GKE? JKH B JDA IJ=@=H@ =A IF=?A EI E namespace"
     -LAHO FHCH= HKEC E 2= ' >ACI J = process group IAA rfork E fork  =@ JDA =A
     IF=?A BH A=?D FH?AII CHKF ?= >A E@AFA@AJO ?KIJEA@
       ) =A IF=?A EI DEAH=H?DE?=O IJHK?JKHA@ ) BK BEA =A =I ?=A@ = full path name D=I JDA
       BH
               e1e2 en
       6DEI HAFHAIAJI = >A?J E = JHAA B BEAI JDA JHAA D=I = HJ HAFHAIAJA@ >O JDA BEHIJ / JDA HJ
       D=I = ?DE@ BEA =A@ e1 MDE?D E JKH D=I ?DE@ e2 =@ I  JDA @AI?A@AJ en EI JDA >A?J
       HAFHAIAJA@ >O JDA F=JD =A
       6DAHA =HA = K>AH B 2= ' services =L=E=>A A=?D B MDE?D FHLE@AI = JHAA B BEAI ) =A
       IF=?A EI >KEJ >O binding IAHLE?AI H IK>JHAAI B IAHLE?AI J =AI E JDA =AIF=?AIB=H
       6OFE?=O = KIAH I DA BEA IAHLAH EI >K@ J JDA HJ B JDA =A IF=?A =@ JDAH IAHLE?AI =HA
       >K@ J ?LAJE=O =A@ IK>@EHA?JHEAI .H AN=FA JDAHA EI = IAHLE?A HAIE@AJ E JDA
       FAH=JEC IOIJA BH =??AIIEC D=H@M=HA @ALE?AI =@ JD=J EI >K@ J /dev >O ?LAJE AH
       A IAHLE?AI D=LA =AI KJIE@A JDA =A IF=?A JD=J =HA = # IEC BMA@ >O = IECA AJJAH BH
       AN=FA #c EI ?LAJE=O >K@ J /dev
       2= ' D=I union directories @EHA?JHEAI =@A B IALAH= @EHA?JHEAI = >K@ J JDA I=A =A
       6DA @EHA?JHEAI =EC KF = KE @EHA?JHO =HA H@AHA@ E = EIJ 9DA JDA >E@ECI =HA =@A IAA
       bind B=CI IFA?EBO MDAJDAH = AMO >K@ A>AH CAI =J JDA DA=@ H JDA J=E B JDA EIJ H
       ?FAJAO HAF=?AI JDA EIJ 6  KF = =A E = KE @EHA?JHO A=?D A>AH @EHA?JHO EI
       IA=H?DA@ E EIJ H@AH KJE JDA =A EI BK@ ) >E@ B=C IFA?EBEAI MDAJDAH BEA ?HA=JE EI =MA@
       E = A>AH @EHA?JHO = BEA ?HA=JA@ E JDA KE @EHA?JHO CAI E JDA BEHIJ A>AH @EHA?JHO E
       EIJ H@AH JD=J =MI ?HA=JE EB =O
       6DA CKA JD=J D@I 2= ' JCAJDAH EI = AJMH FHJ? ?=A@ 9P @AI?HE>A@ E IA?JE # B JDEI
       =K= ) 2= ' IAHLAHI HA=@ =@ HAIF@ J '2 HAGKAIJI J =LEC=JA JDHKCD = BEA JHAA =@ J
       FAHBH FAH=JEI IK?D =I HA=@EC =@ MHEJEC BEAI MEJDE JDA JHAA
  Booting
     9DA = JAHE= EI FMAHA@  H HAIAJ EJ KIJ >A J@ JDA =A B = BEA IAHLAH J >J BH JDA
     FAH=JEC IOIJA AHA J >J =@ = KIAH =A =@ F=IIMH@ 0M JDEI @E=C FH?AA@I EI
     ALEHAJ =@ =?DEA@AFA@AJ ?A EJ EI ?FAJA JDA JAHE= =@I = 2= ' AHA
     MDE?D IAJI IA ALEHAJ L=HE=>AI IAA env! =@ >KE@I = EEJE= =A IF=?A 5AA
     namespace" boot& =@ init& BH @AJ=EI >KJ IA EFHJ=J =IFA?JI B JDA EEJE= =A
     IF=?A =HA
               6DA ALEHAJ L=HE=>A $cputype EI IAJ J JDA =A B JDA AHA I +27 I =H?DEJA?JKHA
               A B alpha mips sparc power 2MAH 2+ 386 !&$ "&$ 2AJEK  AJ? 6DA
               ALEHAJ L=HE=>A $objtype EI EEJE=O JDA I=A =I $cputype
               6DA ALEHAJ L=HE=>A $terminal EI IAJ J = @AI?HEFJE B JDA =?DEA HKEC JDA
               AHA IK?D =I generic pc 5AJEAI JDA E@@A MH@ B $terminal A?@AI JDA
               BEA BH MDE?D JDA AHA EI >JA@ AC alpha apc axp EI >JIJH=FFA@ BH
               /alpha/bapc
               6DA ALEHAJ L=HE=>A $service EI IAJ J terminal JDAH M=OI B =??AIIEC 2=
               ' =O IAJ $service J A B cpu con H rx




                                                     
164                                                                                        164



              6DA ALEHAJ L=HE=>A $user EI IAJ J JDA =A B JDA KIAH MD >JA@ JDA JAHE=
              6DA ALEHAJ L=HE=>A $home EI IAJ J JD=J KIAH I DA @EHA?JHO
              /$cputype/bin =@ /rc/bin =HA KEA@ EJ /bin
      )BJAH >JEC JDA  JAHE=   HKI     JDA    ?=@       EJAHFHAJAH              rc    
      /usr/$user/lib/profile =BJAH LEC J JDA KIAH I DA @EHA?JHO
      0AHA EI = JOFE?= FHBEA
              bind −a $home/bin/rc /bin
              bind −a $home/bin/$cputype /bin
              bind −c $home/tmp /tmp
              font = /lib/font/bit/pelm/euro.9.font
              upas/fs
              switch($service){
              case terminal
                   plumber
                   prompt=(’term% ’ ’ ’)
                   exec rio −f $font
              case cpu
                   bind /mnt/term/dev/cons /dev/cons
                   bind /mnt/term/dev/consctl /dev/consctl
                   bind −a /mnt/term/mnt/wsys /dev
                   prompt=(’cpu% ’ ’   ’)
                   news
              case con
                   prompt=(’cpu% ’ ’   ’)
                   news
              }
      6DA BEHIJ JDHAA EAI HAF=?A /tmp MEJD = tmp E JDA KIAH I DA @EHA?JHO =@ KE FAHI=
      bin @EHA?JHEAI MEJD /bin J >A IA=H?DA@ =BJAH JDA IJ=@=H@ bin @EHA?JHEAI 6DA ANJ IJ=HJI JDA
      =E BEA IOIJA IAA mail 6DA @EBBAHAJ JDECI D=FFA @AFA@EC  JDA $service ALEH
      AJ L=HE=>A IK?D =I HKEC JDA ME@M IOIJA rio  = JAHE=
      6 @ DA=LO MH IK?D =I ?FEEC JDA cpu ?=@ ?A?JI = ME@M J = +27 IAHLAH JDA
      I=A ALEHAJ L=HE=>AI =HA IAJ J @EBBAHAJ L=KAI =@ JDA I=A FHBEA EI HK 6DA EEJE=
      @EHA?JHO EI JDA ?KHHAJ @EHA?JHO E JDA JAHE= ME@M MDAHA cpu M=I JOFA@ 6DA L=KA B
      $service ME >A cpu I JDA IA?@ =H B JDA FHBEA IMEJ?D EI ANA?KJA@ 6DA HJ B JDA
      JAHE= I =A IF=?A EI =??AIIE>A JDHKCD /mnt/term I JDA bind EI = M=O B =EC JDA ME
      @M IOIJA I CH=FDE?I EJAHB=?A IAA draw! =L=E=>A J FHCH=I HKEC  JDA +27 IAHLAH
      6DA news ?=@ HAFHJI ?KHHAJ 2= ' =BB=EHI
      6DA JDEH@ FIIE>A IAHLE?A JOFA con EI IAJ MDA JDA +27 IAHLAH EI ?=A@ BH = 2='
      =?DEA IK?D =I JDHKCD telnet IAA con
  Using Plan 9
      6DA KIAH ?=@I B 2= ' =HA HAEEI?AJ B JDIA E 4AIA=H?D 7EN LAHIE  6DAHA =HA =
      K>AH B @EBBAHA?AI DMALAH
      6DA IJ=@=H@ IDA EI rc J JDA *KHA IDA 6DA IJ JE?A=>A @EBBAHA?AI =FFA=H O
      MDA FHCH=EC =@ =?H FH?AIIEC
      6DA ?D=H=?JAH@AAJA ?D=H=?JAH EI >=?IF=?A =@ JDA EAE ?D=H=?JAH EI ?JH7 JDAIA ?=J
      >A ?D=CA@
      ,- EI JDA EJAHHKFJ ?D=H=?JAH JOFEC EJ IA@I = EJAHHKFJ J FH?AIIAI HKEC E JD=J ME@M
      5AA keyboard $ BH EIJHK?JEI  JOFEC ?D=H=?JAHI EA ,-  JDA L=HEKI AO>=H@I
      1B = FHCH= @EAI MEJD IAJDEC EA = =@@HAII AHHH EJ AJAHI = *HA IJ=JA 1J ECAHI =L=E
      =>A BH @A>KCCEC MEJD db H acid Broke IAA kill ?A=I KF >HA FH?AIIAI
      6DA IJ=@=H@ A@EJH EI A B acme H sam 6DAHA EI = L=HE=J B sam JD=J FAHEJI HKEC
      JDA BEA=EFK=JEC F=HJ B sam  = 2=' IOIJA
              sam −r tcp!kremvax
164                                                                                          164



       .H DEIJHE?= HA=II sam KIAI = J=> IJF IAJJEC B & IF=?AI MDEA JDA JDAH A@EJHI =@ ME@M
       IOIJAI KIA " IF=?AI 6DAIA @AB=KJI ?= >A LAHHE@@A >O IAJJEC JDA L=KA B JDA ALEHAJ
       L=HE=>A $tabstop J JDA @AIEHA@ K>AH B IF=?AI FAH J=>
       =?DEA =AI =O >A FHABENA@ >O JDA AJMH =A DAHA tcp =@ net BH JDA IOIJA @AB=KJ
       CE ?A?JEI =@ HAJA ANA?KJE  2=' =?DEAI =HA KIK=O @A >O I=OEC BH
       AN=FA
              con kremvax
       H
              rx deepthought chess
       IAA con
       9fs ?A?JI J BEA IOIJAI B HAJA IOIJAI IAA srv" .H AN=FA
              9fs kremvax
       IAJI JDECI KF I JD=J JDA HJ B kremvax I BEA JHAA EI LEIE>A ?=O E /n/kremvax
       Faces CELAI CH=FDE?= JEBE?=JE B =HHELEC =E
       6DA 2= ' BEA IAHLAH D=I = EJACH=JA@ >=?KF B=?EEJO 6DA ?=@
              9fs dump
       >E@I J /n/dump = JHAA ?J=EEC JDA @=EO >=?KFI  JDA BEA IAHLAH 6DA @KF JHAA D=I OA=HI
       =I JF ALA BEA =AI =@ JD@=O =I ANJ ALA BEA =AI .H AN=FA
       /n/dump/2000/0120 EI JDA HJ B JDA BEA IOIJA =I EJ =FFA=HA@ =J @KF JEA  =K=HO 
         1B HA JD= A @KF EI J=A  JDA I=A @=O @KFI =BJAH JDA BEHIJ D=LA = ANJH= @ECEJ
       6 HA?LAH JDA LAHIE B JDEI BEA =I EJ M=I  KA # '''
              cp /n/dump/1999/0615/sys/man/1/0intro .
       H KIA yesterday
SEE ALSO
      6DEI IA?JE BH CAAH= FK>E?O =??AIIE>A ?=@I
      5A?JE   BH E>H=HO BK?JEI E?K@EC IOIJA ?=I
      5A?JE ! BH AHA @ALE?AI =??AIIA@ LE= bind
      5A?JE " BH BEA IAHLE?AI =??AIIA@ LE= mount
      5A?JE # BH JDA 2= ' BEA FHJ?
      5A?JE $ BH BEA BH=JI
      5A?JE % BH @=J=>=IAI =@ @=J=>=IA =??AII FHCH=I
      5A?JE & BH JDECI HA=JA@ J =@EEIJAHEC 2= '
      /sys/doc BH ?FEAI B F=FAHI HABAHA?A@ E JDEI =K=
       6DA >=? B JDEI LKA D=I = FAHKJA@ E@AN J =E@ IA=H?DAI
DIAGNOSTICS
     7F JAHE=JE A=?D FHCH= HAJKHI = IJHEC ?=A@ JDA exit status 1J M=I AEJDAH IKFFEA@ >O =
     ?= J exits  H M=I MHEJJA J JDA ?=@ I /proc/pid/note BEA IAA proc! ?=KIEC =
     =>H= JAHE=JE 6DA AFJO IJHEC EI ?KIJ=HO BH IK??AIIBK ANA?KJE = AFJO
     IJHEC CELAI = ?KA J JDA B=EKHA B JDA ?=@




                                                      !
 )                                                                                                      )




NAME
        = = = #= $= %= &= = G= L=   =IIA>AHI
SYNOPSIS
     2a  option ...   name ... 
     AJ?
DESCRIPTION
      6DAIA FHCH=I =IIA>A JDA =A@ BEAI EJ >A?J BEAI BH JDA ?HHAIF@EC =H?DEJA?JKHAI IAA
      2c BH JDA ?HHAIF@A?A >AJMAA = =H?DEJA?JKHA =@ JDA ?D=H=?JAH 1 , AJ? JD=J IFA?EBEAI
      EJ 6DA =IIA>AHI D=@A JDA IJ ? + FHAFH?AIIH @EHA?JELAI =@ JDA =II?E=JA@
      ?=@EA FJEI −D =@ −I JDAH FJEI =HA
        −o obj
                 2=?A KJFKJ E BEA obj =MA@ O EB JDAHA EI KIJ A EFKJ BEA ,AB=KJ EI J J=A JDA
                 =IJ AAAJ B JDA EFKJ F=JD =A IJHEF =O JH=EEC .s =@ =FFA@ O MDAHA O EI BEHIJ
                 AJJAH B JDA =IIA>AH I =A
FILES
        6DA @EHA?JHO /sys/include EI IA=H?DA@ BH E?K@A BEAI =BJAH =?DEA@AFA@AJ BEAI E
        /$objtype/include
SOURCE
     /sys/src/cmd/2a AJ?
SEE ALSO
      2c 2l
        4> 2EA ) =K= BH JDA 2= ' =IIA>AH
BUGS
        6DA EIJ B =IIA>AHI CELA =>LA EI O F=HJE= J = =H?DEJA?JKHAI =HA IKFFHJA@  = IOI
        JAI IA D=LA >AA HAJEHA@ =@ IA =HA FHLE@A@ >O JDEH@ F=HJEAI




                                                        "
 +                                                                                                        +




NAME
        ? ? ? #? $? %? &? ? G? L?   + ?FEAHI
SYNOPSIS
     2c  option ...   file ... 
     AJ?
DESCRIPTION
      6DAIA ?=@I ?FEA JDA =A@ + files EJ >A?J BEAI BH JDA ?HHAIF@EC =H?DEJA?JKHA 1B
      JDAHA =HA KJEFA + files JDA ?FEAHI ME =JJAFJ J AAF $NPROC ?FE=JEI HKEC ?
      ?KHHAJO )II?E=JA@ MEJD A=?D ?FEAH EI = IJHEC objtype BH AN=FA

        0c spim           EJJAA@E= 125 ! B=EO
        1c 68000          JH= +$&
        2c 68020          JH= +$& 
        5c arm            EJJAA@E= )4
        6c amd64          ),$" =@ ?F=JE>AI AC 1JA -$"6
        7c alpha          ,ECEJ= )FD= )2:
        8c 386            1JA E!&$ E"&$ 2AJEK AJ?
        kc sparc          5K 52)4+
        qc power          2MAH 2+
        vc mips           >ECA@E= 125 ! B=EO
        6DA ?FEAHI D=@A IJ FHAFH?AIIEC @EHA?JELAI JDAIALAI = ?FAJA FHAFH?AIIH EI =L=E
        =>A E cpp MDE?D KIJ >A HK IAF=H=JAO
        AJ JDA BEHIJ AJJAH B JDA ?FEAH =A >A O 0 1 2 5 6 7 8 k q H v 6DA KJFKJ >A?J
        BEAI A@ E O 6DA AJJAH EI =I JDA FHABEN B HA=JA@ FHCH=I Oa EI JDA =IIA>AH Ol EI JDA
        =@AH 2= ' ?LAJE=O IAJI JDA $objtype ALEHAJ L=HE=>A J JDA objtype IJHEC
        =FFHFHE=JA J JDA ?KHHAJ =?DEA I JOFA 2= ' =I ?LAJE=O D=I objtype @EHA?JHEAI
        MDE?D ?J=E =C JDAH JDECI include BH =?DEA@AFA@AJ E?K@A BEAI lib BH FK>
        E? >A?J ?@A E>H=HEAI bin BH FK>E? FHCH=I =@ mkfile BH FHA?@EJEEC mk
        6DA ?FEAH FJEI =HA

        −o obj     2=?A KJFKJ E BEA obj =MA@ O EB JDAHA EI KIJ A EFKJ BEA ,AB=KJ EI J J=A JDA
                   =IJ AAAJ B JDA EFKJ BEA =A IJHEF =O JH=EEC .c =@ =FFA@ O
        −w         2HEJ M=HEC AII=CAI =>KJ KKIA@ L=HE=>AI AJ?
        −B         )??AFJ BK?JEI MEJDKJ = AMIJOA )51 + BK?JE FHJJOFA *O @AB=KJ JDA ?FE
                   AHI HAA?J BK?JEI KIA@ MEJDKJ = @ABEA@ FHJJOFA =JDKCD )51 + FAHEJI JDA
        −Dname=def
        −Dname ,ABEA JDA name J JDA FHAFH?AIIH =I EB >O #define 1B  @ABEEJE EI CELA JDA
               =A EI @ABEA@ =I 1
        −F         -=>A JOFA?DA?EC B ?=I J print  =@ JDAH BH=JJA@ FHEJ HKJEAI 5AA JDA @EI
                   ?KIIE B ANJAIEI >AM
        −Idir      ) #include BEA MDIA =A @AI J >ACE MEJD I=ID H EI A?IA@ E @K>A
                   GKJAI EI =M=OI IKCDJ BEHIJ E JDA @EHA?JHO B JDA file =HCKAJ 1B JDEI B=EI JDA −. B=C
                   EI CELA H JDA =A EI A?IA@ E <> EJ EI JDA IKCDJ E @EHA?JHEAI =A@ E −I
                   FJEI JDA E /sys/include =@ BE=O E /$objtype/include
        −.         5KFFHAII JDA =KJ=JE? IA=H?DEC BH E?K@A BEAI E JDA @EHA?JHO B JDA BEA =HCKAJ
        −N         5KFFHAII =KJ=JE? HACEIJAHE=JE =@ FJEE=JE
        −S         2HEJ = =IIA>O =CK=CA LAHIE B JDA >A?J ?@A  IJ=@=H@ KJFKJ =I MA =I
                   CAAH=JEC JDA O BEA




                                                        #
+                                                                                                      +



       −T          2=II JOFA IEC=JKHAI  = ANJAH= =@ C>= AJEJEAI 6DA IEC=JKHA EI >=IA@  JDA +
                   signof FAH=JH 5AA dynld 
       −V          *O @AB=KJ JDA ?FEAHI =HA IJ=@=H@O =N =>KJ JOFA AGK=EJO >AJMAA void*
                   L=KAI =@ JDAH FEJAHI JDEI B=C HAGKEHAI )51 + ?BH=?A
       −p          1LA = IJ=@=H@ )51 + FHAFH?AIIH >ABHA ?FEEC
       −a          1IJA=@ B ?FEEC FHEJ  IJ=@=H@ KJFKJ =?E@ BK?JEI IAA acid BH AN=EEC
                   IJHK?JKHAI @A?=HA@ E JDA IKH?A BEAI
       −aa         EA −a AN?AFJ IKFFHAII EBH=JE =>KJ IJHK?JKHAI @A?=HA@ E E?K@A@ DA=@AH BEAI
       −n          9DA KIA@ MEJD −a H −aa F=?AI =?E@ BK?JEI E file.acid BH EFKJ file.c, =@ J
                    IJ=@=H@ KJFKJ
       6DA ?FEAHI IKFFHJ IALAH= ANJAIEI J )51 +

            ) IJHK?JKHA H KE =O ?J=E K=A@ IK>IJHK?JKHAI =@ IK>KEI 6DA BEA@I B JDA IK>
            IJHK?JKHAI H IK>KEI ?= JDA >A KIA@ =I EB JDAO MAHA A>AHI B JDA F=HAJ IJHK?JKHA H
            KE JDA HAIKJE B = =A ?BE?J EI KIFA?EBEA@ 9DA = FEJAH J JDA KJAH IJHK?JKHA
            H KE EI KIA@ E = ?JANJ JD=J EI O AC= BH JDA K=A@ IK>IJHK?JKHA JDA ?FEAH FH
            JAI JDA JOFA =@ =@KIJI JDA FEJAH L=KA J FEJ =J JDA IK>IJHK?JKHA 1B JDA K=A@
            IJHK?JKHA H KE EI B = JOFA MEJD = J=C =A IFA?EBEA@ >O = typedef IJ=JAAJ JDA
            K=A@ IJHK?JKHA H KE ?= >A ANFE?EJO HABAHA?A@ >O IJHK?J L=HE=>AJ=C=A
            ) IJHK?JKHA L=KA ?= >A BHA@ MEJD = ANFHAIIE IK?D =I
                  (struct S){v1, v2, v3}
            MDAHA JDA EIJ AAAJI =HA L=KAI BH JDA BEA@I B IJHK?J S
            )HH=O EEJE=EAHI ?= IFA?EBO JDA E@E?AI B JDA =HH=O E IGK=HA >H=?AJI =I
                  int a[] = { [3] 1, [10] 5 };
            MDE?D EEJE=EAI JDA JDEH@ =@ JAJD AAAJI B JDA AALAAAAJ =HH=O a
            5JHK?JKHA EEJE=EAHI ?= IFA?EBO JDA IJHK?JKHA AAAJ >O KIEC JDA =A BMEC = FAHE@ =I
                  struct { int x; int y; } s = { .y 1, .x 5 };
            MDE?D EEJE=EAI AAAJI y =@ JDA x B JDA IJHK?JKHA s 6DAIA BHI =I =??AFJ JDA AM
            )51 + J=JE MDE?D E?K@AI = AGK= IEC
                  int a[] = { [3] = 1, [10] = 5 };
                  struct { int x; int y; } s = { .y = 1, .x = 5 };
            ) C>= L=HE=>A ?= >A @A@E?=JA@ J = HACEIJAH >O @A?=HEC EJ extern register E all
            @KAI =@ E>H=HEAI
            ) #pragma B JDA BH
                    #pragma lib "libbio.a"
            HA?H@I JD=J JDA FHCH= AA@I J >A =@A@ MEJD BEA /$objtype/lib/libbio.a IK?D
            EAI JOFE?=O F=?A@ E E>H=HO DA=@AH BEAI >LE=JA JDA −l FJE B JDA =@AHI 6 DAF E@A
            JEBO BEAI E IJ=@=H@ @EHA?JHEAI MEJDE JDA BEA =AI E JDA #pragmas JDA IJHEC $M HAF
            HAIAJI JDA =A B JDA =H?DEJA?JKHA AC mips =@ $O HAFHAIAJI EJI E@AJEBOEC ?D=H=?JAH
            AC v
            ) #pragma B JDA BH
                   #pragma varargck argpos error 2
            JAI JDA ?FEAH JD=J JDA IA?@ =HCKAJ J error EI = printEA BH=J IJHEC IAA
            print  JD=J E@AJEBEAI JDA D=@EC B IK>IAGKAJ =HCKAJI 6DA #pragma
                   #pragma varargck type "s" char*
            I=OI JD=J JDA BH=J LAH> s FH?AIIAI = =HCKAJ B JOFA char 6DA #pragma
                   #pragma varargck flag ’c’
            I=OI JD=J c EI = B=C ?D=H=?JAH 6DAIA #pragmas =HA KIA@ EB JDA −F FJE EI A=>A@ J
            JOFA?DA? ?=I J print =@ JDAH IK?D HKJEAI
            ) #pragma MEJD =O B JDA BMEC BHI
                 #pragma incomplete type
                 #pragma incomplete struct tag
                 #pragma incomplete union tag
            MDAHA type EI = typedef @ =A BH = IJHK?JKHA H KE JOFA =@ tag EI = IJHK?JKHA H KE



                                                       $
 +                                                                                                    +



           J=C JAI JDA ?FEAH JD=J JDA ?HHAIF@EC JOFA IDK@ D=LA EJI IEC=JKHA ?=?K=JA@ =I =
           E?FAJA JOFA ALA EB EJ EI IK>IAGKAJO BKO @ABEA@ 6DEI =MI JDA JOFA IEC=JKHA A?D=
           EI J MH E JDA FHAIA?A B F=GKA JOFAI @A?=HA@ E DA=@AH BEAI MEJD JDAEH BK @ABEEJEI
           LEIE>A O J JDA ?@A MDE?D =EFK=JAI JDA 9EJD IA EFHJA@ IBJM=HA EJ ECDJ >A A?
           AII=HO J JKH BB JDA IEC=JKHA CAAH=JE ?FAJAO BH = =HCA >@O B ?@A JOFE?=O =J JDA
           IJ=HJ =@ A@ B = F=HJE?K=H E?K@A BEA 1B type EI JDA MH@ _off_ IEC=JKHA CAAH=JE EI
           JKHA@ BB EB type EI JDA MH@ _on_ JDA ?FEAH ME CAAH=JA IEC=JKHAI
           6DA + ?AJ // J A@ B EA EI =??AFJA@ =I MA =I JDA H= ?LAJE B /* */
           6DA ?FEAHI =??AFJ long long L=HE=>AI =I = $">EJ JOFA 6DA IJ=@=H@ DA=@AH JOFA@ABI
           JDEI J vlong )HEJDAJE?  vlong L=KAI EI KIK=O AK=JA@ >O = HKJEA E>H=HO JDKCD
           E =J A=IJ 8c O @ELEIE =@ @KKI KIA JDA HKJEA E>H=HO =@ JDA JDAH FAH=JHI CA
           AH=JA EEA ?@A =@ uvlong−expression divison−or−modulus (1<<constant) ME JKH EJ
           EEA >EJ FAH=JEI =I EI @A BH IDHJAH unsigned ANFHAIIEI
EXAMPLE
     .H JDA $&  FH@K?A = FHCH= prog BH + BEAI main.c =@ sub.c
               2c −FVw main.c sub.c
               2l −o prog main.2 sub.2
FILES
        /sys/include                 IOIJA =HA= BH =?DEAE@AFA@AJ #include @EHA?JELAI
        /$objtype/include            IOIJA =HA= BH =?DEA@AFA@AJ #include @EHA?JELAI
SOURCE
     /sys/src/cmd/cc                       =?DEAE@AFA@AJ F=HJ
     /sys/src/cmd/2c AJ?                 =?DEA@AFA@AJ F=HJ
SEE ALSO
      2a 2l cpp mk nm pcc db acid
        4> 2EA 0M J 7IA JDA 2= ' + +FEAH
BUGS
        6DA EIJ B ?FEAHI CELA =>LA EI O F=HJE= J = =H?DEJA?JKHAI =HA IKFFHJA@  = IOIJAI
        IA D=LA >AA HAJEHA@ =@ IA =HA FHLE@A@ >O JDEH@ F=HJEAI
        6DA @AB=KJ FHAFH?AIIH O D=@AI #define #include #undef #ifdef #line =@
        #ifndef .H = BK )51 FHAFH?AIIH KIA JDA p FJE
        6DA @AB=KJ IA=H?D H@AH BH E?K@A BEAI @EBBAHI J JD=J B cpp
        5A BA=JKHAI B +'' JDA ''' )51 + IJ=@=H@ =HA EFAAJA@
        switch ANFHAIIEI =O J >A AEJDAH IECA@AII B vlong  ! >EJ =H?DEJA?JKHAI 8c =J A=IJ
        6DA EFAAJ=JE B vlong =IIECAJ ?= KIA = IJ=JE? ?=JE =@ JDEI ?= >A @EIJKH>A@ >O
        EJAHHKFJI AC JAI 8c =J A=IJ




                                                       %
                                                                                                      




NAME
           # $ % &  G L   =@AHI
SYNOPSIS
     2l  option ...   file ... 
     AJ?
DESCRIPTION
      6DAIA ?=@I =@ JDA =A@ files EJ ANA?KJ=>A BEAI BH JDA ?HHAIF@EC =H?DEJA?JKHAI
      IAA 2c BH JDA ?HHAIF@A?A >AJMAA = =H?DEJA?JKHA =@ JDA ?D=H=?JAH 1 , AJ? JD=J IFA?E
      BEAI EJ 6DA BEAI IDK@ >A >A?J BEAI H E>H=HEAI =H?DELAI B >A?J BEAI BH JDA =FFHFHE=JA
      =H?DEJA?JKHA )I = =A EA −lext HAFHAIAJI JDA E>H=HO libext.a E /$objtype/lib
      MDAHA objtype EI A B 68000 AJ? =I EIJA@ E 2c 6DA E>H=HEAI KIJ D=LA J=>AI B ?JAJI
      IAA ar
        1 FH=?JE?A −l FJEI =HA H=HAO A?AII=HO =I JDA DA=@AH BEAI BH JDA E>H=HEAI ?=KIA JDAEH =H?DELAI
        J >A E?K@A@ =KJ=JE?=O E JDA =@ IAA 2c .H AN=FA =O FHCH= JD=J E?K@AI
        DA=@AH BEA libc.h ?=KIAI JDA =@AH J IA=H?D JDA + E>H=HO /$objtype/lib/libc.a )I
        JDA =@AH ?HA=JAI = K@ABEA@ IO> _main H _mainp EB FHBEEC EI A=>A@ J BH?A =@
        EC B JDA IJ=HJKF E=CA BH JDA + E>H=HO
        6DA H@AH B IA=H?D J HAILA K@ABEA@ IO>I EI J =@ = BEAI =@ E>H=HEAI AJEA@ ANFE?
        EJO  JDA ?=@ EA =@ JDA J HAILA HA=EEC IO>I >O IA=H?DEC E JFCE?= H@AH
        E>H=HEAI AJEA@ E DA=@AH BEAI E?K@A@ >O BEAI =HA=@O =@A@ 9DA I?=EC IK?D E>H=HEAI
        JDA =CHEJD EI J I?= A=?D E>H=HO HAFA=JA@O KJE  AM K@ABEA@ IO>I =HA FE?A@ KF
        JDA J IJ=HJ  JDA ANJ E>H=HO 6DKI EB E>H=HO A AA@I B MDE?D AA@I A =C=E EJ =O >A A?AI
        I=HO J AJE A ANFE?EJO I EJ ME >A HA=@ = IA?@ JEA
        6DA =@AH FJEI =HA
        −l            )I = >=HA FJE 5KFFHAII JDA @AB=KJ =@EC B JDA IJ=HJKF E=CA =@ E>H=HEAI
                      IFA?EBEA@ >O DA=@AH BEAI
        −o out        2=?A KJFKJ E BEA out ,AB=KJ EI O.out MDAHA O EI JDA BEHIJ AJJAH B JDA =@AH
                      =A
        −p            1IAHJ FHBEEC ?@A EJ JDA ANA?KJ=>A KJFKJ  IFA?E= =?JE EI AA@A@ @KHEC
                      ?FE=JE H =IIA>O
        −e            1IAHJ e>A@@A@ JH=?EC ?@A EJ JDA ANA?KJ=>A KJFKJ  IFA?E= =?JE EI AA@A@
                      @KHEC ?FE=JE H =IIA>O 6DA =@@A@ ?@A ?=I _tracein =J BK?JE AJHEAI
                      =@ _traceout =J BK?JE ANEJI
        −s            5JHEF JDA IO> J=>AI BH JDA KJFKJ BEA
        −a            2HEJ JDA >A?J ?@A E =IIA>O =CK=CA MEJD =@@HAIIAI
        −v            2HEJ @A>KCCEC KJFKJ JD=J =J=JAI JDA =?JELEJEAI B JDA =@
        −M            Kl O /AAH=JA EIJHK?JEI H=JDAH JD= ?=I J AK=JE HKJEAI BH KJEFO =@
                      @ELE@A
        −Esymbol      6DA AJHO FEJ BH JDA >E=HO EI symbol @AB=KJ _main _mainp K@AH −p
        −x [ file ]   2H@K?A = ANFHJ J=>A E JDA ANA?KJ=>A 6DA FJE= file HAIJHE?JI JDA ANFHJA@
                      IO>I J JDIA EIJA@ E JDA BEA 5AA dynld 
        −u [ file ]   2H@K?A = ANFHJ J=>A EFHJ J=>A =@ = @O=E? =@ IA?JE E JDA ANA?KJ=>A
                      6DA FJE= file HAIJHE?JI JDA EFHJA@ IO>I J JDIA EIJA@ E JDA BEA 5AA
                      dynld 
        −t            5l =@ vl O LA IJHECI EJ JDA JANJ IACAJ
        −Hn           -NA?KJ=>A DA=@AH EI JOFA n 6DA A=EC B JDA JOFAI EI =H?DEJA?JKHA@AFA@AJ JOFE
                      ?=O JOFA  EI 2= ' >J BH=J =@ JOFA EI JDA HACK=H 2= ' BH=J JDA @AB=KJ
                      6DAIA =HA HALAHIA@  JDA 125 6DA ANJ >J BH=J EI ! 6OFA " E vl ?HA=JAI =
                      125 ANA?KJ=>A BH = 5/1 7EN IOIJA




                                                          &
                                                                                                   



        −Tt         6DA JANJ IACAJ IJ=HJI =J =@@HAII t
        −Dd         6DA @=J= IACAJ IJ=HJI =J =@@HAII d
        −Rr         6DA JANJ IACAJ EI HK@A@ J = KJEFA B r EB r EI AH
        6DA K>AHI E JDA =>LA FJEI ?= >ACE MEJD 0x H 0 J ?D=CA JDA @AB=KJ >=IA BH @A?E=
        J DAN=@A?E= H ?J= 6DA @AB=KJI BH JDA L=KAI @AFA@  JDA ?FEAH =@ JDA DA=@AH JOFA
        6DA =@A@ E=CA D=I IALAH= IO>I EIAHJA@ >O JDA =@AH etext EI JDA =@@HAII B JDA A@ B
        JDA JANJ IACAJ bdata EI JDA =@@HAII B JDA >ACEEC B JDA @=J= IACAJ edata EI JDA
        =@@HAII B JDA A@ B JDA @=J= IACAJ =@ end EI JDA =@@HAII B JDA A@ B JDA >II IACAJ
        =@ B JDA FHCH=
FILES
        /$objtype/lib         BH −llib =HCKAJI
SOURCE
     /sys/src/cmd/2l AJ?
SEE ALSO
      2c 2a ar nm db prof
        4> 2EA 0M J 7IA JDA 2= ' + +FEAH
BUGS
        6DA EIJ B =@AHI CELA =>LA EI O F=HJE= J = =H?DEJA?JKHAI =HA IKFFHJA@  = IOIJAI
        IA D=LA >AA HAJEHA@ =@ IA =HA FHLE@A@ >O JDEH@ F=HJEAI




                                                     '
)*)+                                                                                        )*)+




NAME
        =>=? HA=@MA>    >HMIA JDA 9H@9E@A 9A>
SYNOPSIS
     abaco  −p   −c ncols   −m mtpt   −t charset   url 
        readweb  url 
DESCRIPTION
      Abaco EI = ECDJMAECDJ MA> >HMIAH MEJD JDA =FFA=H=?A B acme MEJD ncols ?KI A >O
      @AB=KJ /ELA = url EJ ME IJ=HJ >O @EIF=OEC JD=J F=CA +E?EC KIA >KJJ !  = E FAI
      EJ E = AM abaco ME@M −t IAA?JI = =JAH=JA ?D=H=?JAH IAJ −m = =JAH=JA KJ FEJ BH
      webfs H=O JDA IJ=@=H@ AHHH B IK>IDAI EI ?IA@ >KJ −p FHALAJI JDEI
        Readweb EFHJI JDA KJIE@A AJMH EB A?AII=HO IJ=HJI webfs =@ webcookies =@ BE=O abaco
FILES
        /mnt/web       @AB=KJ webfs KJ FEJ
SOURCE
     /sys/src/cmd/abaco
     /rc/bin/readweb
SEE ALSO
      vnc webcookies" webfs"
BUGS
        Abaco EI = MH E FHCHAII =O BA=JKHAI B CE=J MA> >HMIAHI =HA =>IAJ




                                                    
)+1,                                                                                              )+1,




NAME
       =?E@ JHKII JHKF   @A>KCCAH
SYNOPSIS
     acid  −kqw   −l library   −m machine   pid   textfile 
       acid −l truss textfile
       acid −l trump  pid   textfile 
DESCRIPTION
      Acid EI = FHCH==>A IO>E? @A>KCCAH 1J ?= EIFA?J A H HA FH?AIIAI JD=J ID=HA =
      =@@HAII IF=?A ) FHCH= J >A @A>KCCA@ =O >A IFA?EBEA@ >O JDA FH?AII E@ B = HKEC H
      @ABK?J FH?AII H >O JDA =A B JDA FHCH= I JANJ BEA 8.out >O @AB=KJ )J JDA FHFJ
      acid ME IJHA BK?JE @ABEEJEI H FHEJ JDA L=KA B ANFHAIIEI FJEI =HA
       −w             )M JDA JANJBEA J >A @EBEA@
       −q             2HEJ L=HE=>A HA=ECI =J IJ=HJKF
       −l library     =@ BH library =J IJ=HJKF IAA >AM
       −m machine     )IIKA EIJHK?JEI =HA BH JDA CELA +27 JOFA A B alpha 386 AJ? =I EIJA@
                      E 2c H sunsparc H mipsco BH JDA =KB=?JKHAH@ABEA@ EIJHK?JE J=
                      JE BH JDIA FH?AIIHI EIJA=@ B KIEC JDA =CE? K>AH J IAA?J JDA +27 JOFA
       −k             ,A>KC JDA AHA IJ=JA BH JDA FH?AII H=JDAH JD= JDA KIAH IJ=JA
       )J    IJ=HJKF   acid    >J=EI     IJ=@=H@     BK?JE     @ABEEJEI  BH    JDA  E>H=HO   BEA
       /sys/lib/acid/port                       =H?DEJA?JKHA@AFA@AJ              BK?JEI          BH
       /sys/lib/acid/$objtype KIAHIFA?EBEA@ BK?JEI BH $home/lib/acid =@ BKHJDAH
       BK?JEI BH −l BEAI ,ABEEJEI E =O BEA =O LAHHE@A FHALEKIO @ABEA@ BK?JEI 1B JDA
       BK?JE acidinit EI @ABEA@ EJ ME >A ELA@ =BJAH = E>H=HEAI D=LA >AA =@A@ 5AA 2c BH
       EBH=JE =>KJ ?HA=JEC acid BK?JEI BH AN=EEC @=J= IJHK?JKHAI
   Language
      5O>I B JDA FHCH= >AEC @A>KCCA@ >A?A EJACAH L=HE=>AI MDIA L=KAI =HA =@@HAIIAI
      +JAJI B =@@HAIIAI =HA >J=EA@ >O E@EHA?JE ?= L=HE=>AI =HA GK=EBEA@ >O BK?JE =A
      BH AN=FA main:argv 9DA FHCH= IO>I ?BE?J MEJD acid MH@I @EIJECKEIDEC $
      IECI =HA FHABENA@ 5K?D HA=ECI =HA HAFHJA@ =J IJ=HJKF EB JDA FJE −q EI A=>A@
       8=HE=>A JOFAI integer, float, list, string =@ BH=JI =HA EBAHHA@ BH =IIECAJI 6HKJD L=KAI
       B=IAJHKA =HA =JJHE>KJA@ J AHAH EJACAHI H B=JI =@ J AFJOAFJO EIJI H
       IJHECI EIJI =HA IAGKA?AI B ANFHAIIEI IKHHK@A@ >O {} =@ IAF=H=JA@ >O ?=I
       -NFHAIIEI =HA K?D =I E + >KJ OEA@ >JD = L=KA =@ = BH=J +=IJI J ?FAN JOFAI =HA
       =MA@ EIJI =@EJ JDA BMEC FAH=JHI MEJD IK>I?HEFJI ?KJA@ BH 
              head list
              tail list
              append list, element
              delete list, subscript
       .H=J ?@AI =HA JDA I=A =I E db .H=JI =O >A =JJ=?DA@ J K=HO ANFHAIIEI MEJD \
       AC (32*7)\D 6DAHA =HA JM E@EHA?JE FAH=JHI * J =@@HAII = ?HA E=CA @ J =@@HAII =
       JANJ BEA 6DA JOFA =@ BH=J B JDA HAIKJ =HA @AJAHEA@ >O JDA BH=J B JDA FAH=@ MDIA
       JOFA KIJ >A EJACAH
       5J=JAAJI =HA
              if expr then statement  else statement 
              while expr do statement
              loop expr, expr do statement
              defn name(args) { statement }
              defn name
              name(args)
              builtin name(args)
              local name



                                                     
)+1,                                                                                         )+1,



             return expr
             whatis  name 
      6DA IJ=JAAJ defn name ?A=HI JDA @ABEEJE BH name ) defn =O LAHHE@A = >KEJE BK?
      JE FHABENEC = BK?JE ?= MEJD builtin ECHAI =O LAHHE@EC defn BH?EC JDA KIA B JDA
      >KEJE BK?JE
      0AHA EI = F=HJE= EIJ B BK?JEI IAA JDA =K= BH = ?FAJA EIJ
      stk()            2HEJ = IJ=? JH=?A BH ?KHHAJ FH?AII
      lstk()           2HEJ = IJ=? JH=?A MEJD L=KAI B ?= L=HE=>AI
      gpr()            2HEJ CAAH= HACEIJAHI 4ACEIJAHI ?= =I >A =??AIIA@ >O =A BH AN=FA
                       *R0
      spr()            2HEJ IFA?E= HACEIJAHI IK?D =I FHCH= ?KJAH =@ IJ=? FEJAH
      fpr()            2HEJ B=JECFEJ HACEIJAHI
      regs()           5=A =I spr();gpr()
      fmt(expr,format)
                       -NFHAIIE expr MEJD BH=J CELA >O JDA ?D=H=?JAH L=KA B ANFHAIIE
                       format
      src(address)     2HEJ  EAI B IKH?A =HK@ JDA FHCH= =@@HAII
      Bsrc(address)    /AJ JDA IKH?A EA BH JDA FHCH= =@@HAII EJ = ME@M B = HKEC
                       sam =@ IAA?J EJ
      line(address)    2HEJ IKH?A EA A=HAIJ J JDA FHCH= =@@HAII
      source()         EIJ ?KHHAJ IKH?A @EHA?JHEAI
      addsrcdir(string)
                       )@@ = IKH?A @EHA?JHO J JDA EIJ
      filepc(where) +LAHJ = IJHEC B JDA BH sourcefile:linenumber J = =?DEA =@@HAII
      pcfile(address) +LAHJ = =?DEA =@@HAII J = IKH?A BEA =A
      pcline(address) +LAHJ = =?DEA =@@HAII J = IKH?A EA K>AH
      bptab()          EIJ >HA=FEJI IAJ E JDA ?KHHAJ FH?AII
      bpset(address) 5AJ = >HA=FEJ E JDA ?KHHAJ FH?AII =J JDA CELA =@@HAII
      bpdel(address) ,AAJA = >HA=FEJ BH JDA ?KHHAJ FH?AII
      cont()           +JEKA ANA?KJE B ?KHHAJ FH?AII =@ M=EJ BH EJ J IJF
      step()           -NA?KJA = IECA =?DEA EIJHK?JE E JDA ?KHHAJ FH?AII
      func()           5JAF HAFA=JA@O KJE =BJAH = BK?JE HAJKH
      stopped(pid)     6DEI HAF=?A=>A BK?JE EI ?=A@ =KJ=JE?=O MDA JDA CELA FH?AII
                       IJFI 1J H=O FHEJI JDA FHCH= ?KJAH =@ HAJKHI J JDA FHFJ
      asm(address)     ,EI=IIA>A ! =?DEA EIJHK?JEI >ACEEC =J JDA CELA =@@HAII
      mem(address,string)
                       2HEJ = >? B AHO EJAHFHAJA@ =??H@EC J = IJHEC B BH=J ?@AI
      dump(address,n,string)
                       EA mem HAFA=JA@ BH n ?IA?KJELA >?I
      print(expr,...) 2HEJ JDA L=KAI B JDA ANFHAIIEI
      newproc(arguments)
                       5J=HJ = AM FH?AII MEJD =HCKAJI CELA =I = IJHEC =@ D=J =J JDA BEHIJ
                       EIJHK?JE
      new()            EA newproc >KJ J=A =HCKAJI AN?AFJ argv[0] BH IJHEC L=HE=>A
                       progargs
      win()            EA new >KJ HK JDA FH?AII E = IAF=H=JA ME@M
      start(pid)       5J=HJ = IJFFA@ FH?AII
      kill(pid)        E JDA CELA FH?AII
      setproc(pid)     =A JDA CELA FH?AII ?KHHAJ
      rc(string)       -I?=FA J JDA IDA rc J ANA?KJA JDA ?=@ IJHEC
  Libraries
      6DAHA =HA = K>AH B acid E>H=HEAI JD=J FHLE@A DECDAHALA @A>KCCEC B=?EEJEAI 6M J=>A
      AN=FAI =HA truss =@ trump MDE?D KIA acid J JH=?A IOIJA ?=I truss =@ AHO =?=JE
      trump *JD HAGKEHA IJ=HJEC acid  JDA FHCH= AEJDAH >O =JJ=?DEC J = HKEC FH?AII H >O
      ANA?KJEC new()  = >E=HO FAHD=FI =BJAH IAJJEC progargs IJFFEC JDA FH?AII =@ JDA
      HKEC truss() H trump() J ANA?KJA JDA FHCH= K@AH JDA I?=BB@EC 6DA KJFKJ ME >A
      = JH=?A B JDA IOIJA ?=I truss H AHO =?=JE =@ BHAA ?=I trump ANA?KJA@ >O JDA FH
      CH= 9DA BEEIDA@ JH=?EC IJF JDA FH?AII =@ ANA?KJA untruss() H untrump()



                                                     
)+1,                                                                                       )+1,



      BMA@ >O cont() J HAIKA ANA?KJE
EXAMPLES
     5J=HJ J @A>KC /bin/ls IAJ IA >HA=FEJI HK KF J JDA BEHIJ A
             % acid /bin/ls
             /bin/ls: mips plan 9 executable
             /sys/lib/acid/port
             /sys/lib/acid/mips
             acid: new()
             70094: system call _main      ADD $−0x14,R29
             70094: breakpoint   main+0x4 MOVW R31,0x0(R29)
             acid: pid
             70094
             acid: argv0 = **main:argv\s
             acid: whatis argv0
             integer variable format s
             acid: *argv0
             /bin/ls
             acid: bpset(ls)
             acid: cont()
             70094: breakpoint ls     ADD $−0x16c8,R29
             acid:
      ,EIF=O AAAJI B = EA@ EIJ B IJHK?JKHAI
             complex Str { ’D’ 0 val; ’X’ 4 next; };
             complex Str s;
             s = *headstr;
             while s != 0 do{
                  print(s.val, "\n");
                  s = s.next;
             }
      JA JDA KIA B JDA . FAH=JH EIJA=@ B −>
      ,EIF=O = =HH=O B >OJAI @A?=HA@ E + =I char array[]
             *(array\s)
      6DEI AN=FA CELAI array IJHEC BH=J JDA FHEJI JDA IJHEC >ACEEC =J JDA =@@HAII E acid
      J=JE *array
      6H=?A JDA IOIJA ?=I ANA?KJA@ >O ls
             % acid −l truss /bin/ls
             /bin/ls:386 plan 9 executable

             /sys/lib/acid/port
             /sys/lib/acid/kernel
             /sys/lib/acid/truss
             /sys/lib/acid/386
             acid: progargs = "−l lib/profile"
             acid: new()
             acid: truss()
             open("#c/pid", 0)
                  return value: 3
             pread(3, 0x7fffeeac, 20, −1)
                  return value: 12
                  data: "        166 "
             ...
             stat("lib/profile", 0x0000f8cc, 113)
                  return value: 65
             open("/env/timezone", 0)
                  return value: 3



                                                    !
)+1,                                                                                      )+1,



              pread(3, 0x7fffd7c4, 1680, −1)
                   return value: 1518
                   data: "EST −18000 EDT −14400
                 9943200   25664400   41392800   57718800   73447200   89168400
               104896800 ..."
              close(3)
                   return value: 0
              pwrite(1, "−−rw−rw−r−− M 9 rob rob 2519 Mar 22 10:29 lib/profile
              ", 54, −1)
              −−rw−rw−r−− M 9 rob rob 2519 Mar 22 10:29 lib/profile
                   return value: 54
              ...
              166: breakpoint     _exits+0x5     INTB $0x40
              acid: cont()
FILES
        /proc/*/text
        /proc/*/mem
        /proc/*/ctl
        /proc/*/note
        /sys/lib/acid/$objtype
        /sys/lib/acid/port
        /sys/lib/acid/kernel
        /sys/lib/acid/trump
        /sys/lib/acid/truss
        $home/lib/acid
SOURCE
     /sys/src/cmd/acid
SEE ALSO
      2a 2c 2l mk db
      2DE 9EJAH>JJ )?E@ =K= 
DIAGNOSTICS
     )J JAHE=JE E ?=@I =HA FHFIA@ BH FH?AIIAI JD=J =HA IJE =?JELA
BUGS
        6DAHA EI  M=O J HA@EHA?J JDA IJ=@=H@ EFKJ =@ IJ=@=H@ KJFKJ B = AM FH?AII
        5KH?A EA IAA?JE A=H JDA >ACEEC B = BEA =O FE? = =@=?AJ BEA
        9EJD JDA ANJ=J IJAFFEC ?=@I A ?=J IJAF JDHKCD EIJHK?JEI KJIE@A JDA JANJ IAC
        AJ =@ EJ EI D=H@ J @A>KC =?HII FH?AII BHI




                                                   "
)+-                                                                                             )+-




NAME
       =?A ME =M@     EJAH=?JELA JANJ ME@MI
SYNOPSIS
     acme  −ab   −c ncol   −f varfont   −F fixfont   −l loadfile  file  
       win  command 
       awd  label 
DESCRIPTION
      Acme ==CAI ME@MI B JANJ JD=J =O >A A@EJA@ EJAH=?JELAO H >O ANJAH= FHCH=I 6DA
      EJAH=?JELA EJAHB=?A KIAI JDA AO>=H@ =@ KIA ANJAH= FHCH=I KIA = IAJ B BEAI IAHLA@ >O
      acme JDAIA =HA @EI?KIIA@ E acme"
       )O =A@ files =HA HA=@ EJ acme ME@MI >ABHA acme =??AFJI EFKJ 9EJD JDA −l FJE JDA
       IJ=JA B JDA AJEHA IOIJA EI =@A@ BH loadfile MDE?D IDK@ D=LA >AA ?HA=JA@ >O = Dump ?
       =@ GL =@ IK>IAGKAJ file =AI =HA ECHA@ 2=E BEAI @EIF=O =I JANJ @EHA?JHEAI @EIF=O
       =I ?K=JA@ EIJI B JDA =AI B JDAEH ?FAJI =I E ls −p directory|mc AN?AFJ JD=J
       JDA =AI B IK>@EHA?JHEAI D=LA = I=ID =FFA@A@
       6DA −f −F FJE IAJI JDA =E BJ KIK=O L=HE=>AFEJ?D =JAH=JA KIK=O BENA@FEJ?D JDA
       @AB=KJ                 EI                 /lib/font/bit/lucidasans/euro.8.font
       .../lucm/unicode.9.font 6=> EJAHL=I =HA IAJ J JDA ME@JD B " H JDA L=KA B
       $tabstop KAH= AHI E JDA =FFHFHE=JA BJ
   Windows
      Acme ME@MI =HA E JM F=HJI = AEA tag =>LA = KJEEA body 6DA >@O JOFE?=O ?
      J=EI = E=CA B = BEA =I E sam H JDA KJFKJ B = FHCH= =I E = rio ME@M 6DA J=C
      ?J=EI = K>AH B >=IAF=H=JA@ MH@I BMA@ >O = LAHJE?= >=H ?D=H=?JAH BMA@ >O =O
      JDEC 6DA BEHIJ MH@ EI JDA =A B JDA ME@M JOFE?=O JDA =A B JDA =II?E=JA@ BEA H @EHA?
      JHO =@ JDA JDAH MH@I =HA ?=@I =L=E=>A E JD=J ME@M )O JANJ =O >A =@@A@ =BJAH
      JDA >=H AN=FAI =HA IJHECI J IA=H?D BH H ?=@I J ANA?KJA E JD=J ME@M +D=CAI J
      JDA JANJ ABJ B JDA >=H ME >A ECHA@ KAII JDA HAIKJ EI J ?D=CA JDA =A B JDA ME@M
       1B = ME@M D@I = @EHA?JHO JDA =A BEHIJ MH@ B JDA J=C ME A@ MEJD = I=ID
   Scrolling
       -=?D ME@M D=I = I?H >=H J JDA ABJ B JDA >@O 6DA I?H >=H >AD=LAI K?D =I E sam H
       rio AN?AFJ JD=J I?HEC ??KHI MDA JDA >KJJ EI FHAIIA@ H=JDAH JD= HAA=IA@ =@ ?JEKAI
       =I C =I JDA KIA >KJJ EI DA@ @M E JDA I?H >=H .H AN=FA J I?H IMO JDHKCD =
       BEA D@ >KJJ ! @M A=H JDA JF B JDA I?H >=H LEC JDA KIA @M JDA I?H >=H
       IFAA@I KF JDA H=JA B I?HEC
   Layout
       Acme ME@MI =HA =HH=CA@ E ?KI *O @AB=KJ EJ ?HA=JAI JM ?KI MDA IJ=HJEC JDEI ?=
       >A LAHHE@@A MEJD JDA −c FJE 2=?AAJ EI =KJ=JE? >KJ =O >A =@KIJA@ KIEC JDA layout
       box E JDA KFFAH ABJ ?HAH B A=?D ME@M =@ ?K 2HAIIEC =@ D@EC =O KIA >KJJ
       E JDA >N @H=CI JDA =II?E=JA@ ME@M H ?K .H ME@MI KIJ ?E?EC E JDA =OKJ >N
       CHMI JDA ME@M E F=?A >KJJ  CHMI EJ = EJJA >KJJ CHMI EJ =I K?D =I EJ ?= IJE A=L
       EC = JDAH J=CI E JD=J ?K LEIE>A =@ >KJJ ! J=AI LAH JDA ?K ?FAJAO JAFH=H
       EO DE@EC JDAH ME@MI E JDA ?K 6DAO ME HAJKH en masse EB =O B JDA AA@I =JJAJE
       6DA =OKJ >N E = ME@M EI H=O MDEJA MDA EJ EI >=? E JDA ?AJAH EJ HA?H@I JD=J JDA BEA
       EI @EHJO  acme >AEALAI EJ EI @EBEA@ BH EJI HECE= ?JAJI
       6=CI ANEIJ =J JDA JF B A=?D ?K =@ =?HII JDA MDA @EIF=O Acme FHA=@I JDA MEJD KIA
       BK ?=@I )I JDA J=C =?HII JDA JF =EJ=EI = EIJ B ANA?KJEC CHKEC ?=@I
   Typing
       6DA >AD=LEH B JOFA@ JANJ EI IEE=H J JD=J E rio AN?AFJ JD=J JDA ?D=H=?JAHI =HA @AELAHA@ J JDA
       J=C H >@O K@AH JDA KIA JDAHA EI  ?E? J JOFA  6DA ANFAHEAJ= FJE −b ?=KIAI JOF
       EC J C J JDA IJ HA?AJO ?E?A@=J H =@A ME@M 6DA KIK= >=?IF=?EC ?LAJEI
       =FFO )I E sam >KJ J rio JDA -5+ AO IAA?JI JDA JANJ JOFA@ IE?A JDA =IJ KIA =?JE =
       BA=JKHA F=HJE?K=HO KIABK MDA ANA?KJEC ?=@I ) IE@A ABBA?J EI JD=J JOFEC -5+ MEJD JANJ
       =HA=@O IAA?JA@ EI E@AJE?= J = Cut ?=@ q.v.



                                                      #
)+-                                                                                            )+-



      IJ JANJ E?K@EC JDA =AI B ME@MI =O >A A@EJA@ KEBHO 6DA O AN?AFJE EI JD=J
      JDA ?=@ =AI J JDA ABJ B JDA >=H E = J=C =HA =EJ=EA@ =KJ=JE?=O ?D=CAI J JDA
      =HA HAF=EHA@ >O acme
      9DA = ME@M EI E =KJE@AJ @A IAA JDA Indent ?=@ >AM =@ = AMEA ?D=H=?JAH
      EI JOFA@ =?A ?FEAI A=@EC MDEJA IF=?A  JDA ?KHHAJ EA J JDA AM EA 6DA FJE −a
      ?=KIAI A=?D ME@M J IJ=HJ E =KJE@AJ @A
  Directory context
      -=?D ME@M I J=C =AI = @EHA?JHO ANFE?EJO EB JDA ME@M D@I = @EHA?JHO EFE?EJO EB EJ D@I
      = HACK=H BEA AC JDA @EHA?JHO /adm EB JDA ME@M D@I /adm/users 6DEI @EHA?JHO FHLE@AI
      = context BH EJAHFHAJEC BEA =AI E JD=J ME@M .H AN=FA JDA IJHEC users E = ME@M
      =>AA@ /adm/ H /adm/keys ME >A EJAHFHAJA@ =I JDA BEA =A /adm/users 6DA @EHA?JHO
      EI @ABEA@ FKHAO JANJK=O I EJ ?= >A = ANEIJAJ @EHA?JHO H = HA= @EHA?JHO =II?E=JA@ MEJD
      = ANEIJAJ BEA AC /adm/not−a−file .EA =AI >ACEEC MEJD = I=ID =HA =IIKA@
      J >A =>IKJA BEA =AI
  Errors
      9E@MI MDIA =AI >ACE MEJD − H + ?LAJE=O D@ @E=CIJE?I =@ JDAH @=J= J
      @EHA?JO =II?E=JA@ MEJD BEAI ) ME@M =>AA@ +Errors HA?AELAI = @E=CIJE?I FH@K?A@ >O
      acme EJIAB ,E=CIJE?I BH ?=@I HK >O acme =FFA=H E = ME@M =A@
      directory/+Errors MDAHA directory EI E@AJEBEA@ >O JDA ?JANJ B JDA ?=@ 6DAIA AHHH
      ME@MI =HA ?HA=JA@ MDA AA@A@
  Mouse button 1
     KIA >KJJ  IAA?JI JANJ KIJ =I E sam H rio, E?K@EC JDA KIK= @K>A?E?EC ?
     LAJEI
  Mouse button 2
     *O = =?JE IEE=H J IAA?JEC JANJ MEJD >KJJ  >KJJ E@E?=JAI JANJ J ANA?KJA =I = ?
     =@ 1B JDA E@E?=JA@ JANJ D=I KJEFA MDEJAIF=?AIAF=H=JA@ MH@I JDA BEHIJ EI JDA ?=@
     =A =@ JDA IA?@ =@ IK>IAGKAJ =HA EJI =HCKAJI 1B >KJJ EI ?E?A@ E@E?=JAI = K
     IJHEC acme expands JDA E@E?=JA@ JANJ J BE@ = ?=@ J HK EB JDA ?E? EI MEJDE >KJJ
     IAA?JA@ JANJ acme J=AI JD=J IAA?JE =I JDA ?=@ JDAHMEIA EJ J=AI JDA =HCAIJ IJHEC B
     L=E@ BEA =A ?D=H=?JAHI ?J=EEC JDA ?E? 8=E@ BEA =A ?D=H=?JAHI =HA =FD=KAHE?I =@ _
     . − + / 6DEI >AD=LEH EI IEE=H J @K>A?E?EC MEJD >KJJ  >KJ >A?=KIA = K ?=@ EI
     A=ECAII O = IECA ?E? EI HAGKEHA@
      5A ?=@I = >O ?LAJE IJ=HJEC MEJD = ?=FEJ= AJJAH =HA built−ins JD=J =HA ANA?KJA@
      @EHA?JO >O acme
      Cut     ,AAJA IJ HA?AJO IAA?JA@ JANJ =@ F=?A E I=HB >KBBAH
      Del     ,AAJA ME@M 1B ME@M EI @EHJO EIJA=@ FHEJ = M=HEC = IA?@ Del ME IK??AA@
      Delcol
           ,AAJA ?K =@ = EJI ME@MI =BJAH ?DA?EC JD=J ME@MI =HA J @EHJO
      Delete
           ,AAJA ME@M MEJDKJ ?DA?EC BH @EHJEAII
      Dump 9HEJA JDA IJ=JA B acme J JDA BEA =A EB IFA?EBEA@ H $home/acme.dump >O @AB=KJ
      Edit 6HA=J JDA =HCKAJ =I = JANJ A@EJEC ?=@ E JDA IJOA B sam 6DA BK Sam =
           CK=CA EI EFAAJA@ AN?AFJ BH JDA ?=@I k n q =@ ! 6DA = ?=@ EI IECDJO
           @EBBAHAJ EJ E?K@AI JDA BEA =A =@ CELAI O JDA EA =@@HAII KAII JDA ?=@ EI
           ANFE?EJO =# 6DA ?KHHAJ ME@M BH JDA ?=@ EI JDA >@O B JDA ME@M E MDE?D
           JDA Edit ?=@ EI ANA?KJA@ 7IK=O JDA Edit ?=@ MK@ >A JOFA@ E = J=C
           CAH ?=@I =O >A FHAF=HA@ E = I?H=J?D ME@M =@ ANA?KJA@ MEJD Edit EJIAB E
           JDA ?KHHAJ ME@M KIEC JDA  ?DH@ @AI?HE>A@ >AM
      Exit -NEJ acme =BJAH ?DA?EC JD=J ME@MI =HA J @EHJO
      Font 9EJD  =HCKAJI ?D=CA JDA BJ B JDA =II?E=JA@ ME@M BH BENA@IF=?A@ J
           FHFHJE=IF=?A@ H vice versa /ELA = BEA =A =HCKAJ ?D=CA JDA BJ B JDA ME
           @M J JD=J IJHA@ E JDA =A@ BEA 1B JDA BEA =A =HCKAJ EI FHABENA@ >O var fix
           =I IAJ JDA @AB=KJ FHFHJE=IF=?A@ BENA@IF=?A@ BJ BH BKJKHA KIA J JD=J BJ
           JDAH ANEIJEC ME@MI =HA K=BBA?JA@



                                                    $
)+-                                                                                        )+-



     Get    =@ BEA EJ ME@M HAF=?EC FHALEKI ?JAJI =BJAH ?DA?EC BH @EHJEAII =I E Del
            9EJD  =HCKAJ KIA JDA ANEIJEC BEA =A B JDA ME@M /ELA = =HCKAJ KIA JD=J
            BEA >KJ @ J ?D=CA JDA ME@M I BEA =A
     ID     2HEJ ME@M 1, K>AH q.v.
     Incl 9DA FAEC E?K@A BEAI JDIA A?IA@ E <> MEJD >KJJ ! acme IA=H?DAI E @EHA?
          JHEAI /$objtype/include =@ /sys/include Incl =@@I EJI =HCKAJI J = IKF
          FAAJ=HO EIJ B E?K@A @EHA?JHEAI ==CKI J JDA −I FJE J JDA ?FEAHI 6DEI
          EIJ EI FAHME@M =@ EI EDAHEJA@ MDA ME@MI =HA ?HA=JA@ >O =?JEI E JD=J ME@M I
          Incl EI IJ KIABKO =FFEA@ J = @EHA?JHO ?J=EEC HAAL=J IKH?A 9EJD  =HCKAJI
          Incl FHEJI JDA IKFFAAJ=HO EIJ 6DEI ?=@ EI =HCAO IKFAHIA@A@ >O FK>EC IAA
          plumb$
     Indent
          5AJ JDA =KJE@AJ @A =??H@EC J JDA =HCKAJ on =@ off IAJ JDA @A BH JDA ?KH
          HAJ ME@M ON =@ OFF IAJ JDA @A BH = ANEIJEC =@ BKJKHA ME@MI
     Kill 5A@ = kill JA J acmeEEJE=JA@ ?=@I =A@ =I =HCKAJI
     Load 4AIJHA JDA IJ=JA B acme BH = BEA @AB=KJ $home/acme.dump ?HA=JA@ >O JDA Dump
          ?=@
     Local
          9DA FHABENA@ J = ?=@ HK JDA ?=@ E JDA I=A BEA =A IF=?A =@ ALEH
          AJ L=HE=>A CHKF =I acme 6DA ALEHAJ B JDA ?=@ EI HAIJHE?JA@ >KJ EI IKBBE
          ?EAJ J HK bind 9fs IAA srv" import" AJ? =@ J IAJ ALEHAJ L=HE=>AI IK?D
          =I $objtype
     Look 5A=H?D E >@O BH ??KHHA?A B EJAH= JANJ E@E?=JA@ >O JDA =HCKAJ H EB A EI CELA
          >O JDA IAA?JA@ JANJ E JDA >@O
     New    =A AM ME@M 9EJD =HCKAJI =@ JDA =A@ BEAI EJ ME@MI
     Newcol
          =A AM ?K
     Paste
          4AF=?A IJ HA?AJO IAA?JA@ JANJ MEJD ?JAJI B I=HB >KBBAH
     Put    9HEJA ME@M J JDA =A@ BEA 9EJD  =HCKAJ MHEJA J JDA BEA =A@ E JDA J=C B JDA
            ME@M
     Putall
          9HEJA = @EHJO ME@MI MDIA =AI E@E?=JA ANEIJEC HACK=H BEAI
     Redo +FAAJ B Undo
     Send )FFA@ IAA?JA@ JANJ H I=HB >KBBAH J A@ B >@O KIA@ =EO MEJD win
     Snarf
          2=?A IAA?JA@ JANJ E I=HB >KBBAH
     Sort )HH=CA JDA ME@MI E JDA ?K BH JF J >JJ E ANE?CH=FDE?= H@AH >=IA@ 
          JDAEH =AI
     Tab    5AJ JDA ME@JD B J=> IJFI BH JDEI ME@M J JDA L=KA B JDA =HCKAJ E KEJI B ME@JDI
            B JDA AH ?D=H=?JAH 9EJD  =HCKAJI EJ FHEJI JDA ?KHHAJ L=KA
     Undo 7@ =IJ JANJK= ?D=CA H IAJ B ?D=CAI
     Zerox
          +HA=JA = ?FO B JDA ME@M ?J=EEC IJ HA?AJO IAA?JA@ JANJ
     <|>    1B = HACK=H IDA ?=@ EI FHA?A@A@ >O = < | H > ?D=H=?JAH JDA IAA?JA@ JANJ E JDA
            >@O B JDA ME@M EI =BBA?JA@ >O JDA 1 BH JDA ?=@ 6DA < ?D=H=?JAH ?=KIAI JDA
            IAA?JE J >A HAF=?A@ >O JDA IJ=@=H@ KJFKJ B JDA ?=@ > ?=KIAI JDA IAA?JE J
            >A IAJ =I IJ=@=H@ EFKJ J JDA ?=@ =@ | @AI >JD =J ?A FEFEC JDA IAA?JE
            JDHKCD JDA ?=@ =@ HAF=?EC EJ MEJD JDA KJFKJ
     ) ? F=?A J IJHA JANJ BH ?=@I EI E JDA J=C E B=?J acme =EJ=EI = IAJ B ?
     =@I =FFHFHE=JA J JDA IJ=JA B JDA ME@M J JDA ABJ B JDA >=H E JDA J=C



                                                 %
)+-                                                                                             )+-



      1B JDA JANJ E@E?=JA@ MEJD >KJJ EI J = HA?CEA@ >KEJE EJ EI ANA?KJA@ =I = IDA ?=@
      .H AN=FA E@E?=JEC date MEJD >KJJ HKI date 6DA IJ=@=H@ =@ AHHH KJFKJI B ?
      =@I =HA IAJ J JDA AHHH ME@M =II?E=JA@ MEJD JDA @EHA?JHO BH MDE?D JDA ?=@ M=I
      HK MDE?D ME >A ?HA=JA@ EB A?AII=HO .H AN=FA E = ME@M /adm/users ANA?KJEC pwd
      ME FH@K?A JDA KJFKJ /adm E = FIIE>O AMO?HA=JA@ ME@M =>AA@ /adm/+Errors E =
      ME@M ?J=EEC /sys/src/cmd/sam/sam.c ANA?KJEC mk ME HK mk E
      /sys/src/cmd/sam               FH@K?EC       KJFKJ       E        =      ME@M         =>AA@
      /sys/src/cmd/sam/+Errors 6DA ALEHAJ B IK?D ?=@I ?J=EI JDA L=HE=>A $%
      MEJD L=KA IAJ J JDA BEA=A B JDA ME@M E MDE?D JDA ?=@ EI HK =@ $winid IAJ J JDA
      ME@M I E@ K>AH IAA acme"
  Mouse button 3
     2EJEC =J JANJ MEJD >KJJ ! EIJHK?JI acme J ?=JA H =?GKEHA JDA BEA IJHEC AJ? @AI?HE>A@ >O
     JDA E@E?=JA@ JANJ =@ EJI ?JANJ 6DEI @AI?HEFJE BMI JDA =?JEI J=A MDA >KJJ ! EI
     HAA=IA@ =BJAH IMAAFEC KJ IA JANJ 1 JDA @AI?HEFJE text HABAHI J JDA JANJ B JDA HECE=
     IMAAF H EB EJ M=I K JDA HAIKJ B =FFOEC JDA I=A ANF=IE HKAI JD=J =FFO J >KJJ
     =?JEI
      1B JDA JANJ =AI = ANEIJEC ME@M acme LAI JDA KIA ?KHIH J JDA IAA?JA@ JANJ E JDA
      >@O B JD=J ME@M 1B JDA JANJ =AI = ANEIJEC BEA MEJD  =II?E=JA@ ME@M acme =@I JDA
      BEA EJ = AM ME@M =@ LAI JDA KIA JDAHA 1B JDA JANJ EI = BEA =A ?J=EA@ E =CA
      >H=?AJI acme =@I JDA E@E?=JA@ E?K@A BEA BH JDA @EHA?JHO =FFHFHE=JA J JDA IKBBEN B JDA
      BEA =A B JDA ME@M D@EC JDA JANJ 6DA Incl ?=@ =@@I @EHA?JHEAI J JDA IJ=@=H@
      EIJ
      1B JDA JANJ >ACEI MEJD = ? EJ EI J=A J >A = =@@HAII E JDA IJOA B sam MEJDE JDA >@O
      B JDA ME@M ?J=EEC JDA JANJ 6DA =@@HAII EI AL=K=JA@ JDA HAIKJEC JANJ DECDECDJA@ =@
      JDA KIA LA@ J EJ 6DKI E acme A KIJ JOFA :/regexp H :127 J KIJ /regexp H
      127 6DAHA EI = A=IEAH M=O J ?=JA EJAH= JANJ IAA >AM
      1B JDA JANJ EI = BEA =A BMA@ >O = ? =@ = =@@HAII acme =@I JDA BEA =@ AL=K=JAI JDA
      =@@HAII .H AN=FA ?E?EC >KJJ ! =OMDAHA E JDA JANJ file.c:27 ME FA file.c
      IAA?J EA % =@ FKJ JDA KIA =J JDA >ACEEC B JDA EA 6DA HKAI =>KJ -HHH BEAI @EHA?J
      HEAI =@ I  = ?>EA J =A JDEI = ABBE?EAJ M=O J ELAIJEC=JA AHHHI BH ?FEAHI AJ?
      1B JDA JANJ EI J = =@@HAII H BEA EJ EI J=A J >A EJAH= JANJ MDE?D EI JDA IA=H?DA@ BH E JDA
      >@O B JDA ME@M E MDE?D >KJJ ! M=I ?E?A@ 1B = =J?D EI BK@ EJ EI IAA?JA@ =@ JDA
      KIA EI LA@ JDAHA 6DKI J IA=H?D BH ??KHHA?AI B = MH@ E = BEA KIJ ?E? >KJJ ! 
      JDA MH@ *A?=KIA B JDA HKA B KIEC JDA IAA?JE =I JDA >KJJ ! =?JE IK>IAGKAJ ?E?I ME
      BE@ IK>IAGKAJ ??KHHA?AI MEJDKJ LEC JDA KIA
      1 = JDAIA =?JEI JDA KIA JE EI J @A EB JDA JANJ EI = K IJHEC MEJDE = K
      IAA?JA@ IJHEC E JDA J=C I JD=J BH AN=FA ?FAN HACK=H ANFHAIIEI =O >A IAA?JA@ =@
      =FFEA@ HAFA=JA@O J JDA >@O >O KIJ ?E?EC >KJJ ! LAH JDA
  Chords of mouse buttons
     5ALAH= FAH=JEI =HA >K@ J KJEFA>KJJ =?JEI )BJAH IAA?JEC JANJ MEJD >KJJ  IJE
     @M FHAIIEC >KJJ ANA?KJAI Cut =@ >KJJ ! ANA?KJAI Paste )BJAH ?E?EC A >KJJ
     JDA JDAH K@AI JDA BEHIJ JDKI MDEA D@EC @M >KJJ    BMA@ >O ! EI = Snarf JD=J
     A=LAI JDA BEA K@EHJEA@ ! BMA@ >O EI = F 6DAIA =?JEI =I =FFO J JANJ IAA?JA@ >O
     @K>A?E?EC >A?=KIA JDA @K>A?E? ANF=IE EI =@A MDA JDA IA?@ ?E? IJ=HJI J
     MDA EJ A@I
      +=@I =O >A CELA ANJH= =HCKAJI >O = KIA ?DH@ MEJD >KJJI =@  9DEA D@EC
      @M >KJJ      JANJ J >A ANA?KJA@ =I = ?=@ ?E?EC >KJJ  =FFA@I JDA JANJ =IJ
      FEJA@ J >O >KJJ  =I = @EIJE?J BE= =HCKAJ .H AN=FA J IA=H?D BH EJAH= text A
      =O ANA?KJA Look text MEJD >KJJ H EIJA=@ FEJ =J text MEJD >KJJ  E =O ME@M
      HAA=IA >KJJ  JDA ANA?KJA Look ?E?EC >KJJ  MDEA EI DA@ @M
      9DA = ANJAH= ?=@ AC echo EI ANA?KJA@ JDEI M=O JDA ANJH= =HCKAJ EI F=IIA@ =I
      ANFA?JA@ =@ = ALEHAJ L=HE=>A $acmeaddr EI ?HA=JA@ JD=J D@I E JDA BH EJAHFHAJA@
      >O >KJJ ! JDA BKOGK=EBEA@ =@@HAII B JDA ANJH= =HCKAJ
  Support programs
     Win ?HA=JAI = AM acme ME@M =@ HKI = command @AB=KJ /bin/rc E EJ JKHEC JDA ME@M



                                                    &
)+-                                                                                        )+-



        EJ IAJDEC ==CKI J = rio ME@M -NA?KJEC JANJ E = win ME@M MEJD >KJJ      EI
        IEE=H J KIEC Send
        Awd =@I JDA J=C EA B EJI ME@M MEJD JDA @EHA?JHO E MDE?D EJ I HKEC IKBBENA@ −label
        @AB=KJ rc EJ EI EJA@A@ J >A ANA?KJA@ >O = cd BK?JE BH KIA E win ME@MI ) AN=FA
        @ABEEJE EI
                fn cd { builtin cd $1 && awd $sysname }
  Applications and guide files
     1 JDA @EHA?JHO /acme ELA IALAH= IK>@EHA?JHEAI A=?D ?HHAIF@EC J = FHCH= H IAJ B
     HA=JA@ FHCH=I JD=J AFO acme’s KIAH EJAHB=?A -=?D IK>@EHA?JHO E?K@AI IKH?A >E=HEAI
     =@ = readme BEA BH BKHJDAH EBH=JE 1J =I E?K@AI = guide = JANJ BEA D@EC I=FA
     ?=@I J ELA JDA FHCH=I 6DA E@A= EI J BE@ = AN=FA E JDA CKE@A JD=J >AIJ =J?DAI
     JDA > =J D=@ A@EJ EJ J IKEJ =@ ANA?KJA EJ
        9DAALAH = ?=@ EI ANA?KJA@ >O acme JDA @AB=KJ IA=H?D F=JD E?K@AI JDA @EHA?JHO B JDA
        ME@M ?J=EEC JDA ?=@ =@ EJI IK>@EHA?JHO $cputype 6DA FHCH= @EHA?JHEAI E
        /acme ?J=E =FFHFHE=JAO =>AA@ IK>@EHA?JHEAI B >E=HEAI I ?=@I =A@ E JDA CKE@A
        BEAI ME >A BK@ =KJ=JE?=O MDA HK )I acme >E@I JDA @EHA?JHEAI /acme/bin =@
        /acme/bin/$cputype J JDA >ACEEC B /bin MDA EJ IJ=HJI JDEI EI MDAHA acmeIFA?EBE?
        FHCH=I IK?D =I win =@ awd HAIE@A
FILES
        $home/acme.dump         @AB=KJ BEA BH Dump =@ Load =I MDAHA IJ=JA EI MHEJJA EB acme @EAI
                                H EI EA@ KANFA?JA@O AC >O @AAJEC EJI ME@M
        /acme/*/guide           JAF=JA BEAI BH =FFE?=JEI
        /acme/*/readme          EBH= @?KAJ=JE BH =FFE?=JEI
        /acme/*/src             IKH?A BH =FFE?=JEI
        /acme/*/mips            125IFA?EBE? >E=HEAI BH =FFE?=JEI
SOURCE
     /sys/src/cmd/acme
     /acme/bin/source/win
     /sys/src/cmd/awd.c
SEE ALSO
      acme"
      4> 2EA Acme: A User Interface for Programmers.
BUGS
        9EJD JDA −l FJE H Load ?=@ JDA HA?HA=JE B ME@MI K@AH ?JH B ANJAH= FH
        CH=I IK?D =I win EI KIJ J HAHK JDA ?=@ EBH=JE =O >A IJ




                                                  '
)5161-                                                                                    )5161-




NAME
       =IEJEA   JH=I=JA 2= ' + J )51 +
SYNOPSIS
     ansitize  −c conf   −I dir   −p preload   file 
DESCRIPTION
      Ansitize JH=I=JAI FHCH=I MHEJJA E JDA 2= ' + @E=A?J EJ IJ=@=H@ )51 + FHCH=I FHA
      IAHLEC ?AJI =@ BH=JJEC
       6DA FJEI =HA
       −c conf
             4A=@ ?BECKH=JE EBH=JE BH JDA BEA conf 6DA BH=J B JDA ?BECKH=JE BEA EI
             @EI?KIIA@ >AM
       −I dir )@@ dir J JDA EIJ B @EHA?JHEAI IA=H?DA@ BH #include BEAI /386/include =@
              /sys/include =HA =@@A@ J JDA EIJ =BJAH FH?AIIEC JDA −I FJEI
       −p preload
             *ABHA FH?AIIEC file FH?AII JDA BEA preload >KJ @ J FHEJ EJI JH=I=JE 6DEI FJE
             EI KIABK =EO BH JH=I=JEC DA=@AH BEAI 5AA JDA AN=FAI >AM
       Ansitize JH=I=JAI =O ?IJHK?JI BH 2= ' + @AI?HE>A@ >AM 1J @AI J JH=I=JA JOFAI H
       JDAH BA=JKHAI FHAIAJ E JDA 2= ' + ALEHAJ MDA JDIA BA=JKHAI ?= >A FHLE@A@ >O =FFH
       FHE=JA FHCH= ?JANJ .H AN=FA ansitize HALAI C ?D=H=?JAH ?IJ=JI =@ IJHECI >KJ
       IJE =IIKAI JD=J Rune EI = @ABEA@ JOFA
       Ansitize JH=I=JAI JDA BMEC ?IJHK?JI
   anonymous structures or unions
      2= ' + =MI =OKI IJHK?JKHAI =@ KEI Ansitize CELAI JDAIA ANFE?EJ =AI =@ JH=I
      =JAI HABAHA?AI J HABA?J JDA AM =AI 1B = struct H union name EI @A?=HA@ =O
      KIO ansitize KIAI _name E JDA AM @A?=H=JE JDAHMEIA KEI =HA =A@ u u2 AJ?
      =@ IJHK?JKHAI =HA =A@ _1 _2 AJ? .H AN=FA >O @AB=KJ ansitize JH=I=JAI JDA BEHIJ IJHK?
      JKHA @ABEEJE EJ JDA IA?@
              struct A {                     struct A {                   struct A {
                  union {                        union {                      union {
                      int x;                         int x;                       int x;
                      int y;                         int y;                       int y;
                  };                             } u;                         } au;
                  struct B;                      struct B _B;                 struct B b;
              };                             };                           };
       6DAIA @AB=KJ =AI ?= >A LAHHE@@A >O = ?BECKH=JE EA rename old new MDAHA old EI =
       IECA name H EI tag.name MDE?D HAIJHE?JI JDA HA=EC J JDA AAAJI B struct H union
       tag .H AN=FA KIEC = ?BECKH=JE
              rename A.u au
              rename _B b
              H rename A._b b
       MK@ FH@K?A JDA JDEH@ IJHK?JKHA @ABEEJE =>LA
   anonymous structure promotions
      2= ' + =MI FEJAHI J IJHK?JKHAI MEJD =OKI AAAJI J >A F=IIA@ J BK?JEI ANFA?J
      EC FEJAHI J JDA =OKI AAAJI .H AN=FA CELA JDA IJHK?JKHA @ABEEJE =>LA EB =
      struct A *a EI F=IIA@ J = BK?JE ANFA?JEC = struct B* JDA + ?FEAH EIJA=@ F=IIAI =
      FEJAH J JDA B EIE@A JDA A Ansitize @AI JDA I=A JH=IBH=JE E JDEI ?=IA HAMHEJEC f(a)
      J f(&a−>b) 6DA I=A ?LAHIE =FFEAI J IEFA =IIECAJ B struct A* J struct
      B*
   anonymous function parameters
      2= ' + @AI J HAGKEHA KKIA@ BK?JE F=H=AJAHI J >A =A@ E JDA BK?JE @ABEEJE
      Ansitize =AI JDAIA F=H=AJAHI _1 _2 AJ? .H AN=FA ansitize HAMHEJAI




                                                       
)5161-                                                                                  )5161-



              void main(int, char**) { }
       EJ
              void main(int _1, char** _2) { }
   structure displays
       2= ' + =MI ?=IJA@ EEJE=EAH EIJI =I IJHK?JKHA L=KAI =I E (Point){1,2} Ansitize ?=
       HAMHEJA JDAIA EJ BK?JE ?=I =I E pt(1,2) >KJ O @AI I EB @EHA?JA@ >O = ?BECKH=JE
       EA reconstruct struct−name function−name =I E reconstruct Point pt
   Unicode identifiers
       Ansitize HAMHEJAI E@AJEBEAHI ?J=EEC 7E?@A ?D=H=?JAHI EJ )5+11 AGKEL=AJI HAF=?EC /HAA
       AJJAHI MEJD JDAEH =AI =@ JDAH 7E?@A ?D=H=?JAHI MEJD _xxxx MDAHA xxxx EI JDA DAN=@A?E=
       L=KA B JDA ?D=H=?JAH
   long character constants
       Ansitize HAMHEJAI C ?D=H=?JAH ?IJ=JI EA L’\n’ L’a’ H L’ÿ’ EJ AGKEL=AJ ANFHAIIEI
       EA ’\n’ ’a’ H (Rune)0x00FF
   long string constants
       Ansitize HAF=?AI 4KA IJHEC ?IJ=JI EA L"abc" MEJD HABAHA?AI J IJ=JE?=O @A?=HA@ =HH=OI
       MEJD =AI @AHELA@ BH JDA IJHEC @=J= 1J HA?CEAI JDA IFA?E= ?=IA MDAHA = 4KA IJHEC EI
       >AEC KIA@ J EEJE=EA = 4KA =HH=O =@ HAF=?AI JDA IJHEC E JD=J ?=IA MEJD = =HH=O .H AN=
       FA ansitize HAMHEJAI JDA BEHIJ FHCH= EJ JDA IA?@
                                                          Rune L_abc[] = {’a’,’b’,’c’,0};
              Rune *x = L"abc";                           Rune *x = L_abc;
              Rune y[] = L"def";                          Rune y[] = {’d’,’e’,’f’,0};
   #pragma lines
      Ansitize F=?AI #pragma EAI EIE@A /* */ ?AJI #pragma varargck EAI =HA D=@A@
      IAF=H=JAO =@ =HA F=?A@ EIE@A #ifdef VARARGCK  #endif F=EHI )J A=IJ A ?FEAH
      K@AH @ALAFAJ BH 7EN HA?CEAI JDAIA #pragmaI
   integer/pointer casts
       5A LAHA=CAH 7EN ?FEAHI ?F=E =>KJ ?=IJI BH EJACAH J FEJAH ALA MDA JDA
       FEJAH EI =I ME@A =I H ME@AH JD= JDA EJACAH Ansitize EIAHJI = ANJH= (uintptr) ?=IJ J
       IEA?A JDAIA M=HECI p=(void*)i >A?AI p=(void*)(uintptr)i
   <ctype.h> casts
      6DA =?HI @ABEA@ E 2= ' I <ctype.h> ?=IJ JDAEH =HCKAJI J uchar I JD=J AEJDAH IECA@
      H KIECA@ ?D=H=?JAH =HCKAJI ?= >A F=IIA@ J JDA 7EN I <ctype.h> HAGKEHAI JDA KIA B
      KIECA@ ?D=H=?JAH =HCKAJI Ansitize =@@I ?=IJI =I A?AII=HO J JDA =HCKAJI B isalpha
      isdigit toupper AJ?
EXAMPLES
     ) ?BECKH=JE BEA BH JH=I=JEC JDA regexp  E>H=HO
              rename      Resub.u s
              rename      Resub.u1 e
              rename      Reinst.u u1
              rename      Reinst.u1 u2
       6H=I=JA JDA IKH?A BEAI
              cd /sys/src/libregexp
              for(i in *.c)
                   ansitize −c conf $i >$i.ansi
       6H=I=JA JDA DA=@AH BEA HA=@EC <u.h> =@ <libc.h> BEHIJ BH ?JANJ
              cd /sys/include
              ansitize −p /386/include/u.h −p libc.h regexp.h >regexp.h.ansi
SOURCE
     /sys/src/cmd/ansitize
SEE ALSO
      2c fortune



                                                      
)5161-                                                                                )5161-



       4> 2EA 0M J KIA JDA 2= ' + +FEAH
BUGS
       Ansitize IJFI IDHJ B BK ?DA?EC B JDA EFKJ FHCH= 6AIJ JD=J JDAO ?FEA KIEC 2c
       >ABHA HKEC ansitize
       Ansitize ECHAI #ifdef =@ #define EEJEC JDA E@I B =?HI JD=J ?= >A KIA@ 1 F=HJE?
       K=H =?HI JD=J EJH@K?A AM ?JH BM ?IJHK?JI ME ?BKIA JDA F=HIAH 6DA F=HIAH ?
       J=EI ANJH= CH==H FH@K?JEI J =??@=JA JDA arg  =?HI =@ va_arg
)2                                                                                              )2




NAME
        =F   BAJ?D )II?E=JA@ 2HAII AMI =HJE?AI
SYNOPSIS
     ap  article−name 
DESCRIPTION
      ap BAJ?DAI )II?E=JA@ 2HAII AMI =HJE?AI BH DJJFMMMAMI@=O? 9EJDKJ =O =HCKAJI
      EJ FHLE@AI = JM ?K EIJ B =HJE?A AOI =@ @AI?HEFJEI 9DA ELA@ MEJD = =HJE?A AO EJ
      BAJ?DAI JD=J =HJE?A
SOURCE
     /rc/bin/ap




                                                    !
)4                                                                                                       )4




NAME
        =H   =H?DELA =@ E>H=HO =EJ=EAH
SYNOPSIS
     ar key  posname  afile  file ... 
DESCRIPTION
      Ar =EJ=EI CHKFI B BEAI ?>EA@ EJ = IECA =H?DELA BEA afile 6DA =E KIA B ar EI J ?HA
      =JA =@ KF@=JA E>H=HO BEAI BH JDA =@AHI 2l AJ? 1J ?= >A KIA@ JDKCD BH =O IEE=H FKH
      FIA
        Key EI A ?D=H=?JAH BH JDA IAJ drqtpmx FJE=O ??=JA=JA@ MEJD A H HA B
        vuaibclo 6DA files =HA ?IJEJKAJI B JDA =H?DELA afile 6DA A=ECI B JDA key ?D=H=?JAHI
        =HA
        d       ,AAJA files BH JDA =H?DELA BEA
        r       4AF=?A files E JDA =H?DELA BEA H =@@ JDA EB EIIEC FJE= @EBEAHI =HA
                u      4AF=?A O BEAI MEJD @EBEA@ @=JAI =JAH JD= JD=J B JDA =H?DELA
                a      2=?A AM BEAI =BJAH posname E JDA =H?DELA H=JDAH JD= =J JDA A@
                b H i 2=?A AM BEAI >ABHA posname E JDA =H?DELA
        q       3KE? )FFA@ files J JDA A@ B JDA =H?DELA MEJDKJ ?DA?EC BH @KFE?=JAI )LE@I GK=
                @H=JE? >AD=LEH E for (i in *.v) ar r lib.a $i
        t       EIJ = J=>A B ?JAJI B JDA =H?DELA 1B =AI =HA CELA O JDIA BEAI =HA EIJA@
        p       2HEJ JDA =A@ BEAI E JDA =H?DELA
        m       LA JDA =A@ BEAI J JDA A@ H AIAMDAHA IFA?EBEA@ =I MEJD r
        o       2HAIAHLA JDA =??AII =@ @EBE?=JE JEAI B BEAI ANJH=?JA@ MEJD JDA x ?=@
        x       -NJH=?J JDA =A@ BEAI 1B  =AI =HA CELA = BEAI E JDA =H?DELA =HA ANJH=?JA@ 1 AE
                JDAH ?=IA @AI x =JAH JDA =H?DELA BEA
        v       8AH>IA /ELA = BEA>OBEA @AI?HEFJE B JDA =EC B = AM =H?DELA BEA BH JDA @
                =H?DELA =@ JDA ?IJEJKAJ BEAI 9EJD p FHA?A@A A=?D BEA MEJD = =A 9EJD t CELA =
                C EIJEC B = EBH=JE =>KJ JDA BEAI IAMD=J EA = EIJEC >O ls IDMEC
                        mode uid/gid size date name
        l       ?= H=O ar F=?AI EJI JAFH=HO BEAI E JDA @EHA?JHO /tmp 6DEI FJE ?=KIAI
                JDA J >A F=?A@ E JDA ?= @EHA?JHO
        9DA = d r H m key EI IFA?EBEA@ =@ = A>AHI B JDA =H?DELA =HA L=E@ >A?J BEAI BH JDA I=A
        =H?DEJA?JKHA ar EIAHJI = J=>A B ?JAJI HAGKEHA@ >O JDA =@AHI =J JDA BHJ B JDA E>H=HO 6DA
        J=>A B ?JAJI EI HA>KEJ MDAALAH JDA =H?DELA EI @EBEA@ AN?AFJ MDA JDA q key EI IFA?EBEA@ H
        MDA JDA J=>A B ?JAJI EI ANFE?EJO LA@ H @AAJA@
EXAMPLE
     ar cr lib.a *.v
          4AF=?A JDA ?JAJI B E>H=HO lib.a MEJD JDA >A?J BEAI E JDA ?KHHAJ @EHA?JHO
FILES
        /tmp/v*            JAFH=HEAI
SOURCE
     /sys/src/cmd/ar.c
SEE ALSO
      2l ar$
BUGS
        1B JDA I=A BEA EI AJEA@ JME?A E = =HCKAJ EIJ EJ =O >A FKJ E JDA =H?DELA JME?A
        6DEI ?=@ FHA@=JAI 2= ' =@ =AI IA EL=E@ =IIKFJEI BH EIJ=?A JD=J KIAH E@ I
        =HA KAHE?




                                                        "
)5+11                                                                                              )5+11




NAME
        =I?EE KE?@A   EJAHFHAJ )5+11 7E?@A ?D=H=?JAHI
SYNOPSIS
     ascii  −8cnt   −dox  −b n   text 
        unicode hexmin−hexmax
        unicode  −t  hex   
        unicode  −n  characters
        look hex /lib/unicode
DESCRIPTION
      Ascii FHEJI JDA )5+11 L=KAI ?HHAIF@EC J ?D=H=?JAHI =@ vice versa K@AH JDA −8 FJE JDA
      15 =JE ANJAIEI ?@AI  !%% =HA E?K@A@ 6DA L=KAI =HA EJAHFHAJA@ E = IAJJ=>A
      KAHE? >=IA −o IFA?EBEAI ?J= −d @A?E= −x DAN=@A?E= JDA @AB=KJ =@ −bn >=IA n
        9EJD  =HCKAJI ascii FHEJI = J=>A B JDA ?D=H=?JAH IAJ E JDA IFA?EBEA@ >=IA +D=H=?JAHI B
        text =HA ?LAHJA@ J JDAEH )5+11 L=KAI A FAH EA 1B DMALAH JDA BEHIJ text =HCKAJ EI = L=E@
        K>AH E JDA IFA?EBEA@ >=IA ?LAHIE CAI JDA FFIEJA M=O +JH ?D=H=?JAHI =HA FHEJA@ =I
        JM H JDHAA?D=H=?JAH AE?I JDAH FJEI =HA
        −n     .H?A KAHE? KJFKJ
        −c     .H?A ?D=H=?JAH KJFKJ
        −t     +LAHJ BH K>AHI J HKEC JANJ @ J EJAHFHAJ ?JH ?D=H=?JAHI H EIAHJ AM
               EAI
        Unicode EI IEE=H EJ ?LAHJI >AJMAA 76. =@ ?D=H=?JAH L=KAI BH JDA 7E?@A 5J=@=H@ IAA
        utf$ 1B CELA = H=CA B DAN=@A?E= K>AHI unicode FHEJI = J=>A B JDA IFA?EBEA@ 7E?@A
        ?D=H=?JAHI      JDAEH L=KAI =@ 76. HAFHAIAJ=JEI JDAHMEIA EJ JH=I=JAI BH 76. J KAHE?
        L=KA H LE?A LAHI= @AFA@EC  JDA =FFA=H=?A B JDA IKFFEA@ JANJ JDA −n FJE BH?AI
        KAHE? KJFKJ J =LE@ =>ECKEJO MEJD KAHE? ?D=H=?JAHI 1B ?LAHJEC J 76.  JDA ?D=H=?JAHI
        =HA FHEJA@ A FAH EA KAII JDA −t B=C EI IAJ E MDE?D ?=IA JDA KJFKJ EI = IECA IJHEC ?
        J=EEC O JDA IFA?EBEA@ ?D=H=?JAHI 7EA ascii unicode JHA=JI  ?D=H=?JAHI IFA?E=O
        6DA KJFKJ B ascii =@ unicode =O >A KDAFBK EB JDA ?D=H=?JAHI FHEJA@ =HA J =L=E=>A E JDA
        ?KHHAJ BJ
        6DA BEA /lib/unicode ?J=EI = J=>A B ?D=H=?JAHI =@ @AI?HEFJEI IHJA@ E DAN=@A?E=
        H@AH IKEJ=>A BH look  JDA MAH ?=IA hex L=KAI B ?D=H=?JAHI
EXAMPLES
     ascii −d
          2HEJ JDA )5+11 J=>A >=IA 
        unicode p
             2HEJ JDA DAN L=KA B F 
        unicode 2200−22f1
             2HEJ = J=>A B EI?A=AKI =JDA=JE?= IO>I
        look 039 /lib/unicode
             5AA JDA IJ=HJ B JDA /HAA =FD=>AJ I A?@EC E JDA 7E?@A 5J=@=H@
FILES
        /lib/unicode         J=>A B ?D=H=?JAHI =@ @AI?HEFJEI
SOURCE
     /sys/src/cmd/ascii.c
     /sys/src/cmd/unicode.c
SEE ALSO
      look tcs utf$ font$




                                                       #
)9                                                                                                )9




NAME
       =M    F=JJAH@EHA?JA@ I?=EC =@ FH?AIIEC =CK=CA
SYNOPSIS
     awk  −F fs   −d   −mf n   −mr n   −safe   −v var=value   −f progfile  prog   file ... 
DESCRIPTION
      Awk I?=I A=?D EFKJ file BH EAI JD=J =J?D =O B = IAJ B F=JJAHI IFA?EBEA@ EJAH=O E prog H
      E A H HA BEAI IFA?EBEA@ =I −f progfile 9EJD A=?D F=JJAH JDAHA ?= >A = =II?E=JA@ =?JE
      JD=J ME >A FAHBHA@ MDA = EA B = file =J?DAI JDA F=JJAH -=?D EA EI =J?DA@ =C=EIJ JDA
      F=JJAH FHJE B ALAHO F=JJAH=?JE IJ=JAAJ JDA =II?E=JA@ =?JE EI FAHBHA@ BH A=?D
      =J?DA@ F=JJAH 6DA BEA =A − A=I JDA IJ=@=H@ EFKJ )O file B JDA BH var=value EI
      JHA=JA@ =I = =IIECAJ J = BEA =A =@ EI ANA?KJA@ =J JDA JEA EJ MK@ D=LA >AA FAA@
      EB EJ MAHA = BEA =A 6DA FJE −v BMA@ >O var=value EI = =IIECAJ J >A @A >ABHA
      JDA FHCH= EI ANA?KJA@ =O K>AH B −v FJEI =O >A FHAIAJ −F fs FJE @ABEAI JDA
      EFKJ BEA@ IAF=H=JH J >A JDA HACK=H ANFHAIIE fs
       ) EFKJ EA EI H=O =@A KF B BEA@I IAF=H=JA@ >O MDEJA IF=?A H >O HACK=H ANFHAIIE FS
       6DA BEA@I =HA @AJA@ $1 $2  MDEA $0 HABAHI J JDA AJEHA EA 1B FS EI K JDA EFKJ EA EI
       IFEJ EJ A BEA@ FAH ?D=H=?JAH
       6 ?FAI=JA BH E=@AGK=JA EFAAJ=JE B IJH=CA ==CAAJ JDA −mr FJE ?= >A
       KIA@ J IAJ JDA =NEK IEA B JDA EFKJ HA?H@ =@ JDA −mf FJE J IAJ JDA =NEK K
       >AH B BEA@I
       6DA −safe FJE ?=KIAI awk J HK E I=BA @A E MDE?D EJ EI J =MA@ J HK IDA ?
       =@I H FA BEAI =@ JDA ALEHAJ EI J =@A =L=E=>A E JDA ENVIRON L=HE=>A
       ) F=JJAH=?JE IJ=JAAJ D=I JDA BH
               pattern { action }
       ) EIIEC { action } A=I FHEJ JDA EA = EIIEC F=JJAH =M=OI =J?DAI 2=JJAH=?JE IJ=JA
       AJI =HA IAF=H=JA@ >O AMEAI H IAE?I
       ) =?JE EI = IAGKA?A B IJ=JAAJI ) IJ=JAAJ ?= >A A B JDA BMEC
       if( expression ) statement  else statement 
       while( expression ) statement
       for( expression ; expression ; expression ) statement
       for( var in array ) statement
       do statement while( expression )
       break
       continue
       {  statement ...  }
       expression                         # ?O var = expression
       print  expression−list   > expression 
       printf format  , expression−list   > expression 
       return  expression 
       next                               # IEF HA=EEC F=JJAHI  JDEI EFKJ EA
       nextfile                           # IEF HAIJ B JDEI BEA FA ANJ IJ=HJ =J JF
       delete array[ expression ]         # @AAJA = =HH=O AAAJ
       delete array                       # @AAJA = AAAJI B =HH=O
       exit  expression                 # ANEJ EA@E=JAO IJ=JKI EI expression
       5J=JAAJI =HA JAHE=JA@ >O IAE?I AMEAI H HECDJ >H=?AI ) AFJO expression−list
       IJ=@I BH $0 5JHEC ?IJ=JI =HA GKJA@ " " MEJD JDA KIK= + AI?=FAI HA?CEA@ MEJDE
       -NFHAIIEI J=A  IJHEC H KAHE? L=KAI =I =FFHFHE=JA =@ =HA >KEJ KIEC JDA FAH=JHI +
       * / % ^ ANFAJE=JE =@ ??=JA=JE E@E?=JA@ >O MDEJA IF=?A 6DA FAH=JHI ! ++
           += = *= /= %= ^= > >= < <= == != ?: =HA =I =L=E=>A E ANFHAIIEI 8=HE
       =>AI =O >A I?==HI =HH=O AAAJI @AJA@ x[i]) H BEA@I 8=HE=>AI =HA EEJE=EA@ J JDA K
       IJHEC )HH=O IK>I?HEFJI =O >A =O IJHEC J A?AII=HEO KAHE? JDEI =MI BH = BH B =II
       ?E=JELA AHO KJEFA IK>I?HEFJI IK?D =I [i,j,k] =HA FAHEJJA@ JDA ?IJEJKAJI =HA ?
       ?=JA=JA@ IAF=H=JA@ >O JDA L=KA B SUBSEP




                                                       $
)9                                                                                              )9



     6DA print IJ=JAAJ FHEJI EJI =HCKAJI  JDA IJ=@=H@ KJFKJ H  = BEA EB >file H >>file EI
     FHAIAJ H  = FEFA EB |cmd EI FHAIAJ IAF=H=JA@ >O JDA ?KHHAJ KJFKJ BEA@ IAF=H=JH =@ JAH
     E=JA@ >O JDA KJFKJ HA?H@ IAF=H=JH file =@ cmd =O >A EJAH= =AI H F=HAJDAIEA@
     ANFHAIIEI E@AJE?= IJHEC L=KAI E @EBBAHAJ IJ=JAAJI @AJA JDA I=A FA BEA 6DA
     printf IJ=JAAJ BH=JI EJI ANFHAIIE EIJ =??H@EC J JDA BH=J IAA fprintf  . 6DA >KEJ
     E BK?JE close(expr) ?IAI JDA BEA H FEFA expr 6DA >KEJE BK?JE fflush(expr)
     BKIDAI =O >KBBAHA@ KJFKJ BH JDA BEA H FEFA expr 1B expr EI EJJA@ H EI = K IJHEC = FA
     BEAI =HA BKIDA@
     6DA =JDA=JE?= BK?JEI exp log sqrt sin cos =@ atan2 =HA >KEJ E JDAH >KEJE
     BK?JEI
     length   1B EJI =HCKAJ EI = IJHEC JDA IJHEC I ACJD EI HAJKHA@ 1B EJI =HCKAJ EI = =HH=O
              JDA K>AH B IK>I?HEFJI E JDA =HH=O EI HAJKHA@ 1B  =HCKAJ JDA ACJD B $0 EI
              HAJKHA@
     rand     H=@ K>AH  
     srand    IAJI IAA@ BH rand =@ HAJKHI JDA FHALEKI IAA@
     int      JHK?=JAI J = EJACAH L=KA
     utf      ?LAHJI EJI KAHE?= =HCKAJ = ?D=H=?JAH K>AH J = 76. IJHEC
     substr(s, m, n)
              JDA n?D=H=?JAH IK>IJHEC B s JD=J >ACEI =J FIEJE m ?KJA@ BH 
     index(s, t)
              JDA FIEJE E s MDAHA JDA IJHEC t ??KHI H  EB EJ @AI J
     match(s, r)
              JDA FIEJE E s MDAHA JDA HACK=H ANFHAIIE r ??KHI H  EB EJ @AI J 6DA L=HE
              =>AI RSTART =@ RLENGTH =HA IAJ J JDA FIEJE =@ ACJD B JDA =J?DA@ IJHEC
     split(s, a, fs)
              IFEJI JDA IJHEC s EJ =HH=O AAAJI a[1] a[2]  a[n] =@ HAJKHI n 6DA IAF
              =H=JE EI @A MEJD JDA HACK=H ANFHAIIE fs H MEJD JDA BEA@ IAF=H=JH FS EB fs EI J
              CELA ) AFJO IJHEC =I BEA@ IAF=H=JH IFEJI JDA IJHEC EJ A =HH=O AAAJ FAH
              ?D=H=?JAH
     sub(r, t, s)
              IK>IJEJKJAI t BH JDA BEHIJ ??KHHA?A B JDA HACK=H ANFHAIIE r E JDA IJHEC s 1B s EI
              J CELA $0 EI KIA@
     gsub     I=A =I sub AN?AFJ JD=J = ??KHHA?AI B JDA HACK=H ANFHAIIE =HA HAF=?A@ sub
              =@ gsub HAJKH JDA K>AH B HAF=?AAJI
     sprintf(fmt, expr, ...)
              JDA IJHEC HAIKJEC BH BH=JJEC expr ... =??H@EC J JDA printf BH=J fmt
     system(cmd)
              ANA?KJAI cmd =@ HAJKHI EJI ANEJ IJ=JKI
     tolower(str)
              HAJKHI = ?FO B str MEJD = KFFAH?=IA ?D=H=?JAHI JH=I=JA@ J JDAEH ?HHAIF@EC
              MAH?=IA AGKEL=AJI
     toupper(str)
              HAJKHI = ?FO B str MEJD = MAH?=IA ?D=H=?JAHI JH=I=JA@ J JDAEH ?HHAIF@EC
              KFFAH?=IA AGKEL=AJI
     6DA BK?JE getline IAJI $0 J JDA ANJ EFKJ HA?H@ BH JDA ?KHHAJ EFKJ BEA getline
     <file IAJI $0 J JDA ANJ HA?H@ BH file getline x IAJI L=HE=>A x EIJA=@ .E=O cmd |
     getline FEFAI JDA KJFKJ B cmd EJ getline A=?D ?= B getline HAJKHI JDA ANJ EA B
     KJFKJ BH cmd 1 = ?=IAI getline HAJKHI  BH = IK??AIIBK EFKJ  BH A@ B BEA =@ 
     BH = AHHH
     2=JJAHI =HA =H>EJH=HO *A= ?>E=JEI MEJD ! || && B HACK=H ANFHAIIEI =@ HA=JE=
     ANFHAIIEI 4ACK=H ANFHAIIEI =HA =I E regexp$ 1I=JA@ HACK=H ANFHAIIEI E = F=JJAH
     =FFO J JDA AJEHA EA 4ACK=H ANFHAIIEI =O =I ??KH E HA=JE= ANFHAIIEI KIEC JDA
     FAH=JHI ~ =@ !~ /re/ EI = ?IJ=J HACK=H ANFHAIIE =O IJHEC ?IJ=J H L=HE=>A =O
     >A KIA@ =I = HACK=H ANFHAIIE AN?AFJ E JDA FIEJE B = EI=JA@ HACK=H ANFHAIIE E = F=J
     JAH
     ) F=JJAH =O ?IEIJ B JM F=JJAHI IAF=H=JA@ >O = ?= E JDEI ?=IA JDA =?JE EI FAHBHA@
     BH = EAI BH = ??KHHA?A B JDA BEHIJ F=JJAH JDKCD = ??KHHA?A B JDA IA?@



                                                    %
)9                                                                                            )9



      ) HA=JE= ANFHAIIE EI A B JDA BMEC
             expression matchop regular−expression
             expression relop expression
             expression in array−name
             (expr,expr,... ) in array−name
      MDAHA = relop EI =O B JDA IEN HA=JE= FAH=JHI E + =@ = matchop EI AEJDAH ~ =J?DAI H !~
      @AI J =J?D ) ?@EJE= EI = =HEJDAJE? ANFHAIIE = HA=JE= ANFHAIIE H = *A=
      ?>E=JE B JDAIA
      6DA IFA?E= F=JJAHI BEGIN =@ END =O >A KIA@ J ?=FJKHA ?JH >ABHA JDA BEHIJ EFKJ EA EI
      HA=@ =@ =BJAH JDA =IJ BEGIN =@ END @ J ?>EA MEJD JDAH F=JJAHI
      8=HE=>A =AI MEJD IFA?E= A=ECI
      CONVFMT        ?LAHIE BH=J KIA@ MDA ?LAHJEC K>AHI @AB=KJ %.6g
      FS             HACK=H ANFHAIIE KIA@ J IAF=H=JA BEA@I =I IAJJ=>A >O FJE Ffs
      NF             K>AH B BEA@I E JDA ?KHHAJ HA?H@
      NR             H@E= K>AH B JDA ?KHHAJ HA?H@
      FNR            H@E= K>AH B JDA ?KHHAJ HA?H@ E JDA ?KHHAJ BEA
      FILENAME       JDA =A B JDA ?KHHAJ EFKJ BEA
      RS             EFKJ HA?H@ IAF=H=JH @AB=KJ AMEA
      OFS            KJFKJ BEA@ IAF=H=JH @AB=KJ >=
      ORS            KJFKJ HA?H@ IAF=H=JH @AB=KJ AMEA
      OFMT           KJFKJ BH=J BH K>AHI @AB=KJ %.6g
      SUBSEP         IAF=H=JAI KJEFA IK>I?HEFJI @AB=KJ !"
      ARGC           =HCKAJ ?KJ =IIEC=>A
      ARGV           =HCKAJ =HH=O =IIEC=>A K A>AHI =HA J=A =I BEA =AI
      ENVIRON        =HH=O B ALEHAJ L=HE=>AI IK>I?HEFJI =HA =AI
      .K?JEI =O >A @ABEA@ =J JDA FIEJE B = F=JJAH=?JE IJ=JAAJ JDKI
             function foo(a, b, c) { ...; return x }
      2=H=AJAHI =HA F=IIA@ >O L=KA EB I?==H =@ >O HABAHA?A EB =HH=O =A BK?JEI =O >A ?=A@
      HA?KHIELAO 2=H=AJAHI =HA ?= J JDA BK?JE = JDAH L=HE=>AI =HA C>= 6DKI ?= L=HE
      =>AI =O >A ?HA=JA@ >O FHLE@EC AN?AII F=H=AJAHI E JDA BK?JE @ABEEJE
EXAMPLES
     length($0) > 72
          2HEJ EAI CAH JD= % ?D=H=?JAHI
      { print $2, $1 }
           2HEJ BEHIJ JM BEA@I E FFIEJA H@AH
      BEGIN { FS = ",[ \t]*|[ \t]+" }
            { print $2, $1 }
           5=A MEJD EFKJ BEA@I IAF=H=JA@ >O ?= =@H >=I =@ J=>I
             { s += $1 }
      END    { print "sum is", s, " average is", s/NR }
             )@@ KF BEHIJ ?K FHEJ IK =@ =LAH=CA
      /start/, /stop/
           2HEJ = EAI >AJMAA IJ=HJIJF F=EHI
      BEGIN     {    # Simulate echo(1)
           for (i = 1; i < ARGC; i++) printf "%s ", ARGV[i]
           printf "\n"
           exit }
SOURCE
     /sys/src/cmd/awk
SEE ALSO
      sed regexp$
      ) 8 )D * 9 AHECD= 2  9AE>AHCAH The AWK Programming Language, )@@EI9AIAO
      '&& 15*  %'&:



                                                       &
)9                                                                                         )9



BUGS
       6DAHA =HA  ANFE?EJ ?LAHIEI >AJMAA K>AHI =@ IJHECI 6 BH?A = ANFHAIIE J >A
       JHA=JA@ =I = K>AH =@@  J EJ J BH?A EJ J >A JHA=JA@ =I = IJHEC ??=JA=JA "" J EJ
       6DA I?FA HKAI BH L=HE=>AI E BK?JEI =HA = >J?D JDA IOJ=N EI MHIA
       76. EI J =M=OI @A=J MEJD ?HHA?JO JDKCD awk @AI =A = =JJAFJ J @ I 6DA split BK?
       JE MEJD = AFJO IJHEC =I BE= =HCKAJ M ?FAI MEJD 76. E JDA IJHEC >AEC IFEJ




                                                   '
*)5-)-                                                                               *)5-)-




NAME
       >=IA=A    IJHEF BEA =A =BBENAI
SYNOPSIS
     basename  −d  string  suffix 
DESCRIPTION
      Basename @AAJAI =O FHABEN A@EC E I=ID / =@ JDA suffix EB FHAIAJ E string BH string
      =@ FHEJI JDA HAIKJ  JDA IJ=@=H@ KJFKJ
       6DA −d FJE EIJA=@ FHEJI JDA @EHA?JHO ?FAJ JD=J EI string KF J >KJ J E?K@EC JDA
       BE= I=ID 1B JDA IJHEC ?J=EI  I=ID = FAHE@ =@ AMEA =HA FHEJA@
SOURCE
     /sys/src/cmd/basename.c




                                                  !
*+                                                                                                *+




NAME
        >?   =H>EJH=HOFHA?EIE =HEJDAJE? =CK=CA
SYNOPSIS
     bc  −cdls   file ... 
DESCRIPTION
      Bc EI = EJAH=?JELA FH?AIIH BH = =CK=CA JD=J HAIA>AI + >KJ FHLE@AI =HEJDAJE?  K>AHI
      B =H>EJH=HO ACJD MEJD KF J  @ECEJI HECDJ B JDA @A?E= FEJ 1J J=AI EFKJ BH =O BEAI
      CELA JDA HA=@I JDA IJ=@=H@ EFKJ
        6DA −d FJE A=>AI @A>KCCEC KJFKJ 6DA −l FJE IJ=@I BH JDA =A B = =H>EJH=HO FHA
        ?EIE =JD E>H=HO 6DA −s FJE IKFFHAIIAI JDA =KJ=JE? @EIF=O B ?=?K=JE HAIKJI = KJ
        FKJ EI LE= JDA print ?=@
        6DA BMEC IOJ=N BH bc FHCH=I EI EA JD=J B + L A=I AJJAH az E A=I ANFHAIIE S
        A=I IJ=JAAJ
        ANE?=
                         ?AJI =HA A?IA@ E /* */
                         AMEAI A@ IJ=JAAJI
        =AI
                         IEFA L=HE=>AI L
                         =HH=O AAAJI L[E]
                         6DA MH@I ibase obase =@ scale
        JDAH FAH=@I
                         =H>EJH=HEO C K>AHI MEJD FJE= IEC =@ @A?E= FEJ
                         (E)
                         sqrt(E)
                         length(E)
                                 K>AH B IECEBE?=J @A?E= @ECEJI
                         scale(E)
                                 K>AH B @ECEJI HECDJ B @A?E= FEJ
                         L(E,...,E)
                                 BK?JE ?=
        FAH=JHI
                         + − * / % ^ % EI HA=E@AH ^ EI FMAH
                         ++ −−
                         == <= >= != < >
                         = += −= *= /= %= ^=
        5J=JAAJI
                         E
                         { S ;  ; S }
                         print E
                         if ( E ) S
                         while ( E ) S
                         for ( E ; E ; E ) S
                         K IJ=JAAJ
                         break
                         quit
                         "JANJ"
        .K?JE @ABEEJEI
                         define L ( L ,  , L ){
                         auto L ,  , L
                         S ;  ; S
                         return E
                         }
        .K?JEI E     −l =JD E>H=HO
                         s(x) IEA
                         c(x) ?IEA




                                                       !
*+                                                                                                  *+



                         e(x) ANFAJE=
                         l(x) C
                         a(x) =H?J=CAJ
                         j(n, x)
                               *AIIA BK?JE
        ) BK?JE =HCKAJI =HA F=IIA@ >O L=KA
        6DA L=KA B = ANFHAIIE =J JDA JF ALA EI FHEJA@ KAII JDA =E FAH=JH EI = =IIECAJ H
        JDA −s ?=@ EA =HCKAJ EI CELA 6ANJ E GKJAI MDE?D =O E?K@A AMEAI EI =M=OI
        FHEJA@ -EJDAH IAE?I H AMEAI =O IAF=H=JA IJ=JAAJI )IIECAJ J scale EBK
        A?AI JDA K>AH B @ECEJI J >A HAJ=EA@  =HEJDAJE? FAH=JEI E JDA =AH B dc )IIEC
        AJI J ibase H obase IAJ JDA EFKJ =@ KJFKJ K>AH H=@EN HAIFA?JELAO
        6DA I=A AJJAH =O >A KIA@ =I = =HH=O = BK?JE =@ = IEFA L=HE=>A IEKJ=AKIO )
        L=HE=>AI =HA C>= J JDA FHCH= )KJ=JE? L=HE=>AI =HA FKIDA@ @M @KHEC BK?JE ?=I
        1 = @A?=H=JE B = =HH=O =I = BK?JE =HCKAJ H =KJ=JE? L=HE=>A AFJO IGK=HA >H=?AJI
        KIJ BM JDA =HH=O =A
        Bc EI =?JK=O = FHAFH?AIIH BH dc MDE?D EJ ELAI =KJ=JE?=O KAII JDA −c ?FEA O
        FJE EI FHAIAJ 1 JDEI ?=IA JDA dc EFKJ EI IAJ J JDA IJ=@=H@ KJFKJ EIJA=@
EXAMPLE
     ,ABEA = BK?JE J ?FKJA = =FFHNE=JA L=KA B JDA ANFAJE= 7IA EJ J FHEJ  L=KAI
     6DA ANFAJE= BK?JE E JDA E>H=HO CELAI >AJJAH =IMAHI
        scale = 20
        define e(x) {
             auto a, b, c, i, s
             a = 1
             b = 1
             s = 1
             for(i=1; 1; i++) {
                  a *= x
                  b *= i
                  c = a/b
                  if(c == 0) return s
                  s += c
             }
        }
        for(i=1; i<=10; i++) print e(i)
FILES
        /sys/lib/bclib =JDA=JE?= E>H=HO
SOURCE
     /sys/src/cmd/bc.y
SEE ALSO
      dc hoc
BUGS
         && || H ! FAH=JHI
        ) for IJ=JAAJ KIJ D=LA = JDHAA EI
        ) quit EI EJAHFHAJA@ MDA HA=@ J MDA ANA?KJA@




                                                      !
*1,                                                                                              *1,




NAME
       >E@ KJ KKJ     ?D=CA =A IF=?A
SYNOPSIS
     bind  option ...  new old
       mount  option ...  servename old  spec 
       unmount  new  old
DESCRIPTION
      Bind =@ mount @EBO JDA BEA =A IF=?A B JDA ?KHHAJ FH?AII =@ JDAH FH?AIIAI E JDA I=A
      =A IF=?A CHKF IAA fork  .H >JD ?=I old EI JDA =A B = ANEIJEC BEA H @EHA?JHO E
      JDA ?KHHAJ =A IF=?A MDAHA JDA @EBE?=JE EI J >A =@A
       .H bind new EI JDA =A B =JDAH H FIIE>O JDA I=A ANEIJEC BEA H @EHA?JHO E JDA ?KHHAJ
       =A IF=?A )BJAH = IK??AIIBK bind JDA BEA =A old EI = =E=I BH JDA >A?J HECE=O =A@
       >O new EB JDA @EBE?=JE @AI J DE@A EJ new ME =I IJE HABAH J EJI HECE= BEA 6DA AL=K=
       JE B new IAA intro  D=FFAI =J JDA JEA B JDA bind J MDA JDA >E@EC EI =JAH KIA@
       6DA servename =HCKAJ J mount EI JDA =A B = BEA JD=J MDA FAA@ OEA@I = ANEIJEC ?
       A?JE J = BEA IAHLAH )IJ =M=OI servename ME >A = BEA E /srv IAA srv! 1 JDA @EI?KI
       IE >AM new HABAHI J JDA BEA =A@ >O JDA new =HCKAJ J bind H JDA HJ @EHA?JHO B JDA
       IAHLE?A =L=E=>A E servename =BJAH = mount -EJDAH >JD old =@ new BEAI KIJ >A @EHA?JHEAI H
       >JD KIJ J >A @EHA?JHEAI
       FJEI ?JH =IFA?JI B JDA @EBE?=JE J JDA =A IF=?A
       A    4AF=?A JDA old BEA >O JDA AM A 0A?ABHJD = AL=K=JE B old ME >A JH=I=JA@
                 J JDA AM BEA 1B JDAO =HA @EHA?JHEAI BH mount JDEI ?@EJE EI JHKA >O @ABEEJE
                 old >A?AI = union directory ?IEIJEC B A @EHA?JHO JDA AM BEA
       −b        *JD BEAI KIJ >A @EHA?JHEAI )@@ JDA AM @EHA?JHO J JDA >ACEEC B JDA KE
                 @EHA?JHO HAFHAIAJA@ >O JDA @ BEA
       −a        *JD BEAI KIJ >A @EHA?JHEAI )@@ JDA AM @EHA?JHO J JDA A@ B JDA KE @EHA?JHO
                 HAFHAIAJA@ >O JDA @ BEA
       −c        6DEI ?= >A KIA@ E =@@EJE J =O B JDA =>LA J FAHEJ ?HA=JE E = KE @EHA?JHO
                 9DA = AM BEA EI ?HA=JA@ E = KE @EHA?JHO EJ EI F=?A@ E JDA BEHIJ AAAJ B JDA
                 KE JD=J D=I >AA >K@ H KJA@ MEJD JDA −c B=C 1B JD=J @EHA?JHO @AI J D=LA
                 MHEJA FAHEIIE JDA ?HA=JA B=EI
       −C        O E mount *O @AB=KJ BEA ?JAJI =HA =M=OI HAJHEALA@ BH JDA IAHLAH 9EJD JDEI
                 FJE JDA AHA =O EIJA=@ KIA = ?= ?=?DA J I=JEIBO read# HAGKAIJI BH BEAI
                 =??AIIE>A JDHKCD JDEI KJ FEJ 6DA ?KHHA?O B ?=?DA@ @=J= BH = BEA EI LAHEBEA@ =J
                 A=?D open# B JDA BEA BH JDEI ?EAJ =?DEA
       −q        -NEJ IEAJO EB JDA bind H mount FAH=JE B=EI
       Mount J=AI JM =@@EJE= FJEI 6DA BEHIJ −k keypattern ?IJH=EI JDA IAJ B factotum"
       AOI KIA@ BH = =KJDAJE?=JA@ KJ 6DA IA?@ −n ?=KIAI mount J IEF =KJDAJE?=JE
       AJEHAO
       6DA spec =HCKAJ J mount EI F=IIA@ E JDA attach# AII=CA J JDA IAHLAH =@ IAA?JI =C
       @EBBAHAJ BEA JHAAI IAHLA@ >O JDA IAHLAH
       6DA srv! IAHLE?A HACEIJHO @ALE?A H=O >K@ J /srv EI = ?LAEAJ HA@ALKI FEJ BH
       IAHLE?AI JD=J ?= >A KJA@ )BJAH >JIJH=F JDA BEA /srv/boot ?J=EI JDA ?KE?=JEI
       FHJ J JDA BEA IOIJA BH MDE?D JDA IOIJA M=I =@A@
       6DA ABBA?JI B bind =@ mount ?= >A K@A MEJD JDA unmount ?=@ 1B JM =HCKAJI =HA
       CELA J unmount JDA ABBA?J EI J K@ = bind H mount MEJD JDA I=A =HCKAJI 1B O A
       =HCKAJ EI CELA ALAHOJDEC >K@ J H KJA@ KF old EI KKJA@
EXAMPLES
     6 ?FEA = FHCH= MEJD JDA + E>H=HO BH KO $ '' 




                                                     !!
*1,                                                                 *1,



              mount /srv/boot /n/dump dump
              bind /n/dump/1992/0716/mips/lib/libc.a /mips/lib/libc.a
              mk
SOURCE
     /sys/src/cmd/bind.c
     /sys/src/cmd/mount.c
     /sys/src/cmd/unmount.c
SEE ALSO
      bind  open  srv! srv"




                                         !"
*165;),                                                                                *165;),




NAME
       >EJIO=@ ECDJ FA?= AO>=H@ F=H=I FHFJAH     >EJIOIFA?EBE? KJEEJEAI
SYNOPSIS
     bitsy/bitsyload k|r  file 
       bitsy/light  intensity 
       bitsy/params  f 
       bitsy/pencal
       bitsy/keyboard  n 
       bitsy/prompter  n  file
DESCRIPTION
      Bitsyload AH=IAI = IA?JE B B=ID AHO  JDA *EJIO E2)3 !$# H !&! =@ ?FEAI AM EBH
      =JE EJ EJ KIEC JDA BH=J HAGKEHA@ >O JDA +F=G >J =@AH 6DA HAGKEHA@ BEHIJ =HCKAJ
      EI JDA @AIJE=JE AEJDAH k BH /dev/flash/kernel H r BH /dev/flash/ramdisk 6DA
      FJE= IA?@ =HCKAJ EI JDA =A B JDA BEA J =@ 6DA @AB=KJ AHA BEA EI
      /sys/src/9/bitsy/9bitsy                  =@      JDA       @AB=KJ     H=@EI       BEA     EI
      /sys/src/9/bitsy/ramdisk
       Light IAJI JDA EJAIEJO B JDA @EIF=O >=?ECDJ 6DA L=KAI BH intensity =HA
             IAJ EJAIEJO J =NEK JDA @AB=KJ
       BB     JKH BB >=?ECDJ
       n       IAJI JDA EJAIEJO J n MDAHA n EI = L=KA >AJMAA  =@  & 1JAIEJO  @AI J JKH BB
               JDA >=?ECDJ EJ KIJ IAJI EJ J JDA @EAIJ L=KA
       Pencal ?=E>H=JAI JDA @EIF=O MEJD JDA JK?D I?HAA  = *EJIO 1J FI FHFJEC JDA KIAH MEJD
       ?HIIAI MDIA ?AJAH JD=J JDA KIAH KIJ JK?D MEJD JDA IJOKI )BJAH = ?IEIJAJ IAJ B JK?DAI EJ
       MHEJAI JDA ?=E>H=JE >JD J JDA AHA =@ J IJ=@=H@ KJ 1J EI H=O ?=A@ >O JDA >EJIO I
       /bin/cpurc
       Params ?FEAI JDA ?JAJI B JDA BEA /dev/tmpparams EJ JDA                     B=ID   F=HJEJE
       /dev/flash/params H EB JDA −f B=C EJ IAJ ?FEAI E JDA FFIEJA @EHA?JE
       Keyboard ?HA=JAI = LEHJK= I?HAA AO>=H@ =@ KAII JDA −n FJE EI IFA?EBEA@ = I?HE>>A
       =HA= ) KIAH EFKJI ?D=H=?JAHI >O J=FFEC JDA AOI H >O @H=MEC ?D=H=?JAHI E JDA I?HE>>A =HA=
       IAA scribble  1J EI KIK=O HK =I JDA AO>=H@ ?=@ BH rio KIEC rio I −k FJE
       Prompter EI = I= A@EJH KIA@ J ?BECKHA F=H=AJAHI MDA = *EJIO >JI 1J @EIF=OI JDA BEA
       =@ IJ=HJI KF = AO>=H@ =@ I?HE>>A F=@ BH EFKJ +E?EC MEJD JDA IJOKI E JDA JANJ IAA?JI
       MDAHA EFKJ ?D=H=?JAHI ME C 2HAIIEC *KJJ # JF ABJ IE@A B JDA *EJIO H JOFEC JDA Esc AO
        JDA AO>=H@ ?=KIAI prompter J MHEJA >=? JDA KF@=JA@ BEA =@ ANEJ Del ?=KIAI prompter J
       ANEJ MEJDKJ MHEJEC JDA BEA 6DA −n B=C IKFFHAIIAI JDA I?HE>>A =HA=
EXAMPLE
     Prompter params =@ calibrate =HA KIA@ E O A F=?A JDA *EJIO I /rc/bin/cpurc

       # set variables
       ramfs
       bitsy/params −f
       if(! grep −s ’^calibrate=’ /tmp/tmpparams)
            bitsy/pencal >>/tmp/tmpparams
       if not {
            eval ‘{grep ’^calibrate=’ /tmp/tmpparams}
            echo calibrate $calibrate > ’#m/mousectl’
       }
       bitsy/prompter /tmp/tmpparams
       bitsy/params
SOURCE
     /sys/src/cmd/bitsy



                                                     !#
*7,-                                                                                         *7,-




NAME
       >K@A    ?A?J BEAI BH @EIJHE>KJE
SYNOPSIS
     bundle file ...
DESCRIPTION
      Bundle MHEJAI  EJI IJ=@=H@ KJFKJ = IDA I?HEFJ BH rc H = *KHA IDA MDE?D MDA ANA
      ?KJA@ ME HA?HA=JA JDA HECE= files 1JI =E KIA EI BH @EIJHE>KJEC I= K>AHI B JANJ BEAI >O
      mail
       )JDKCD AII HABEA@ JD= IJ=@=H@ =H?DELAI BH ar H tar = bundle BEA EI IAB
       @?KAJEC =@ ?FAJA EJJA FHAF=H=JE EI HAGKEHA@  JDA HA?AELEC =?DEA
EXAMPLES
     bundle mkfile *.[ch] | mail kremvax!boris
          5A@ = =ABEA J *HEI JCAJDAH MEJD HA=JA@ .c =@ .h BEAI 7F HA?AELEC JDA =E
          *HEI =O I=LA JDA BEA I=I FIJ=H I=O E gift/horse JDA @
       cd gift; rc horse; mk
SOURCE
     /rc/bin/bundle
SEE ALSO
      ar tar mail
BUGS
       Bundle ME J ?HA=JA @EHA?JHEAI =@ EI KI=JEIB=?JHO BH JANJ BEAI
       *AM=HA B CEBJ DHIAI




                                                     !$
+)                                                                                               +)




NAME
         ?=   FHEJ ?=A@=H
SYNOPSIS
     cal  month   year 
DESCRIPTION
      Cal FHEJI = ?=A@=H Month EI AEJDAH = K>AH BH  J   = MAH ?=IA JD =A H = MAH
      ?=IA JDHAAAJJAH FHABEN B = JD =A Year ?= >A >AJMAA  =@ '''' 1B AEJDAH month H
      year EI EJJA@ JDA ?KHHAJ JD H OA=H EI KIA@ 1B O A =HCKAJ EI CELA =@ EJ EI = K
      >AH =HCAH JD=   = ?=A@=H BH = JMALA JDI B JDA CELA OA=H EI FH@K?A@ JDAHMEIA = ?=
      A@=H BH KIJ A JD EI FHEJA@ 6DA ?=A@=H FH@K?A@ EI JD=J BH -C=@ =@ DAH ?EAI
         6HO
                 cal sep 1752
SOURCE
     /sys/src/cmd/cal.c
BUGS
         6DA OA=H EI =M=OI ?IE@AHA@ J IJ=HJ E =K=HO ALA JDKCD JDEI EI DEIJHE?=O =ELA
         *AM=HA JD=J cal 90 HABAHI J JDA A=HO +DHEIJE= AH= J JDA JD ?AJKHO




                                                       !%
+)-,)4                                                                                    +)-,)4




NAME
        ?=A@=H   FHEJ KF?EC ALAJI
SYNOPSIS
     calendar  −dy   −p days   file ... 
DESCRIPTION
      Calendar HA=@I JDA =A@ BEAI @AB=KJ /usr/$user/lib/calendar =@ MHEJAI J IJ=@=H@
      KJFKJ =O EAI ?J=EEC J@=O I H JHHM I @=JA -N=FAI B HA?CEA@ @=JA BH=JI =HA
      " )FHE  )FH   )FHE =@  )FH ) IFA?E= BH =O >A KIA@ J HAFHAIAJ
      MAAO =@ JDO ALAJI -LAHO 6KAI@=O 6DA JDEH@ 9A@AI@=O ) ?F=HEII =HA ?=IA EIA
      IEJELA
        1B JDA −y B=C EI CELA = =JJAFJ EI =@A J =J?D  OA=H J 1 JDEI ?=IA @=JAI B JDA BHI
        EIJA@ =>LA ME >A =??AFJA@ EB JDAO =HA BMA@ >O JDA ?KHHAJ OA=H H =IJ JM @ECEJI JDAHAB H
        J = OA=H    @ECEJI J BMA@ >O MDEJA IF=?A H @ECEJI
        1B JDA −p B=C EI CELA EJI =HCKAJ EI JDA K>AH B @=OI =DA=@ J =J?D @=JAI 6DEI B=C EI J
        HAFA=J=>A =@ EJ FAHBHI  IFA?E= FH?AIIEC =J JDA A@ B JDA MAA
        6DA −d B=C A=>AI @A>KCCEC KJFKJ
         .HE@=O =@ 5=JKH@=O ALAJI JDHKCD @=O =HA FHEJA@
        6 D=LA OKH ?=A@=H =EA@ J OK ALAHO @=O KIA cron&
FILES
        /usr/$user/lib/calendar               FAHI= ?=A@=H
SOURCE
     /sys/src/cmd/calendar.c




                                                     !&
+)6                                                                                                +)6




NAME
         ?=J HA=@   ?=JA=JA BEAI
SYNOPSIS
     cat  file ... 
     read  −m   −n nline   file ... 
DESCRIPTION
      Cat HA=@I A=?D file E IAGKA?A =@ MHEJAI EJ  JDA IJ=@=H@ KJFKJ 6DKI
                cat file
         FHEJI = BEA =@
                cat file1 file2 >file3
         ??=JA=JAI JDA BEHIJ JM BEAI =@ F=?AI JDA HAIKJ  JDA JDEH@
         1B  file EI CELA cat HA=@I BH JDA IJ=@=H@ EFKJ KJFKJ EI >KBBAHA@ E >?I =J?DEC JDA
         EFKJ
         Read ?FEAI J IJ=@=H@ KJFKJ AN=?JO A EA BH JDA =A@ file @AB=KJ IJ=@=H@ EFKJ 1J EI
         KIABK E EJAH=?JELA rc I?HEFJI
         6DA −m B=C ?=KIAI EJ J ?JEKA HA=@EC =@ MHEJEC KJEFA EAI KJE A@ B BEA −n ?=KIAI EJ
         J HA=@  HA JD= nline EAI
         Read =M=OI ANA?KJAI = IECA write BH A=?D EA B EFKJ MDE?D ?= >A DAFBK MDA FHAF=HEC
         EFKJ J FHCH=I JD=J ANFA?J EA=J=JEA @=J= 1J ALAH HA=@I =O HA @=J= BH JDA EFKJ
         JD= EJ FHEJI J JDA KJFKJ
SOURCE
     /sys/src/cmd/cat.c
     /sys/src/cmd/read.c
SEE ALSO
      cp
DIAGNOSTICS
     Read ANEJI MEJD IJ=JKI eof  A@ B BEA H E JDA −n ?=IA EB EJ @AI J HA=@ nlines EAI
BUGS
         *AM=HA B cat a b >a =@ cat a b >b MDE?D @AIJHO EFKJ BEAI >ABHA HA=@EC JDA




                                                       !'
+*                                                                                               +*




NAME
        ?>   + FHCH= >A=KJEBEAH
SYNOPSIS
     cb  −js   −l length   file  
DESCRIPTION
      Cb HA=@I IOJ=?JE?=O ?HHA?J + FHCH=I BH BH EJI EFKJ H JDA CELA BEAI =@ MHEJAI JDA J
      EJI IJ@KJ MEJD = HA LEIK=O FA=IEC IF=?EC =@ E@AJ=JE Cb K@AHIJ=@I  + IOJ=N
      >=H AMEAJAHE=JA@ ?AJI =@ >O @AB=KJ = KIAH AMEAI =HA FHAIAHLA@ E JDA KJFKJ
        6DA FJEI =HA
        −j     E IFEJ EAI
        −s     2HEJ ?@A E JDA I?=A@ 4 IJOA KIA@ E The C Programming Language 
        −l length
             5FEJ EAI JD=J =HA CAH JD= length
SOURCE
     /sys/src/cmd/cb
BUGS
        Cb @AI J HABH=J IJHK?JKHA EEJE=EAHI
        2K?JK=JE DE@@A E =?HI ?= ?=KIA E@AJ=JE AHHHI




                                                    "
+0/42                                                                                       +0/42




NAME
       ?DCHF   ?D=CA BEA CHKF
SYNOPSIS
     chgrp  −ou  group file ...
DESCRIPTION
      6DA CHKF B A=?D =A@ BEA EI ?D=CA@ J group MDE?D IDK@ >A = =A M J JDA IAHLAH
      D@EC JDA BEA
       ) BEA I CHKF ?= >A ?D=CA@ >O JDA BEA I MAH EB JDA MAH EI = A>AH B JDA AM CHKF H
       >O JDA A=@AH B >JD JDA BEA I ?KHHAJ CHKF =@ JDA AM CHKF
       6DA −o =@ −u FJE =HA IOOI JDAO IFA?EBO JD=J JDA owner EI J >A IAJ H=JDAH JD= JDA
       CHKF 6DAO =HA EABBA?JK= KAII JDA BEA IAHLAH EI E JDA >JIJH=F IJ=JA JD=J FAHEJI ?D=CEC
       BEA MAHIDEF
SOURCE
     /sys/src/cmd/chgrp.c
SEE ALSO
      ls chmod stat 




                                                   "
+0,                                                                                       +0,




NAME
       ?D@     ?D=CA @A
SYNOPSIS
     chmod mode file ...
DESCRIPTION
      6DA @A B A=?D =A@ BEA EI ?D=CA@ =??H@EC J mode, MDE?D =O >A = ?J= K>AH H =
      IO>E? ?D=CA J JDA ANEIJEC @A ) mode EI = ?J= K>AH ?IJHK?JA@ BH JDA 4 B JDA
      BMEC @AI
       "      HA=@ >O MAH
              MHEJA >O MAH
             ANA?KJA IA=H?D E @EHA?JHO >O MAH
       %      HA=@ MHEJA ANA?KJA IA=H?D >O CHKF
       %      HA=@ MHEJA ANA?KJA IA=H?D >O JDAHI
       ) IO>E? mode D=I JDA BH
               MD op permission
       6DA who F=HJ EI = ?>E=JE B JDA AJJAHI u BH KIAH I FAHEIIEI g CHKF =@ o JDAH
       6DA AJJAH a IJ=@I BH ugo 1B who EI EJJA@ JDA @AB=KJ EI a
       Op ?= >A + J =@@ permission J JDA BEA I @A − J J=A =M=O permission =@ = J =IIEC
       permission =>IKJAO = JDAH >EJI ME >A HAIAJ
       Permission EI =O ?>E=JE B JDA AJJAHI r HA=@ w MHEJA x ANA?KJA a =FFA@ O l
       AN?KIELA =??AII =@ t JAFH=HO BEA
       O JDA MAH B = BEA H JDA CHKF A=@AH B EJI CHKF =O ?D=CA JDA BEA I @A
SOURCE
     /sys/src/cmd/chmod.c
SEE ALSO
      ls stat  stat#




                                                     "
+-))-                                                                               +-))-




NAME
       ?A==A    ?A= = F=JD =A
SYNOPSIS
     cleanname  −d pwd  names ...
DESCRIPTION
      .H A=?D BEA =A =HCKAJ cleanname >O ANE?= FH?AIIEC O FHEJI JDA IDHJAIJ AGKEL=AJ
      IJHEC JD=J =AI JDA I=A FIIE>O DOFJDAJE?= BEA 1J AEE=JAI KJEFA =@ JH=EEC I=IDAI
      =@ EJ ANE?=O EJAHFHAJI . =@ .. @EHA?JHO ?FAJI E JDA =A 1B JDA −d FJE EI FHAIAJ
      KHJA@ =AI =HA FHABENA@ MEJD pwd/ >ABHA FH?AIIEC
SOURCE
     /sys/src/cmd/cleanname.c
SEE ALSO
      cleanname 




                                                    "!
+2                                                                                                +2




NAME
       ?F      ?F=HA JM BEAI
SYNOPSIS
     cmp  −lLs  file1 file2  offset1  offset2  
DESCRIPTION
      Cmp ?F=HAI JDA JM BEAI =@ FHEJI = AII=CA EB JDA ?JAJI @EBBAH
       6DA FJEI =HA
       −l       2HEJ JDA >OJA K>AH @A?E= =@ JDA @EBBAHEC >OJAI DAN=@A?E= BH A=?D @EBBAHA?A
       −L       2HEJ JDA EA K>AH B JDA BEHIJ @EBBAHEC >OJA
       −s       2HEJ JDEC BH @EBBAHEC BEAI >KJ IAJ JDA ANEJ IJ=JKI
       1B BBIAJI =HA CELA ?F=HEI IJ=HJI =J JDA @AIEC=JA@ >OJA FIEJE B JDA ?HHAIF@EC BEA
       BBIAJI JD=J >ACE MEJD 0x =HA DAN=@A?E= MEJD 0 ?J= MEJD =OJDEC AIA @A?E=
SOURCE
     /sys/src/cmd/cmp.c
SEE ALSO
      diff
DIAGNOSTICS
     1B = BEA EI E=??AIIE>A H EIIEC JDA ANEJ IJ=JKI EI open 1B JDA BEAI =HA JDA I=A JDA ANEJ IJ=JKI
     EI AFJO JHKA 1B JDAO =HA JDA I=A AN?AFJ JD=J A EI CAH JD= JDA JDAH JDA ANEJ IJ=JKI EI
     EOF JDAHMEIA cmp HAFHJI JDA FIEJE B JDA BEHIJ @EI=CHAAEC >OJA =@ JDA ANEJ IJ=JKI EI
     differ




                                                        ""
+                                                                                            +




NAME
         ?   ?K =ECAJ
SYNOPSIS
     col  −bfx 
DESCRIPTION
      Col LAH=OI EAI J ANFKCA HALAHIA EA BAA@I -5+% =@ D=B EA BAA@I -5+' =@ -5+& =I
      FH@K?A@ >O nroff BH  + E ms$ H man$ =@ BH tbl Col EI = FKHA BEJAH 1J H=O AEJI
      O BK EA BAA@I FJE −f BEA =MI D=B EA BAA@I J FJE −b HALAI >=?IF=?AI
      FHEJEC KIJ A B A=?D FEA B LAHIJHK? ?D=H=?JAHI Col H=O ?LAHJI MDEJA IF=?A J J=>I
      FJE −x LAHHE@AI JDEI BA=JKHA JDAH AI?=FA@ ?D=H=?JAHI =@ FHEJEC ?D=H=?JAHI =HA
      ECHA@
EXAMPLES
     tbl file | nroff −ms | col | p
          .H=J IA J=>AI BH FHEJEC  JOFAMHEJAHI KIA col J HALA HALAHIA EA BAA@I =@
          F=CE=JA JDA KJFKJ
SEE ALSO
      pr
BUGS
         Col ?= J >=? KF HA JD=  & EAI H D=@A HA JD= & ?D=H=?JAHI FAH EA =@ K@AH
         IJ=@I VT ! =I HALAHIA EA BAA@




                                                   "#
+45                                                                                       +45




NAME
        CAJ=F ?HI   @EIF=O ?H =F
SYNOPSIS
     colors  −rx 
        getmap  colormap 
DESCRIPTION
      Colors FHAIAJI = CHE@ IDMEC JDA ?HI E JDA ?KHHAJ ?H =F 1B JDA @EIF=O EI JHKA ?H
      colors IDMI = CHE@ B JDA 4/*8 ?H =F IAA color$
        +E?EC KIA >KJJ  LAH = ?H E JDA CHE@ ME @EIF=O JDA =F E@AN BH JD=J ?H EJI HA@
        CHAA =@ >KA ?FAJI =@ JDA ! >EJ DAN=@A?E= ?H L=KA =I @ABEA@ E allocimage 
        1B JDA −x FJE EI IFA?EBEA@ JDA ?FAJI ME =I >A EIJA@ E DAN=@A?E=
        6DA −r FJE EIJA=@ IDMI E JDA I=A BH = CHAOI?=A H=F
        ) AK  KIA >KJJ ! ?J=EI = IECA AJHO J ANEJ JDA FHCH=
         &>EJ ?H=FFA@ @EIF=OI getmap =@I JDA @EIF=O I ?H =F @AB=KJ rgbv 6DA
        =A@ colormap ?= >A = BEA E JDA ?KHHAJ @EHA?JHO H E JDA IJ=@=H@ HAFIEJHO /lib/cmap
        1J ?= =I >A = IJHEC B JDA BH gamma H gammaN, MDAHA N EI = B=JEC FEJ L=KA BH JDA
        C== @ABEEC JDA ?JH=IJ BH = ?DHA =F 5EE=HO rgamma =@ rgammaN @ABEA =
        HALAHIALE@A ?DHA =F .E=O JDA =AI screen H display H vga =HA J=A =I
        IOOI BH JDA ?KHHAJ ?H =F IJHA@ E JDA @EIF=O D=H@M=HA
FILES
        /lib/cmap @EHA?JHO B ?H =F BEAI
SOURCE
     /sys/src/cmd/colors.c
SEE ALSO
      color$




                                                    "$
+                                                                                           +




NAME
       ?     IAA?J H HAA?J EAI ? J JM IHJA@ BEAI
SYNOPSIS
     comm  −123  file1 file2
DESCRIPTION
      Comm HA=@I file1 =@ file2 MDE?D =HA E ANE?CH=FDE?= H@AH =@ FH@K?AI = JDHAA ?K KJ
      FKJ EAI O E file1 EAI O E file2 =@ EAI E >JD BEAI 6DA BEA =A − A=I JDA IJ=
      @=H@ EFKJ
       .=C 1 2 H 3 IKFFHAIIAI FHEJEC B JDA ?HHAIF@EC ?K
EXAMPLE
     comm −12 file1 file2
               2HEJ EAI ? J JM IHJA@ BEAI
SOURCE
     /sys/src/cmd/comm.c
SEE ALSO
      sort cmp diff uniq




                                                     "%
+                                                                                                 +




NAME
       ? JAAJ HN D=OAI NI NH   HAJA CE ANA?KJE =@ :,- BEA JH=IBAH
SYNOPSIS
     con  −CdnrRsTv   −b baud   −l  user    −S svc   −c cmd  netmachine
       telnet  −dCrn   −s svc  netmachine
       rx  −eTr   −l user  netmachine  command−word ... 
       hayes  −pv  number  device 
       xms  −1p  file
       xmr file
DESCRIPTION
      Con ?A?JI J JDA ?FKJAH MDIA AJMH =@@HAII EI netmachine =@ CI E EB FIIE>A 9EJD
       FJEI JDA =??KJ =A KIA@  JDA HAJA IOIJA EI JDA I=A =I JD=J  JDA ?= IOIJA
      5J=@=H@ EFKJ =@ KJFKJ C J JDA ?= =?DEA
       FJEI =HA
       −b     IAJI JDA >=K@ H=JA B = @E=KF ?A?JE J baud
       −n     EB JDA EFKJ EI = BEA H FEFA @ J D=C KF JDA ?A?JE MDA -. EI HA?AELA@ >KJ
              EIJA=@ M=EJ BH JDA HAJA A@ J D=C KF
       −l     MEJD = =HCKAJ ?=KIAI user J >A KIA@ =I JDA =??KJ =A  JDA HAJA IOIJA MDA
              FAHBHEC *5, rlogin =KJDAJE?=JE 9EJDKJ = =HCKAJ JDEI FJE @EI=>AI =KJ=JE?
              CE =@ = H= CE IAIIE AIKAI
       −C     BH?AI ?A@ @A JD=J EI ?= A?D
       −c     HKI cmd =I EB EJ D=@ >AA JOFA@ =I = ?=@ BH JDA AI?=FA @A
       −v     LAH>IA @A ?=KIAI EBH=JE =>KJ ?A?JE =JJAFJI J >A KJFKJ J IJ=@=H@
              AHHH 6DEI ?= >A KIABK MDA JHOEC J @A>KC AJMH ?A?JELEJO
       −d     ?=KIAI @A>KCCEC EBH=JE J >A KJFKJ J IJ=@=H@ AHHH
       −r     IKFFHAIIAI FHEJEC B =O ?=HHE=CA HAJKH BMA@ >O = AM EA 6DEI EI KIABK IE?A ?=H
              HE=CA HAJKH EI = FHEJ=>A ?D=H=?JAH E 2= '
       −R     JH=I=JAI AMEAI J ?=HHE=CA HAJKHI =@ vice versa
       −T     JH=I=JAI E?EC ?=HHE=CA HAJKHI J AMEAI
       −s     IJHEFI HA?AELA@ ?D=H=?JAHI J % >EJI J BHAIJ= EIEJAHFHAJ=JE B )5+11 MEJD F=HEJO =I 76.
       −S     2IJ = FEFA =I /srv/svc =@ ?A?J EJ J IJ=@=H@ EFKJ =@ KJFKJ 6DEI ?= >A KIA@
              MEJD −n J ?HA=JA = IJ=@EC ?A?JE JD=J consolefs" BH AN=FA ?= JDA FA .H
              telnet JDEI FJE EI −s
       6DA ?JH \ ?D=H=?JAH EI = ?= AI?=FA 1J FHFJI MEJD >>> ACEJE=JA HAIFIAI J JDA
       FHFJ =HA
       i      5A@ = GKEJ IE? IEC= J JDA HAJA =?DEA
       q      -NEJ
       b      5A@ = >HA=
       .      4AJKH BH JDA AI?=FA
       !cmd   4K JDA ?=@ MEJD JDA AJMH ?A?JE =I EJI IJ=@=H@ EFKJ =@ IJ=@=H@ KJFKJ
              5J=@=H@ AHHH ME C J JDA I?HAA 6DEI EI KIABK BH JH=IEJJEC =@ HA?AELEC BEAI LAH
              JDA ?A?JEI KIEC FHCH=I IK?D =I xms
       r      6CCA FHEJEC B ?=HHE=CA HAJKHI
       Telnet EI IEE=H J ? >KJ KIAI JDA telnet FHJ? J ?KE?=JA MEJD JDA HAJA =?DEA 1J
       ID=HAI con’s −C −d −n =@ −r FJEI
       Rx ANA?KJAI A IDA ?=@  JDA HAJA =?DEA =I EB CCA@ E JDAHA >KJ MEJD ?= IJ=
       @=H@ EFKJ =@ KJFKJ ) HK@EAJ=HO IDA ALEHAJ EI FHLE@A@ 1B JDA J=HCAJ EI = 2= '
       =?DEA $service JDAHA ME >A rx FJEI =HA



                                                     "&
+                                                                                           +



         e    = AH ACJD AII=CA ME J >A MHEJJA J JDA ?A?JE MDA IJ=@=H@ EFKJ EI ?IA@
         l    HKI =I user  JDA HAJA =?DEA EB JDA HAJA EI = *5, =?DEA
         r    I=A =I BH con
       −T     I=A =I BH con
       AJMH =@@HAIIAI BH >JD con =@ rx D=LA JDA BH network!machine 5KFFHJA@ AJMHI =HA
       JDIA EIJA@ E /net
       Hayes @E=I number  = 0=OAI?F=JE>A @A device 7@AH −p EJ KIAI FKIA @E=EC 7F
       ?A?JEC >OJAI =HA ?FEA@ >E@EHA?JE=O >AJMAA JDA ?A?JE =@ IJ=@=H@ EFKJ =@ KJ
       FKJ
       6DA ?=@I xms =@ xmr HAIFA?JELAO IA@ =@ HA?AELA = IECA BEA KIEC JDA :,- FHJ
       ? 6DAO KIA IJ=@=H@ EFKJ =@ IJ=@=H@ KJFKJ BH ?KE?=JE =@ =HA EJA@A@ BH KIA
       MEJD con 6DA −1 FJE J xms ?=KIAI EJ J KIA E>OJA F=?AJ IEA B  " >OJAI 6DA −p FJE
       ?=KIAI EJ J FHEJ = FHCHAII AII=CA ALAHO JA E>OJAI
EXAMPLES
     rx kremvax cat file1 >file2
          +FO HAJA file1 J ?= file2
       rx kremvax cat file1 ’>file2’
            +FO HAJA file1 J HAJA file2.
       eqn paper | rx kremvax troff −ms | rx deepthought lp
            2=H=A FH?AIIEC @ A=?D IJ=CA B = FEFAEA  = @EBBAHAJ =?DEA
SOURCE
     /sys/src/cmd/rx.c
     /sys/src/cmd/ip/telnet.c
     /sys/src/cmd/con                       BH = JDAH ?=@I
SEE ALSO
      cpu ssh telco"
BUGS
       Con =@ telnet =HA AHAO >IAI?AJ JDA JDAH ?=@I =HA >IAJA =@ @AFHA?=JA@
       7@AH rx = FHCH= JD=J IDK@ >AD=LA IFA?E=O JM=H@I JAHE=I =O J AC HAJA IDAI
       ME J FHFJ )I K@AH rx JDA HAJA IJ=@=H@ AHHH =@ IJ=@=H@ KJFKJ =HA ?>EA@ =@
       C EIAF=H=>O J JDA ?= IJ=@=H@ KJFKJ Rx ME ?IKA EJI IJ=@=H@ EFKJ >O ?FOEC EJ J
       JDA HAJA IOIJA I HA@EHA?J EJ BH /dev/null EB JD=J I J MD=J OK M=J




                                                   "'
+2                                                                                                 +2




NAME
        ?F B?F L    ?FO LA BEAI
SYNOPSIS
     cp  −gux  file1 file2
     cp  −gux  file ... directory
        fcp  −gux  file1 file2
        fcp  −gux  file ... directory
        mv file1 file2
        mv file ... directory
DESCRIPTION
      1 JDA BEHIJ BH file1 EI =O =A =@ file2 EI =O =A AN?AFJ = ANEIJEC @EHA?JHO 1 JDA IA?@
      BH JDA ?=@I ?FO H LA A H HA files EJ = directory K@AH JDAEH HECE= BEA
      =AI =I EB >O = IAGKA?A B ?=@I E JDA BEHIJ BH 6DKI cp f1 f2 dir EI AGKEL=AJ J
      cp f1 dir/f1; cp f2 dir/f2
        Cp ?FEAI JDA ?JAJI B F=E file1 J file2 6DA @A =@ MAH B file2 =HA FHAIAHLA@ EB EJ
        =HA=@O ANEIJI JDA @A B file1 EI KIA@ JDAHMEIA 6DA −x FJE IAJI JDA @A =@ @EBEA@
        JEA B file2 BH file1 −g IAJI JDA CHKF E@ =@ −u IAJI JDA CHKF E@ =@ KIAH E@ MDE?D EI KIK
        =O O FIIE>A EB JDA BEA IAHLAH EI E = =@EEIJH=JELA @A
        Fcp >AD=LAI EA cp >KJ JH=IBAHI KJEFA >?I E F=H=A MDEA ?FOEC EJ EI JE?A=>O B=IJAH
        JD= cp MDA JDA BEAI ELLA@ =HA IJHA@  IAHLAHI ?A?JA@ LAH C@EIJ=?A EAI 1J EI O
        =FFHFHE=JA J KIA fcp MEJD BEA IAHLAHI JD=J HAIFA?J JDA offset E read# =@ write AII=CAI 6DEI
        E?K@AI JDA @EI>=IA@ BEA IOIJAI =@ H=BI >KJ AN?K@AI IJ @ALE?A BEA IOIJAI
        Mv LAI file1 J file2 1B JDA BEAI =HA E JDA I=A @EHA?JHO file1 EI KIJ HA=A@ JDAHMEIA mv
        >AD=LAI EA cp −x BMA@ >O rm file1 Mv ME HA=A @EHA?JHEAI >KJ EJ HABKIAI J LA = @EHA?
        JHO EJ =JDAH @EHA?JHO
SOURCE
     /sys/src/cmd/cp.c
     /sys/src/cmd/fcp.c
     /sys/src/cmd/mv.c
SEE ALSO
      cat dircp E tar stat  read#
DIAGNOSTICS
     Cp fcp =@ mv HABKIA J ?FO H LA BEAI J JDAIALAI




                                                    #
+22                                                                                                  +22




NAME
         ?FF   + =CK=CA FHAFH?AIIH
SYNOPSIS
     cpp  option ...   ifile  ofile  
DESCRIPTION
      Cpp EJAHFHAJI )51 + FHAFH?AIIH @EHA?JELAI =@ @AI =?H IK>IJEJKJE 6DA EFKJ ifile =@
      KJFKJ ofile @AB=KJ J IJ=@=H@ EFKJ =@ IJ=@=H@ KJFKJ HAIFA?JELAO
         6DA FJEI =HA
         −Dname
         −Dname=def
         −Idir 5=A =I E 2c =@@ dir J JDA IA=H?D BH @EHA?JELAI
         −M     /AAH=JA  KJFKJ AN?AFJ = EIJ B E?K@A BEAI E = BH IKEJ=>A BH IFA?EBOEC @AFA@A
                ?EAI J mk 7IA JME?A J EIJ BEAI E =CA >H=?AJI
         −N     6KH BB @AB=KJ E?K@A @EHA?JHEAI ) KIJ >A IFA?EBEA@ MEJD −I H E JDA ALEHAJ
                L=HE=>A include 9EJDKJ JDEI FJE /$objtype/include =@ /sys/include
                =HA KIA@ =I JDA =IJ JM IA=H?DA@ @EHA?JHEAI BH E?K@A @EHA?JELAI MDAHA $objtype EI
                HA=@ BH JDA ALEHAJ
         −V     2HEJ ANJH= @A>KCCEC EBH=JE
         −P     , J EIAHJ #line @EHA?JELAI EJ JDA KJFKJ
         −+     7@AHIJ=@ + ?AJI
         −.     1DE>EJ E?K@A IA=H?D E JDA IKH?A I @EHA?JHO
         −i     2HEJ JDA EIJ B @EHA?JHEAI IA=H?DA@ MDA #include EI BK@ =IJ EIJA@ =HA IA=H?DA@ BEHIJ
         1 JDA =>IA?A B JDA −P FJE JDA FH?AIIA@ JANJ KJFKJ EI IFHEA@ MEJD EAI JD=J IDM JDA
         HECE= EFKJ EA K>AHEC
                #line linenumber "ifile"
         6DA ?=@ HA=@I JDA ALEHAJ L=HE=>A include =@ =@@I EJI >=IAF=H=JA@ EIJ B @EHA?
         JHEAI J JDA IJ=@=H@ IA=H?D F=JD BH @EHA?JELAI 6DAO =HA A@ =J >ABHA =O @EHA?JHEAI IFA?E
         BEA@ MEJD −I MDE?D =HA A@ =J >ABHA JDA @AB=KJ @EHA?JHEAI
         6DA EFKJ =CK=CA EI =I @AI?HE>A@ E JDA )51 + IJ=@=H@ 6DA IJ=@=H@ 2= ' + ?FEAHI @
         J KIA cpp JDAO ?J=E JDAEH M IEFA >KJ =@AGK=JA FHAFH?AIIH I cpp EI KIK=O IKFAHBK
         KI
FILES
         /sys/include      @EHA?JHO BH =?DEAE@AFA@AJ E?K@A BEAI
         /$objtype/include @EHA?JHO BH =?DEA@AFA@AJ E?K@A BEAI
SOURCE
     /sys/src/cmd/cpp
SEE ALSO
      2c




                                                      #
+27                                                                                                +27




NAME
         ?FK   ?A?JE J +27 IAHLAH
SYNOPSIS
     cpu  −h server   −u user   −a auth−method   −P patternfile   −e encryption−hash−algs  
     −k keypattern   −c cmd args ... 
         cpu  −R  −O 
DESCRIPTION
      Cpu IJ=HJI = rc HKEC  JDA server =?DEA H JDA =?DEA =A@ E JDA $cpu ALEH
      AJ L=HE=>A EB JDAHA EI  −h FJE Rc I IJ=@=H@ EFKJ KJFKJ =@ AHHH BEAI ME >A
      /dev/cons E JDA =A IF=?A MDAHA JDA cpu ?=@ M=I ELA@ H=O cpu EI HK E =
      rio ME@M  = JAHE= I rc KJFKJ CAI J JD=J ME@M =@ EFKJ ?AI BH JDA AO
      >=H@ MDA JD=J ME@M EI ?KHHAJ Rc I ?KHHAJ @EHA?JHO EI JDA MHEC @EHA?JHO B JDA cpu ?
      =@ EJIAB
         6DA =A IF=?A BH JDA AM rc EI = ==CKA B JDA =A IF=?A MDAHA JDA cpu ?=@ M=I
         ELA@ EJ EI JDA I=A AN?AFJ BH =H?DEJA?JKHA@AFA@AJ >E@ECI IK?D =I /bin =@ JDA KIA B
         B=IJ F=JDI J BEA IAHLAHI EB =L=E=>A
         1B = −u =HCKAJ EI FHAIAJ cpu KIAI JDA =HCKAJ =I JDA HAJA KIAH E@
         1B = −c =HCKAJ EI FHAIAJ JDA HA=E@AH B JDA ?=@ EA EI ANA?KJA@ >O rc  JDA IAHLAH
         =@ JDA cpu ANEJI
         1B = −P =HCKAJ EI FHAIAJ JDA patternfile EI F=IIA@ J exportfs" J ?JH DM K?D B JDA
         ?= =A IF=?A ME >A ANFHJA@ J JDA HAJA IOIJA
         6DA −a ?=@ =MI JDA KIAH J IFA?EBO JDA =KJDAJE?=JE A?D=EI KIA@ MDA ?A?JEC
         J JDA HAJA IOIJA 6DA JM FIIE>EEJEAI BH auth−method =HA
         p9         6DEI EI JDA @AB=KJ )KJDAJE?=JE EI @A KIEC JDA IJ=@=H@ 2= ' A?D=EII IAA
                    authsrv$  KIAH EJAH=?JE EI HAGKEHA@
         netkey     )KJDAJE?=JE EI @A KIEC ?D=ACAHAIFIA =@ = D=@ DA@ =KJDAJE?=JH H JDA
                    netkey FHCH= IAA passwd 6DA KIAH KIJ A?HOFJ JDA ?D=ACA =@ JOFA JDA
                    A?HOFJE >=? J cpu 6DEI EI KIA@ EB JDA ?= DIJ EI E = @EBBAHAJ FHJA?JE @=E
                    JD= JDA IAHLAH H EB JDA KIAH M=JI J C EJ JDA IAHLAH =I = @EBBAHAJ KIAH
         6DA −e FJE IFA?EBEAI = A?HOFJE =@H D=ID =CHEJD J KIA BH JDA ?A?JE 1B >JD
         =HA IFA?EBEA@ JDAO KIJ >A IF=?A IAF=H=JA@ =@ ?FHEIA = IECA =HCKAJ I JDAO KIJ >A
         GKJA@ EB E = IDA ?=@ 6DA @AB=KJ EI rc4_256 A?HOFJE =@ sha1 D=IDEC 5AA ssl!
         BH @AJ=EI  FIIE>A =CHEJDI 6DA =HCKAJ clear IFA?EBEAI  A?HOFJE =CHEJD =@
         ?= >A KIA@ J J= J @AH LAHIEI B JDA cpu IAHLE?A
         6DA −k B=C IFA?EBEAI = AO F=JJAH J KIA J HAIJHE?J JDA AOI IAA?JA@ >O JDA auth_proxy ?= KIA@
         BH =KJDAJE?=JE
         6DA =A IF=?A EI >KEJ >O HKEC /usr/$user/lib/profile MEJD JDA HJ B JDA ELEC
         =A IF=?A >K@ J /mnt/term 6DA service ALEHAJ L=HE=>A EI IAJ J cpu JDA
         cputype =@ objtype ALEHAJ L=HE=>AI HABA?J JDA IAHLAH I =H?DEJA?JKHA
         6DA −R B=C ?=KIAI cpu J HK JDA IAHLAH HAJA IE@A B JDA FHJ? 1J EI HK BH IAHLE?A BEAI
         IK?D =I /bin/service/tcp17010 6DA −O B=C EI IEE=H >KJ IEK=JAI JDA FHA'2  LAH
         IE B JDA cpu FHJ?
FILES
         6DA =A IF=?A B JDA JAHE= IE@A B JDA cpu ?=@ EI KJA@ LE= exportfs"  JDA +27
         IE@A  @EHA?JHO /mnt/term 6DA BEAI IK?D =I /dev/cons =HA >K@ J JDAEH IJ=@=H@ ?=
         JEI BH JDAHA
SOURCE
     /sys/src/cmd/cpu.c
SEE ALSO
      rc, rio, exportfs"




                                                     #
+27                                                                                         +27



BUGS
         *E@I =@ KJI @A =BJAH JDA JAHE= lib/profile EI HK =HA J HABA?JA@ E JDA AM =A
         IF=?A
         9DA KIEC JDA −a FJE J C E =I =JDAH KIAH >A =M=HA JD=J HAIKH?AI E JDA ?= =A
         IF=?A ME >A =@A =L=E=>A J JD=J KIAH




                                                  #!
+42                                                                                          +42




NAME
       ?HF E?L   BH=A ?HF =@ ?LAHJ E=CA
SYNOPSIS
     crop  −b red green blue   −c red green blue   −i n  −r minx miny maxx maxy  −x dx  −y
     dy   −t tx ty   −b red green blue   file 
       iconv  −u   −c chandesc   file 
DESCRIPTION
      Crop HA=@I = image$ BEA @AB=KJ IJ=@=H@ EFKJ ?HFI EJ =@ MHEJAI EJ =I = ?FHAIIA@
      image$ BEA J IJ=@=H@ KJFKJ 6DAHA =HA JM M=OI J IFA?EBO = ?HF >O ?H L=KA H >O CA
      AJHO 6DAO =O >A ?>EA@ E = IECA HK B crop E MDE?D ?=IA JDA ?H L=KA ?HF ME >A
      @A BEHIJ
       6DA −c FJE J=AI = HA@CHAA>KA JHEFAJ =I @AI?HE>A@ E color  .H AN=FA MDEJA EI 255
       255 255 6DA ?HHAIF@EC ?H EI KIA@ =I = L=KA J >A ?KJ BH JDA KJAH A@CA B JDA FE?
       JKHA JD=J EI JDA E=CA EI ?HFFA@ J HALA JDA =NE= KJIE@A HA?J=CK=H IJHEF E MDE?D ALAHO
       FENA D=I JDA IFA?EBEA@ ?H
       6DA −i FJE EIAJI JDA E=CA HA?J=CA >O = ?IJ=J =KJ n MDE?D =O >A AC=JELA J CA
       AH=JA ANJH= IF=?A =HK@ JDA E=CA 6DA −x =@ −y FJEI =HA IEE=H >KJ =FFO O J JDA x H
       y ?H@E=JAI B JDA E=CA
       6DA −r FJE IFA?EBEAI = AN=?J HA?J=CA
       6DA −t FJE IFA?EBEAI JD=J JDA E=CA I ?H@E=JA IOIJA IDK@ >A JH=I=JA@ >O tx ty =I JDA
       =IJ IJAF B FH?AIIEC
       6DA −b FJE IFA?EBEAI = >=?CHK@ ?H J >A KIA@ J BE =HK@ JDA E=CA EB JDA ?HFFA@
       E=CA EI =HCAH JD= JDA HECE= IK?D =I EB JDA −i FJE EI CELA = AC=JELA =HCKAJ 6DEI ?=
       >A KIA@ J @H=M = ?DHA BH=A =HK@ JDA E=CA 6DA @AB=KJ ?H EI >=?
       Iconv ?D=CAI JDA BH=J B FENAI E JDA E=CA file @AB=KJ IJ=@=H@ EFKJ =@ MHEJAI JDA HAIKJ
       EC E=CA J IJ=@=H@ KJFKJ 2ENAI E JDA E=CA =HA ?LAHJA@ =??H@EC J JDA ?D=A @AI?HEF
       JH chandesc IAA image$ .H AN=FA J ?LAHJ = ">EJFAHFENA CHAOI?=A E=CA J = &
       >EJFAHFENA ?H=FFA@ E=CA chandesc IDK@ >A m8 1B chandesc EI J CELA JDA BH=J EI
       K?D=CA@ 6DA KJFKJ E=CA EI >O @AB=KJ ?FHAIIA@ JDA −u FJE JKHI BB JDA ?FHAIIE
EXAMPLE
     6 ?HF MDEJA A@CAI BB JDA FE?JKHA =@ =@@ = JAFENA FE >H@AH
              crop −c 255 255 255 −i −10 −b 255 150 150 imagefile > cropped
SOURCE
     /sys/src/cmd/crop.c
SEE ALSO
      image$ color 
BUGS
       Iconv IDK@ >A =>A J @ .O@5JAE>AHC AHHH @EBBKIE H @EJDAHEC MDA ?LAHJEC J I=
       E=CA @AFJDI




                                                     #"
,)6-                                                                                           ,)6-




NAME
        @=JA ??   @=JA =@ JEA
SYNOPSIS
     date  option   seconds 
     clock
DESCRIPTION
      2HEJ JDA @=JA E JDA BH=J
               Tue Aug 16 17:03:52 CDT 1977
        6DA FJEI =HA
        −u     4AFHJ /HAAME?D A= 6EA /6 H=JDAH JD= ?= JEA
        −n     4AFHJ JDA @=JA =I JDA K>AH B IA?@I IE?A JDA AF?D  /6 =K=HO  '%
        6DA ?LAHIE BH /HAAME?D A= 6EA J ?= JEA @AFA@I  JDA $timezone ALEH
        AJ L=HE=>A IAA ctime 
        1B JDA FJE= =HCKAJ seconds EI FHAIAJ EJ EI KIA@ =I JDA JEA J ?LAHJ H=JDAH JD= JDA HA=
        JEA
        Clock @H=MI = IEFA ==C ?? E EJI ME@M
FILES
        /env/timezone                  +KHHAJ JEAA =A =@ =@KIJAJI
        /adm/timezone                  ) @EHA?JHO ?J=EEC JEAA J=>AI
        /adm/timezone/local            ,AB=KJ JEAA BEA ?FEA@ >O init& EJ /env/timezone
SOURCE
     /sys/src/cmd/date.c
     /sys/src/cmd/clock.c




                                                    ##
,*                                                                                                     ,*




NAME
        @>     @A>KCCAH
SYNOPSIS
     db  option ...   textfile   pid 
DESCRIPTION
      Db EI = CAAH= FKHFIA @A>KCCEC FHCH= 1J =O >A KIA@ J AN=EA BEAI =@ J FHLE@A =
      ?JHA@ ALEHAJ BH JDA ANA?KJE B 2= ' FHCH=I
        ) textfile EI = BEA ?J=EEC JDA JANJ =@ EEJE=EA@ @=J= B = ANA?KJ=>A FHCH= ) memfile EI
        JDA AHO E=CA B = ANA?KJEC FH?AII 1J EI KIK=O =??AIIA@ LE= JDA FH?AII E@ pid B JDA
        FH?AII E /proc/pid/mem ) memfile ?J=EI JDA JANJ @=J= =@ I=LA@ HACEIJAHI =@ FH?AII
        IJ=JA ) map =II?E=JA@ MEJD A=?D textfile H memfile IKFFHJI =??AIIAI J EIJHK?JEI =@ @=J= E
        JDA BEA IAA )@@HAIIAI 
        ) =HCKAJ ?IEIJEC AJEHAO B @ECEJI EI =IIKA@ J >A = FH?AII E@ JDAHMEIA EJ EI JDA =A
        B = textfile 9DA = textfile EI CELA JDA JANJBEA =F EI =II?E=JA@ MEJD EJ 1B O = pid EI CELA
        JDA JANJBEA =F EI =II?E=JA@ MEJD /proc/pid/text 9DA = pid EI CELA JDA ABEA =F EI
        =II?E=JA@ MEJD /proc/pid/mem JDAHMEIA EJ EI K@ABEA@ =@ =??AIIAI J JDA memfile =HA J
        FAHEJJA@
        +=@I J db =HA HA=@ BH JDA IJ=@=H@ EFKJ =@ HAIFIAI =HA J JDA IJ=@=H@ KJFKJ 6DA
        FJEI =HA
        −k        7IA JDA AHA IJ=? B FH?AII pid J @A>KC JDA ANA?KJEC AHA FH?AII 1B textfile EI J
                  IFA?EBEA@ BEA /$cputype/9type EI KIA@ MDAHA type EI JDA IA?@ MH@ E $terminal
        −w        +HA=JA textfile =@ memfile EB JDAO @ J ANEIJ FA JDA BH MHEJEC =I MA =I HA=@EC
        −Ipath
              ,EHA?JHO E MDE?D J  BH HA=JELA F=JD =AI E $< =@ $<< ?=@I
        −mmachine
             )IIKA EIJHK?JEI =HA BH JDA CELA +27 JOFA =O IJ=@=H@ =H?DEJA?JKHA =A IK?D =I
             alpha H 386 FKI mipsco =@ sunsparc MDE?D ?=KIA @EI=IIA>O J JDA
             =KB=?JKHAH I IOJ=N EIJA=@ B KIEC JDA =CE? K>AH J IAA?J JDA +27 JOFA
        IJ db ?=@I D=LA JDA BMEC BH
                  address , count command
        1B address EI FHAIAJ JDA JDA ?KHHAJ FIEJE ?=A@ @J  EI IAJ J address 1EJE=O @J EI IAJ J
         IJ ?=@I =HA HAFA=JA@ count JEAI MEJD @J =@L=?EC >AJMAA HAFAJEJEI 6DA @AB=KJ
        count EI  Address =@ count =HA ANFHAIIEI KJEFA ?=@I  A EA KIJ >A IAF=H=JA@
        >O ;
   Expressions
       -NFHAIIEI =HA AL=K=JA@ =I C ints
        .         6DA L=KA B @J
        +         6DA L=KA B @J E?HAAJA@ >O JDA ?KHHAJ E?HAAJ
        ^         6DA L=KA B @J @A?HAAJA@ >O JDA ?KHHAJ E?HAAJ
        "         6DA =IJ address JOFA@
        integer
                  ) K>AH E @A?E= H=@EN >O @AB=KJ 6DA FHABENAI 0 =@ 0o =@ 0O AH D BH?A EJAH
                  FHAJ=JE E ?J= H=@EN JDA FHABENAI 0t =@ 0T BH?A EJAHFHAJ=JE E @A?E= H=@EN JDA
                  FHABENAI 0x 0X =@ # BH?A EJAHFHAJ=JE E DAN=@A?E= H=@EN 6DKI 020 0o20 0t16
                  =@ #10 = HAFHAIAJ IENJAA
        integer.fraction
               ) IECAFHA?EIE B=JEC FEJ K>AH
        ’c ’      6DA $>EJ L=KA B = ?D=H=?JAH \ =O >A KIA@ J AI?=FA = ’
        <name
                  6DA L=KA B name MDE?D EI = HACEIJAH =A 6DA HACEIJAH =AI =HA JDIA FHEJA@ >O JDA


                                                        #$
,*                                                                                                 ,*



                 $r ?=@
        symbol
                 ) symbol EI = IAGKA?A B KFFAH H MAH ?=IA AJJAHI K@AHI?HAI H @ECEJI J IJ=HJEC
                 MEJD = @ECEJ \ =O >A KIA@ J AI?=FA JDAH ?D=H=?JAHI 6DA ?=JE B JDA symbol EI ?=
                 ?K=JA@ BH JDA IO> J=>A E textfile
        routine.name
               6DA =@@HAII B JDA L=HE=>A name E JDA IFA?EBEA@ + HKJEA *JD routine =@ name =HA
               symbols 1B name EI EJJA@ JDA L=KA EI JDA =@@HAII B JDA IJ HA?AJO =?JEL=JA@ IJ=?
               BH=A ?HHAIF@EC J routine EB routine EI EJJA@ JDA =?JELA FH?A@KHA EI =IIKA@
        file:integer
                6DA =@@HAII B JDA EIJHK?JE ?HHAIF@EC J JDA IKH?A IJ=JAAJ =J JDA E@E?=JA@ EA
                K>AH B JDA BEA 1B JDA IKH?A EA ?J=EI  ANA?KJ=>A IJ=JAAJ JDA =@@HAII B JDA
                EIJHK?JE =II?E=JA@ MEJD JDA A=HAIJ ANA?KJ=>A IKH?A EA EI HAJKHA@ .EAI >ACE =J
                EA  1B KJEFA BEAI B JDA I=A =A =HA =@A@ = ANFHAIIE B JDEI BH HAILAI J
                JDA BEHIJ BEA A?KJAHA@ E JDA IO> J=>A
        (exp)
                 6DA L=KA B JDA ANFHAIIE exp
        Monadic operators
                 *exp   6DA ?JAJI B JDA ?=JE =@@HAIIA@ >O exp E memfile
                 @exp   6DA ?JAJI B JDA ?=JE =@@HAIIA@ >O exp E textfile
                 −exp   1JACAH AC=JE
                 ~exp   *EJMEIA ?FAAJ
                 %exp   9DA KIA@ =I = address exp EI = BBIAJ EJ JDA IACAJ =A@ ublock IAA
                        )@@HAIIAI 
        Dyadic operators =HA ABJ=II?E=JELA =@ =HA AII >E@EC JD= =@E? FAH=JHI
                 e1+e2 1JACAH =@@EJE
                 e1−e2 1JACAH IK>JH=?JE
                 e1*e2 1JACAH KJEFE?=JE
                 e1%e2 1JACAH @ELEIE
                 e1&e2 *EJMEIA ?K?JE
                 e1|e2 *EJMEIA @EIK?JE
                 e1#e2 E1 HK@A@ KF J JDA ANJ KJEFA B e2
  Commands
     IJ ?=@I D=LA JDA BMEC IOJ=N
        ?f       ?=JEI IJ=HJEC =J address E textfile =HA FHEJA@ =??H@EC J JDA BH=J f
        /f       ?=JEI IJ=HJEC =J address E memfile =HA FHEJA@ =??H@EC J JDA BH=J f
        =f       6DA L=KA B address EJIAB EI FHEJA@ =??H@EC J JDA BH=J f
        ) format ?IEIJI B A H HA ?D=H=?JAHI JD=J IFA?EBO = IJOA B FHEJEC -=?D BH=J ?D=H=?JAH
        =O >A FHA?A@A@ >O = @A?E= EJACAH JD=J EI = HAFA=J ?KJ BH JDA BH=J ?D=H=?JAH 1B  BH=J
        EI CELA JDA JDA =IJ BH=J EI KIA@
        IJ BH=J AJJAHI BAJ?D IA @=J= FHEJ EJ =@ =@L=?A = ?= ?FO B @J >O JDA K>AH B
        >OJAI BAJ?DA@ 6DA JJ= K>AH B >OJAI E = BH=J >A?AI JDA currentE?HAAJ.
                 o      2HEJ   JM>OJA EJACAH E ?J=
                 O      2HEJ   BKH>OJA EJACAH E ?J=
                 q      2HEJ   JM>OJA EJACAH E IECA@ ?J=
                 Q      2HEJ   BKH>OJA EJACAH E IECA@ ?J=
                 d      2HEJ   JM>OJA EJACAH E @A?E=
                 D      2HEJ   BKH>OJA EJACAH E @A?E=




                                                         #%
,*                                                                                                 ,*



                V       2HEJ AECDJ>OJA EJACAH E @A?E=
                Z       2HEJ AECDJ>OJA EJACAH E KIECA@ @A?E=
                x       2HEJ JM>OJA EJACAH E DAN=@A?E=
                X       2HEJ BKH>OJA EJACAH E DAN=@A?E=
                Y       2HEJ AECDJ>OJA EJACAH E DAN=@A?E=
                u       2HEJ JM>OJA EJACAH E KIECA@ @A?E=
                U       2HEJ BKH>OJA EJACAH E KIECA@ @A?E=
                f       2HEJ =I = IECAFHA?EIE B=JEC FEJ K>AH
                F       2HEJ @K>AFHA?EIE B=JEC FEJ
                b       2HEJ JDA =@@HAIIA@ >OJA E DAN=@A?E=
                c       2HEJ JDA =@@HAIIA@ >OJA =I = )5+11 ?D=H=?JAH
                C       2HEJ JDA =@@HAIIA@ >OJA =I = ?D=H=?JAH 2HEJ=>A )5+11 ?D=H=?JAHI =HA HAFHAIAJA@
                        H=O JDAHI =HA FHEJA@ E JDA BH \xnn
                s       2HEJ JDA =@@HAIIA@ ?D=H=?JAHI =I = 76. IJHEC KJE = AH >OJA EI HA=?DA@
                        )@L=?A @J >O JDA ACJD B JDA IJHEC E?K@EC JDA AH JAHE=JH
                S       2HEJ = IJHEC KIEC JDA AI?=FA ?LAJE IAA C =>LA
                r       2HEJ =I 76. JDA =@@HAIIA@ JM>OJA EJACAH HKA
                R       2HEJ =I 76. JDA =@@HAIIA@ JM>OJA EJACAHI =I HKAI KJE = AH HKA EI HA=?DA@
                        )@L=?A @J >O JDA ACJD B JDA IJHEC E?K@EC JDA AH JAHE=JH
                i       2HEJ =I =?DEA EIJHK?JEI ,J EI E?HAAJA@ >O JDA IEA B JDA EIJHK?JE
                I       )I i =>LA >KJ FHEJ JDA =?DEA EIJHK?JEI E = =JAH=JA BH EB FIIE>A
                        sunsparc =@ mipsco HAFH@K?A JDA =KB=?JKHAHI IOJ=N
                M       2HEJ JDA =@@HAIIA@ =?DEA EIJHK?JE E = =?DEA@AFA@AJ DAN=@A?E= BH
                a       2HEJ JDA L=KA B @J E IO>E? BH ,J EI K=BBA?JA@
                A       2HEJ JDA L=KA B @J E DAN=@A?E= ,J EI K=BBA?JA@
                z       2HEJ JDA BK?JE =A IKH?A BEA =@ EA K>AH ?HHAIF@EC J @J JANJBEA
                        O ,J EI K=BBA?JA@
                p       2HEJ JDA =@@HAIIA@ L=KA E IO>E? BH ,J EI =@L=?A@ >O JDA IEA B =
                        =?DEA =@@HAII
                t       9DA FHA?A@A@ >O = EJACAH J=>I J JDA ANJ =FFHFHE=JA J=> IJF .H AN=FA
                        8t LAI J JDA ANJ &IF=?A J=> IJF ,J EI K=BBA?JA@
                n       2HEJ = AMEA ,J EI K=BBA?JA@
                ""   2HEJ JDA A?IA@ IJHEC ,J EI K=BBA?JA@
                ^       ,J EI @A?HAAJA@ >O JDA ?KHHAJ E?HAAJ JDEC EI FHEJA@
                +       ,J EI E?HAAJA@ >O  JDEC EI FHEJA@
                −       ,J EI @A?HAAJA@ >O  JDEC EI FHEJA@
        JDAH ?=@I E?K@A
        AMEA
               7F@=JA @J >O JDA ?KHHAJ E?HAAJ 4AFA=J JDA FHALEKI ?=@ MEJD = count B 
        ?/l value mask
               9H@I IJ=HJEC =J @J =HA =IA@ MEJD mask =@ ?F=HA@ MEJD value KJE = =J?D EI
               BK@ 1B l EI KIA@ JDA =J?D EI BH = JM>OJA EJACAH L =J?DAI BKH >OJAI 1B  =J?D
               EI BK@ JDA @J EI K?D=CA@ JDAHMEIA @J EI IAJ J JDA =J?DA@ ?=JE 1B mask EI
               EJJA@ JDA  EI KIA@
        ?/w value ...
               9HEJA JDA JM>OJA value EJ JDA =@@HAIIA@ ?=JE 1B JDA ?=@ EI W MHEJA BKH
               >OJAI
        ?/m s b e f ?
               AM L=KAI BH b, e, f  E JDA IACAJ =A@ s =HA HA?H@A@ 8=E@ IACAJ =AI =HA
               text data H ublock 1B AII JD= JDHAA =@@HAII ANFHAIIEI =HA CELA JDA HA=EEC
               F=H=AJAHI =HA ABJ K?D=CA@ 1B JDA EIJ EI JAHE=JA@ >O ? H / JDA JDA BEA textfile H
               memfile HAIFA?JELAO EI KIA@ BH IK>IAGKAJ HAGKAIJI .H AN=FA /m? ?=KIAI / J HABAH
               J textfile
        >name
                ,J EI =IIECA@ J JDA L=HE=>A H HACEIJAH =A@
        !       6DA HAIJ B JDA EA EI F=IIA@ J rc BH ANA?KJE




                                                       #&
,*                                                                                                 ,*



        $modifier
              EI?A=AKI ?=@I 6DA =L=E=>A modifiers =HA
              <f   4A=@ ?=@I BH JDA BEA f 1B JDEI ?=@ EI ANA?KJA@ E = BEA BKHJDAH ?
                   =@I E JDA BEA =HA J IAA 1B f EI EJJA@ JDA ?KHHAJ EFKJ IJHA= EI JAHE
                   =JA@ 1B = count EI CELA =@ EI AH JDA ?=@ EI ECHA@
              <<f  5EE=H J < AN?AFJ EJ ?= >A KIA@ E = BEA B ?=@I MEJDKJ ?=KIEC JDA BEA J
                   >A ?IA@ 6DAHA EI = I= EEJ J JDA K>AH B << BEAI JD=J ?= >A FA =J
                   ?A
              >f   )FFA@ KJFKJ J JDA BEA f MDE?D EI ?HA=JA@ EB EJ @AI J ANEIJ 1B f EI EJJA@ KJ
                   FKJ EI HAJKHA@ J JDA JAHE=
              ?    2HEJ FH?AII E@ JDA ?@EJE MDE?D ?=KIA@ IJFFEC H JAHE=JE JDA HACEIJAHI
                   =@ JDA EIJHK?JE =@@HAIIA@ >O pc 6DEI EI JDA @AB=KJ EB modifier EI EJJA@
              r    2HEJ JDA CAAH= HACEIJAHI =@ JDA EIJHK?JE =@@HAIIA@ >O pc ,J EI IAJ J pc
              R    EA $r >KJ E?K@A EI?A=AKI FH?AIIH ?JH HACEIJAHI =@ B=JEC FEJ
                   HACEIJAHI
              f    2HEJ B=JECFEJ HACEIJAH L=KAI =I IECAFHA?EIE B=JEC FEJ K>AHI
              F    2HEJ B=JECFEJ HACEIJAH L=KAI =I @K>AFHA?EIE B=JEC FEJ K>AHI
              b    2HEJ = >HA=FEJI =@ JDAEH =II?E=JA@ ?KJI =@ ?=@I * FH@K?AI JDA
                   I=A HAIKJI
              c    5J=? >=?JH=?A 1B address EI CELA EJ IFA?EBEAI JDA =@@HAII B = F=EH B ! >EJ L=
                   KAI ?J=EEC JDA sp =@ pc B = =?JELA FH?AII 6DEI =MI IAA?JEC =C
                   L=HEKI ?JANJI B = KJEJDHA=@A@ FH?AII 1B C EI KIA@ JDA =AI =@ C
                   L=KAI B = F=H=AJAHI =KJ=JE? =@ IJ=JE? L=HE=>AI =HA FHEJA@ BH A=?D =?JELA
                   BK?JE 1B count EI CELA O JDA BEHIJ count BH=AI =HA FHEJA@
              a    )JJ=?D J JDA HKEC FH?AII MDIA FE@ EI ?J=EA@ E address
              e    6DA =AI =@ L=KAI B = ANJAH= L=HE=>AI =HA FHEJA@
              w    5AJ JDA F=CA ME@JD BH KJFKJ J address @AB=KJ &
              q    -NEJ BH db
              m    2HEJ JDA =@@HAII =FI
              k    5EK=JA AHA AHO ==CAAJ
              Mmachine
                   5AJ JDA machine JOFA KIA@ BH @EI=IIA>EC EIJHK?JEI
        :modifier
              ==CA = IK>FH?AII )L=E=>A @EBEAHI =HA
              h      0=J = =IO?DHKIO HKEC FH?AII J =M >HA=FEJEC 7A?AII=HO BH
                     FH?AIIAI ?HA=JA@ K@AH db AC >O :r
              bc     5AJ >HA=FEJ =J address 6DA >HA=FEJ EI ANA?KJA@ count  JEAI >ABHA ?=KIEC
                     = IJF )I EB = ?=@ c EI CELA EJ EI ANA?KJA@ =J A=?D >HA=FEJ =@ EB EJ IAJI
                     @J J AH JDA >HA=FEJ ?=KIAI = IJF
              d      ,AAJA >HA=FEJ =J address
              r      4K textfile =I = IK>FH?AII 1B address EI CELA JDA FHCH= EI AJAHA@ =J JD=J
                     FEJ JDAHMEIA JDA IJ=@=H@ AJHO FEJ EI KIA@ Count IFA?EBEAI DM =O >HA=
                     FEJI =HA J >A ECHA@ >ABHA IJFFEC )HCKAJI J JDA IK>FH?AII =O >A
                     IKFFEA@  JDA I=A EA =I JDA ?=@ ) =HCKAJ IJ=HJEC MEJD  H 
                     ?=KIAI JDA IJ=@=H@ EFKJ H KJFKJ J >A AIJ=>EIDA@ BH JDA ?=@
              cs     6DA IK>FH?AII EI ?JEKA@ 1B s EI EJJA@ H AH JDA IK>FH?AII EI IAJ JDA
                     JA JD=J ?=KIA@ EJ J IJF 1B  EI IFA?EBEA@  JA EI IAJ 1B JDA IJF M=I @KA J
                     = >HA=FEJ H IECAIJAF JDA ?HHAIF@EC JA EI AE@A@ >ABHA ?JEKEC
                     *HA=FEJ IEFFEC EI JDA I=A =I BH r
              ss     )I BH c AN?AFJ JD=J JDA IK>FH?AII EI IECA IJAFFA@ BH count =?DEA EIJHK?
                     JEI 1B = JA EI FA@EC EJ EI HA?AELA@ >ABHA JDA BEHIJ EIJHK?JE EI ANA?KJA@ 1B
                     JDAHA EI  ?KHHAJ IK>FH?AII JDA textfile EI HK =I = IK>FH?AII =I BH r 1 JDEI
                     ?=IA  JA ?= >A IAJ JDA HA=E@AH B JDA EA EI JHA=JA@ =I =HCKAJI J JDA
                     IK>FH?AII
              Ss     1@AJE?= J s AN?AFJ JDA IK>FH?AII EI IECA IJAFFA@ BH count EAI B + IKH?A
                     1 FJEEA@ ?@A JDA ?HHAIF@A?A >AJMAA + IKH?A =@ JDA =?DEA EIJHK?
                     JEI EI =FFHNE=JA =J >AIJ




                                                    #'
,*                                                                                                 ,*



               x      6DA ?KHHAJ IK>FH?AII EB =O EI HAA=IA@ >O db =@ =MA@ J ?JEKA ANA?KJEC
                      H=O
               k      6DA ?KHHAJ IK>FH?AII EB =O EI JAHE=JA@
               nc     ,EIF=O JDA FA@EC JAI BH JDA FH?AII 1B c EI IFA?EBEA@ BEHIJ @AAJA c’th FA@EC
                      JA
  Addresses
     6DA ?=JE E = BEA H AHO E=CA =II?E=JA@ MEJD = =@@HAII EI ?=?K=JA@ BH = =F =II?E
     =JA@ MEJD JDA BEA -=?D =F ?J=EI A H HA GK=@HKFAI t, b, e, f @ABEEC = IACAJ
     =A@ t KIK=O text data H ublock =FFEC =@@HAIIAI E JDA H=CA b JDHKCD e J JDA F=HJ B
     JDA BEA >ACEEC =J BBIAJ f 6DA AHO @A B = 2= ' FH?AII =IIKAI JD=J IACAJI =HA
     @EIEJ 6DAHA ?= >A HA JD= A IACAJ B = CELA JOFA AC = FH?AII =O D=LA HA JD=
     A JANJ IACAJ >KJ IACAJI =O J LAH=F ) =@@HAII a EI JH=I=JA@ J = BEA =@@HAII >O
     BE@EC = IACAJ BH MDE?D b ae JDA ?=JE E JDA BEA EI JDA addressf b
        7IK=O JDA JANJ =@ EEJE=EA@ @=J= B = FHCH= =HA =FFA@ >O IACAJI ?=A@ text =@ data
        5E?A = FHCH= BEA @AI J ?J=E >II IJ=? H K>? @=J= JDAIA @=J= =HA J =FFA@ >O JDA
        @=J= IACAJ 6DA JANJ IACAJ EI =FFA@ IEE=HO E = H= EA AHA memfile 0M
        ALAH JDA IACAJ ?=A@ data =FI AHO BH JDA >ACEEC B JDA FHCH= I @=J= IF=?A J
        JDA >=IA B JDA K>? 6DEI HACE ?J=EI JDA FHCH= I IJ=JE? @=J= JDA >II JDA DA=F =@ JDA
        IJ=? ) IACAJ ?=A@ ublock =FI JDA F=CA ?J=EEC EJI HACEIJAHI =@ FH?AII IJ=JA
        5AJEAI EJ EI KIABK J @ABEA = =F MEJD = IECA IACAJ =FFEC JDA HACE BH  J
        N........ = =F B JDEI JOFA =MI JDA AJEHA BEA J >A AN=EA@ MEJDKJ =@@HAII JH=I=JE
        4ACEIJAHI =HA I=LA@ =J = =?DEA@AFA@AJ BBIAJ E JDA K>? 1J EI KIK=O J A?AII=HO J
        M JDEI BBIAJ JDA $r $R $f =@ $F ?=@I ?=?K=JA EJ =@ @EIF=O JDA HACEIJAH ?JAJI
        6DA $m ?=@ @KFI JDA ?KHHAJO =?JELA =FI 6DA ?m =@ /m ?=@I @EBO JDA IAC
        AJ F=H=AJAHI E JDA textfile =@ memfile =FI HAIFA?JELAO
EXAMPLES
     6 IAJ = >HA=FEJ =J JDA >ACEEC B write() E ANJ=J FH?AII %
               % db 27
               :h
               write:b
               :c
        6 AN=EA JDA 2= ' AHA IJ=? BH FH?AII %
               % db −k 27
               $C
        5EE=H >KJ KIEC = AHA =A@ test
               % db −k test 27
               $C
        6 IAJ = >HA=FEJ =J JDA AJHO B BK?JE parse MDA JDA ?= L=HE=>A argc E main EI AGK=
        J 
               parse:b *main.argc−1=X
        6DEI FHEJI JDA L=KA B argc−1 MDE?D =I = IE@A ABBA?J IAJI @J MDA argc EI A JDA >HA=FEJ
        ME BEHA *AM=HA JD=J ?= L=HE=>AI =O >A IJHA@ E HACEIJAHI IAA JDA *7/5 IA?JE
        ,A>KC FH?AII  %  HAJA =?DEA kremvax
               % import kremvax /proc
               % db 127
               $C
FILES
        /proc/*/text
        /proc/*/mem
        /proc/*/ctl
        /proc/*/note




                                                    $
,*                                                                                                 ,*



SEE ALSO
      acid nm proc!
SOURCE
     /sys/src/cmd/db
DIAGNOSTICS
     -NEJ IJ=JKI EI K KAII JDA =IJ ?=@ B=EA@ H HAJKHA@ K IJ=JKI
BUGS
        -N=EEC = ?= L=HE=>A MEJD routine.name HAJKHI JDA ?JAJI B JDA AHO =?=JA@ BH JDA
        L=HE=>A >KJ MEJD FJEE=JE IKFFHAIIA@ >O JDA −N ?FEAH B=C L=HE=>AI BJA HAIE@A E HACEI
        JAHI )I  IA =H?DEJA?JKHAI JDA BEHIJ =HCKAJ EI =M=OI F=IIA@ E = HACEIJAH
        8=HE=>AI =@ F=H=AJAHI JD=J D=LA >AA FJEEA@ =M=O @ J =FFA=H E JDA IO> J=>A
        HAJKHEC JDA AHHH bad local variable MDA =??AIIA@ >O db
        *A?=KIA B =ECAJ E?F=JE>EEJEAI JH= $& IAHEAI =?DEAI ?= J >A @A>KCCA@
        HAJAO BH = FH?AIIH B = @EBBAHAJ JOFA
        *HA=FEJI IDK@ J >A IAJ  EIJHK?JEI I?DA@KA@ E @A=O IJI 9DA = FHCH= IJFI 
        IK?D = >HA=FEJ EJ EI KIK=O EFIIE>A J ?JEKA EJI ANA?KJE




                                                    $
,+                                                                                                  ,+




NAME
        @?   @AI ?=?K=JH
SYNOPSIS
     dc  file 
DESCRIPTION
      Dc EI = =H>EJH=HO FHA?EIE @AI ?=?K=JH H@E=HEO EJ FAH=JAI  @A?E= EJACAHI >KJ A
      =O IFA?EBO = EFKJ >=IA KJFKJ >=IA =@ = K>AH B BH=?JE= @ECEJI J >A =EJ=EA@ 6DA
      LAH= IJHK?JKHA B dc EI = IJ=?EC HALAHIA 2EID ?=?K=JH 1B = =HCKAJ EI CELA EFKJ EI
      J=A BH JD=J BEA KJE EJI A@ JDA BH JDA IJ=@=H@ EFKJ 6DA BMEC ?IJHK?JEI =HA
      HA?CEA@
        K>AH
              6DA L=KA B JDA K>AH EI FKIDA@  JDA IJ=? ) K>AH EI = K>HA IJHEC B JDA
              @ECEJI 0−9A−F H 0−9a−f ) DAN=@A?E= K>AH >ACEEC MEJD = MAH ?=IA AJJAH
              KIJ >A FHA?A@A@ >O = AH J @EIJECKEID EJ BH JDA ?=@ =II?E=JA@ MEJD JDA AJJAH
              1J =O >A FHA?A@A@ >O = K@AHI?HA _ J EFKJ = AC=JELA K>AH K>AHI =O ?J=E
              @A?E= FEJI
        +    − / * % ^
               )@@ + IK>JH=?J − KJEFO * @ELE@A / HA=E@AH % H ANFAJE=JA ^ JDA JF JM L=KAI
                JDA IJ=? 6DA JM AJHEAI =HA FFFA@ BB JDA IJ=? JDA HAIKJ EI FKIDA@  JDA IJ=? E
               JDAEH F=?A )O BH=?JE= F=HJ B = ANFAJ EI ECHA@
        sx
        Sx     2F JDA JF B JDA IJ=? =@ IJHA EJ = HACEIJAH =A@ x MDAHA x =O >A =O ?D=H=?JAH
               7@AH FAH=JE S HACEIJAH x EI JHA=JA@ =I = IJ=? =@ JDA L=KA EI FKIDA@  EJ
        lx
        Lx     2KID JDA L=KA E HACEIJAH x J JDA IJ=? 6DA HACEIJAH x EI J =JAHA@ ) HACEIJAHI IJ=HJ
               MEJD AH L=KA 7@AH FAH=JE L HACEIJAH x EI JHA=JA@ =I = IJ=? =@ EJI JF L=KA EI
               FFFA@ J JDA =E IJ=?
        d      ,KFE?=JA JDA JF L=KA  JDA IJ=?
        p      2HEJ JDA JF L=KA  JDA IJ=? 6DA JF L=KA HA=EI K?D=CA@ P EJAHFHAJI JDA JF B
               JDA IJ=? =I = JANJ IJHEC HALAI EJ =@ FHEJI EJ
        f      2HEJ JDA L=KAI  JDA IJ=?
        q
        Q      -NEJ JDA FHCH= 1B ANA?KJEC = IJHEC JDA HA?KHIE ALA EI FFFA@ >O JM 7@AH FAH=
               JE Q JDA JF L=KA  JDA IJ=? EI FFFA@ =@ JDA IJHEC ANA?KJE ALA EI FFFA@ >O JD=J
               L=KA
        x      6HA=J JDA JF AAAJ B JDA IJ=? =I = ?D=H=?JAH IJHEC =@ ANA?KJA EJ =I = IJHEC B dc
               ?=@I
        X      4AF=?A JDA K>AH  JDA JF B JDA IJ=? MEJD EJI I?=A B=?JH
        [ ... ]
             2KJ JDA >H=?AJA@ JANJ IJHEC  JDA JF B JDA IJ=?
        <x
        >x
        =x     2F =@ ?F=HA JDA JF JM AAAJI B JDA IJ=? 4ACEIJAH x EI ANA?KJA@ EB JDAO >AO JDA
               IJ=JA@ HA=JE
        v      4AF=?A JDA JF AAAJ  JDA IJ=? >O EJI IGK=HA HJ )O ANEIJEC BH=?JE= F=HJ B JDA
               =HCKAJ EI J=A EJ =??KJ >KJ JDAHMEIA JDA I?=A B=?JH EI ECHA@
        !      1JAHFHAJ JDA HAIJ B JDA EA =I = IDA ?=@
        c      +A=H JDA IJ=?
        i      6DA JF L=KA  JDA IJ=? EI FFFA@ =@ KIA@ =I JDA K>AH >=IA BH BKHJDAH EFKJ




                                                       $
,+                                                                                                     ,+



        I       2KID JDA EFKJ >=IA  JDA JF B JDA IJ=?
        o       6DA JF L=KA  JDA IJ=? EI FFFA@ =@ KIA@ =I JDA K>AH >=IA BH BKHJDAH KJFKJ 1
                >=IAI =HCAH JD=  A=?D @ECEJ FHEJI =I = CHKF B @A?E= @ECEJI
        O       2KID JDA KJFKJ >=IA  JDA JF B JDA IJ=?
        k       2F JDA JF B JDA IJ=? =@ KIA JD=J L=KA =I = AC=JELA I?=A B=?JH JDA =FFHFHE=JA
                K>AH B F=?AI =HA FHEJA@  KJFKJ =@ =EJ=EA@ @KHEC KJEFE?=JE @ELEIE
                =@ ANFAJE=JE 6DA EJAH=?JE B I?=A B=?JH EFKJ >=IA =@ KJFKJ >=IA ME >A
                HA=I=>A EB = =HA ?D=CA@ JCAJDAH
        z       2KID JDA IJ=? ALA J JDA IJ=?
        Z       4AF=?A JDA K>AH  JDA JF B JDA IJ=? MEJD EJI ACJD
        ?       ) EA B EFKJ EI J=A BH JDA EFKJ IKH?A KIK=O JDA JAHE= =@ ANA?KJA@
        ; :     7IA@ >O bc BH =HH=O FAH=JEI
        6DA I?=A B=?JH IAJ >O k @AJAHEAI DM =O @ECEJI =HA AFJ J JDA HECDJ B JDA @A?E= FEJ 1B
        s EI JDA ?KHHAJ I?=A B=?JH sa EI JDA I?=A B JDA BEHIJ FAH=@ sb EI JDA I?=A B JDA IA?@ =@ b
        EI JDA EJACAH IA?@ FAH=@ HAIKJI =HA JHK?=JA@ J JDA BMEC I?=AI
                +−      =Nsa,sb
                *        Esasb  =Ns,sa,sb
                /        s
                %        I JD=J @ELE@A@  @ELEIHGKJEAJ  HA=E@AH HA=E@AH D=I IEC B @ELE@A@
                ^        Esa b =Ns,sa
                v        =Ns,sa
EXAMPLES
     2HEJ JDA BEHIJ JA L=KAI B n
                [la1+dsa*pla10>y]sy
                0sa1
                lyx
SOURCE
     /sys/src/cmd/dc.c
SEE ALSO
      bc hoc
DIAGNOSTICS
     x is unimplemented MDAHA x EI = ?J= K>AH = EJAH= AHHH
      KJ B DA=@AHI BH J =O K>AHI >AEC AFJ =HK@
      AIJEC @AFJD BH J =O ALAI B AIJA@ ANA?KJE
BUGS
        9DA JDA EFKJ >=IA AN?AA@I $ JDAHA EI  J=JE BH @ECEJI CHA=JAH JD= F
        2=IJ EJI JEA




                                                       $!
,,                                                                                                ,,




NAME
        @@   ?LAHJ =@ ?FO = BEA
SYNOPSIS
     dd  option value  
DESCRIPTION
      Dd ?FEAI JDA IFA?EBEA@ EFKJ BEA J JDA IFA?EBEA@ KJFKJ MEJD FIIE>A ?LAHIEI 6DA IJ=@=H@
      EFKJ =@ KJFKJ =HA KIA@ >O @AB=KJ 6DA EFKJ =@ KJFKJ >? IEA =O >A IFA?EBEA@ J J=A
      =@L=J=CA B H=M FDOIE?= 1 6DA FJEI =HA
        −if f      FA BEA f BH EFKJ
        −of f      FA BEA f BH KJFKJ
        −ibs n     5AJ EFKJ >? IEA J n >OJAI @AB=KJ # 
        −obs n     5AJ KJFKJ >? IEA @AB=KJ # 
        −bs n      5AJ >JD EFKJ =@ KJFKJ >? IEA IKFAHIA@EC ibs =@ obs 1B  ?LAHIE EI
                   IFA?EBEA@ FHAIAHLA JDA EFKJ >? IEA EIJA=@ B F=?EC IDHJ >?I EJ JDA KJFKJ
                   >KBBAH 6DEI EI F=HJE?K=HO ABBE?EAJ IE?A  E?HA ?FO AA@ >A @A
        −cbs n     5AJ ?LAHIE >KBBAH IEA
        −skip n    5EF n EFKJ HA?H@I >ABHA ?FOEC
        −iseek n
                   5AA n HA?H@I BHM=H@  EFKJ BEA >ABHA ?FOEC
        −files n
                   +=JA=JA n EFKJ BEAI KIABK O BH =CAJE? J=FA H IEE=H EFKJ @ALE?A
        −oseek n
                   5AA n HA?H@I BH >ACEEC B KJFKJ BEA >ABHA ?FOEC
        −count n
                   +FO O n EFKJ HA?H@I
        −trunc n
                   *O @AB=KJ dd JHK?=JAI JDA KJFKJ BEA MDA EJ FAI EJ −trunc 0 FAI EJ MEJDKJ
                   JHK?=JE
        −quiet n
                   *O @AB=KJ dd FHEJI JDA K>AH B >?I HA=@ =@ MHEJJA ?A EJ EI BEEIDA@
                   −quiet 1 IEA?AI JDEI IK=HO
        −conv ascii            +LAHJ -*+,1+ J )5+11
             ebcdic          +LAHJ )5+11 J -*+,1+
             ibm             EA ebcdic >KJ MEJD = IECDJO @EBBAHAJ ?D=H=?JAH =F
             block           +LAHJ L=HE=>A ACJD )5+11 HA?H@I J BENA@ ACJD
             unblock         +LAHJ BENA@ ACJD )5+11 HA?H@I J L=HE=>A ACJD
             lcase           =F =FD=>AJE?I J MAH ?=IA
             ucase           =F =FD=>AJE?I J KFFAH ?=IA
             swab            5M=F ALAHO F=EH B >OJAI
             noerror         , J IJF FH?AIIEC  = AHHH
             sync            2=@ ALAHO EFKJ HA?H@ J ibs >OJAI
        9DAHA IEAI =HA IFA?EBEA@ = K>AH B >OJAI EI ANFA?JA@ ) K>AH =O A@ MEJD k H b J IFA?
        EBO KJEFE?=JE >O  " H # HAIFA?JELAO = F=EH B K>AHI =O >A IAF=H=JA@ >O x J E@E?=JA
        = FH@K?J KJEFA ?LAHIEI =O >A IFA?EBEA@ E JDA IJOA −conv ebcdic,ucase
        Cbs EI KIA@ O EB ascii unblock ebcdic ibm H block ?LAHIE EI IFA?EBEA@ 1 JDA
        BEHIJ JM ?=IAI n ?D=H=?JAHI =HA ?FEA@ EJ JDA ?LAHIE >KBBAH =O IFA?EBEA@ ?D=H=?JAH =FFEC
        EI @A JH=EEC >=I =HA JHEA@ =@ AMEA EI =@@A@ >ABHA IA@EC JDA EA J JDA KJFKJ
        1 JDA =JJAH JDHAA ?=IAI ?D=H=?JAHI =HA HA=@ EJ JDA ?LAHIE >KBBAH =@ >=I =HA =@@A@ J
        =A KF = KJFKJ HA?H@ B IEA n 1B cbs EI KIFA?EBEA@ H AH JDA ascii ebcdic =@ ibm
        FJEI ?LAHJ JDA ?D=H=?JAH IAJ MEJDKJ ?D=CEC JDA >? IJHK?JKHA B JDA EFKJ BEA JDA
        unblock =@ block FJEI >A?A = IEFA BEA ?FO



                                                     $"
,,                                                                           ,,



SOURCE
     /sys/src/cmd/dd.c
SEE ALSO
      cp
DIAGNOSTICS
     Dd HAFHJI JDA K>AH B BK  F=HJE= EFKJ =@ KJFKJ >?I D=@A@




                                                  $#
,--;                                                                                      ,--;




NAME
        @AAO   @AAJA AOI BH B=?JJK
SYNOPSIS
     delkey  −f  pattern
DESCRIPTION
      Delkey IDMI JDA KIAH A=?D AO IJHA@ E factotum" =@ =J?DEC JDA pattern FHFJEC BH
      MDAJDAH JDA AO IDK@ >A @AAJA@ )J A=?D FHFJ JOFEC = HAIFIA >ACEEC MEJD y @AAJAI
      JDA AO JOFEC = HAIFIA >ACEEC MEJD q =>HJI JDA EIJEC =@ =O JDAH HAIFIA IEFI LAH
      JDA AO
        6DA −f FJE @EI=>AI JDA FHFJEC = AOI =J?DEC JDA F=JJAH =HA @AAJA@
        9DA HK  = +27 IAHLAH delkey KIAI JDA JAHE= I B=?JJK EB FHAIAJ EIJA=@ B JDA IAHLAH I
        B=?JJK
FILES
        /mnt/term/mnt/factotum
             .EHIJ ?DE?A BH factotum J KIA
        /mnt/factotum
             5A?@ ?DE?A
SOURCE
     /rc/bin/delkey




                                                    $$
,-4..                                                                                        ,-4.. 




NAME
       @AHBB @A=JAN   HALA BH=JJEC HAGKAIJI
SYNOPSIS
     deroff  option ...  file ...
       delatex file
DESCRIPTION
      Deroff HA=@I A=?D BEA E IAGKA?A =@ HALAI = nroff =@ troff HAGKAIJI =@ JANJ =HCK
      AJI >=?I=ID ?IJHK?JEI =@ ?IJHK?JI B FHAFH?AIIHI IK?D =I eqn pic =@ tbl
      4A=EEC JANJ EI MHEJJA  JDA IJ=@=H@ KJFKJ Deroff BMI BEAI E?K@A@ >O .so =@ .nx
      ?=@I EB = BEA D=I =HA=@O >AA E?K@A@ = .so BH JD=J BEA EI ECHA@ =@ = .nx JAHE=JAI
      ANA?KJE 1B  EFKJ BEA EI CELA deroff HA=@I BH IJ=@=H@ EFKJ
       6DA FJEI =HA
       −w      KJFKJ = MH@ EIJ A MH@ IJHEC B AJJAHI @ECEJI =@ FHFAHO A>A@@A@ =FAHI=@I
               =@ =FIJHFDAI >ACEEC MEJD = AJJAH FAH EA JDAH ?D=H=?JAHI =HA IEFFA@ JDAH
               MEIA JDA KJFKJ BMI JDA HECE= MEJD JDA @AAJEI AJEA@ =>LA
       −_      EA −w >KJ ?IE@AH K@AHI?HAI J >A =FD=KAHE? H=JDAH JD= FK?JK=JE
       −i      1CHA .so =@ .nx HAGKAIJI
       −ms
       −mm     4ALA JEJAI =JJ=?DAJI AJ? =I MA =I H@E=HO troff ?IJHK?JI BH ms$ H mm
               @?KAJI
       −ml     5=A =I −mm >KJ HALA EIJI =I MA
       Delatex @AI BH tex =@ latex IAA tex BEAI MD=J deroff −wi @AI BH troff BEAI
SOURCE
     /sys/src/cmd/deroff.c
     /sys/src/cmd/tex/local/delatex.c
SEE ALSO
      troff tex spell
BUGS
       6DAIA BEJAHI =HA J ?FAJA EJAHFHAJAHI B troff H tex .H AN=FA =?H @ABEEJEI ?J=E
       EC \$ ?=KIA ?D=I E deroff MDA JDA FFK=H $$ @AEEJAHI BH eqn =HA E ABBA?J
       6ANJ EIE@A =?HI EI AEJJA@ =J F=?A B @ABEEJE J F=?A B ?=




                                                     $%
,1..                                                                                                 ,1.. 




NAME
        @EBB   @EBBAHAJE= BEA ?F=H=JH
SYNOPSIS
     diff  −abcefmnrw  file1 ... file2
DESCRIPTION
      Diff JAI MD=J EAI KIJ >A ?D=CA@ E JM BEAI J >HEC JDA EJ =CHAAAJ 1B A BEA EI =
      @EHA?JHO JDA = BEA E JD=J @EHA?JHO MEJD >=IA=A JDA I=A =I JD=J B JDA JDAH BEA EI KIA@ 1B
      >JD BEAI =HA @EHA?JHEAI IEE=HO =A@ BEAI E JDA JM @EHA?JHEAI =HA ?F=HA@ >O JDA AJD@
      B diff BH JANJ BEAI =@ cmp JDAHMEIA 1B HA JD= JM BEA =AI =HA CELA JDA A=?D =HCK
      AJ EI ?F=HA@ J JDA =IJ =HCKAJ =I =>LA 6DA −r FJE ?=KIAI diff J FH?AII IEE=HO
      =A@ IK>@EHA?JHEAI HA?KHIELAO 9DA FH?AIIEC HA JD= A BEA diff FHABENAI BEA @EBBAH
      A?AI MEJD = IECA EA EIJEC JDA JM @EBBAHEC BEAI E JDA BH B = diff ?=@ EA 6DA −m
      B=C ?=KIAI JDEI >AD=LEH ALA MDA FH?AIIEC IECA BEAI
        6DA H= KJFKJ ?J=EI EAI B JDAIA BHI
               n1 a n3,n4
               n1,n2 d n3
               n1,n2 c n3,n4
        6DAIA EAI HAIA>A ed ?=@I J ?LAHJ file1 EJ file2 6DA K>AHI =BJAH JDA AJJAHI FAHJ=E
        J file2 1 B=?J >O AN?D=CEC = BH @ =@ HA=@EC >=?M=H@ A =O =I?AHJ=E AGK=O DM J
        ?LAHJ file2 EJ file1 )I E ed E@AJE?= F=EHI MDAHA n1  n2 H n3  n4 =HA =>>HALE=JA@ =I = IE
        CA K>AH
        .MEC A=?D B JDAIA EAI ?A = JDA EAI JD=J =HA =BBA?JA@ E JDA BEHIJ BEA B=CCA@ >O   JDA
        = JDA EAI JD=J =HA =BBA?JA@ E JDA IA?@ BEA B=CCA@ >O  
        6DA −b FJE ?=KIAI JH=EEC >=I IF=?AI =@ J=>I J >A ECHA@ =@ JDAH IJHECI B >=I J
        ?F=HA AGK= 6DA −w FJE ?=KIAI = MDEJAIF=?A J >A HALA@ BH EFKJ EAI >ABHA
        =FFOEC JDA @EBBAHA?A =CHEJD
        6DA −n FJE FHABENAI A=?D H=CA MEJD file: =@ EIAHJI = IF=?A =HK@ JDA a c =@ d LAH>I
        6DA −e FJE FH@K?AI = I?HEFJ B a, c =@ d ?=@I BH JDA A@EJH ed MDE?D ME HA?HA=JA file2
        BH file1 6DA −f FJE FH@K?AI = IEE=H I?HEFJ J KIABK MEJD ed E JDA FFIEJA H@AH 1J
        =O DMALAH >A KIABK =I EFKJ J = IJHA=HEAJA@ FIJFH?AIIH
        6DA −c FJE E?K@AI JDHAA EAI B ?JANJ =HK@ A=?D ?D=CA AHCEC ?D=CAI MDIA ?
        JANJI LAH=F 1 JDEI @A diff FHEJI − =@ + EIJA=@ B < =@ > >A?=KIA JDA BHAH =HA A=IEAH
        J @EIJECKEID MDA ENA@ 6DA −a B=C @EIF=OI JDA AJEHA BEA =I ?JANJ
        -N?AFJ E H=HA ?EH?KIJ=?AI diff BE@I = I=AIJ IKBBE?EAJ IAJ B BEA @EBBAHA?AI
FILES
        /tmp/diff[12]
SOURCE
     /sys/src/cmd/diff
SEE ALSO
      cmp comm ed idiff
DIAGNOSTICS
     -NEJ IJ=JKI EI JDA AFJO IJHEC BH  @EBBAHA?AI some BH IA =@ error BH JHK>A
BUGS
        -@EJEC I?HEFJI FH@K?A@ K@AH JDA −e H −f FJE =HA =ELA =>KJ ?HA=JEC EAI ?IEIJEC B =
        IECA . 
        9DA HKEC diff  @EHA?JHEAI JDA JE B MD=J EI = JANJ BEA EI FA J @A>=JA




                                                       $&
,+ 6:6                                                                                  ,+ 6:6




NAME
       @? JNJ @? FI M@? JNJ NI JNJ ABI IMH@IJHECI IAN?AJ=>AI     ANJH=?J FHEJ=>A JANJ
       BH E?HIBJ @?KAJI
SYNOPSIS
     doc2txt  file.doc 
     doc2ps  file.doc 
     wdoc2txt  file.doc 
     xls2txt  file.xls 
     aux/olefs  −m mtpt  file.doc
     aux/mswordstrings mtpt/WordDocument
     aux/msexceltables  −qaDnt   −d delim   −c column−range   −w worksheet−range 
     mtpt/Workbook
DESCRIPTION
      Doc2txt EI = rc I?HEFJ JD=J KIAI olefs =@ mswordstrings J ANJH=?J JDA FHEJ=>A JANJ BH JDA
      >@O B = E?HIBJ 9H@ @?KAJ =@ MHEJA EJ  JDA IJ=@=H@ KJFKJ Doc2ps EI IEE=H >KJ
      AEJI 2IJ5?HEFJ ?HHAIF@EC J JDA @?KAJ Wdoc2txt EI IEE=H J doc2txt >KJ KIAI
      plumb J IA@ JDA KJFKJ J = AM acme ME@M EIJA=@ Xls2txt FAHBHI = IEE=H BK?JE
      BH E?HIBJ -N?A @?KAJI
       E?HIBJ BBE?A @?KAJI =HA IJHA@ E - >A?J EEC =@ ->A@@EC BH=J MDE?D EI =
       I?=A@ @M LAHIE B E?HIBJ I .)6 BEA IOIJA Olefs FHAIAJI JDA ?JAJI B = 5 BBE?A
       @?KAJ =I = BEA IOIJA  mtpt MDE?D @AB=KJI J /mnt/doc Mswordstrings H
       msexceltables =O JDA >A KIA@ J F=HIA JDA BEAI EIE@A ANJH=?JEC = JANJ IJHA= Msexceltables
       =O >A CELA FJEI J ?JH JDA BH=JJEC B EJI KJFKJ
       −a       )JJAFJ ?LAHIE B J=>K=H IDAAJI E JDA MH> ?D=HJI
       −d delim 5AJI JDA EJAHBEA@ @AEEJAH J JDA IJHEC delim >O @AB=KJ = IECA IF=?A
       −D       -=>AI @A>KCCEC KJFKJ
       −c range Range EI = ?=IAF=H=JA@ EIJ B ?K K>AHI =@ H=CAI 4=CAI =HA IAF=
                H=JA@ >O @=IDAI EEJ FH?AIIEC J KIJ JDIA ?KI =A@ >O @AB=KJ = ?KI
                =HA KJFKJ
       −n       ,EI=>AI BEA@ F=@@EC J ?K ME@JD
       −q       ,EI=>A GKJEC B JANJKH= BEA@I IAA quote 
       −t       6HK?=JA BEA@I J JDA ?K ME@JD
       −w range Range EI = ?=IAF=H=JA@ EIJ B MHIDAAJ K>AHI =@ H=CAI JDEI EEJI JDA
                IDAAJI KJFKJ KIEC JDA I=A IOJ=N =I JDA −c FJE =>LA 5KFFHAIIA@ ?D=HJ F=CAI
                =HA =M=OI E?K@A@ E JDA IDAAJ ?KJ
EXAMPLE
     -NJH=?J FEA?AI B = 5 -N?A IFHA=@IDAAJ
              aux/olefs report.xls
              IAN?AJ=>AI G M %'" ? !#  @ ( J@?9H>  HFJJNJ
              KKJ J@?
SOURCE
     /rc/bin                         doc2txt doc2ps wdoc2txt, =@ xls2txt
     /sys/src/cmd/aux                JDA JDAHI
SEE ALSO
      strings
       E?HIBJ 9H@ '% *E=HO .EA .H=J  =J E?HIBJ I @ALAFAH 5, DA F=CA
       )) *E=HO 5JHK?JKHAI  http://user.cs.tu−berlin.de/~schwartz/pmh
       FABBE?AHC I -N?A ,?KAJ=JE 
      http://sc.openoffice.org/excelfileformat.pdf




                                                   $'
,+6;2-                                                                               ,+6;2-




NAME
       @?JOFA   EJKEJ ?=@ EA BH BH=JJEC = @?KAJ
SYNOPSIS
     doctype  −n   −T dev   file  
DESCRIPTION
      Doctype AN=EAI = troff EFKJ BEA J @A@K?A JDA =FFHFHE=JA JANJ BH=JJEC ?=@ =@
      FHEJI EJ  IJ=@=H@ KJFKJ Doctype HA?CEAI EFKJ BH troff HA=JA@ FHAFH?AIIHI EA
      eqn =@ JDA ms$ =@ mm =?H F=?=CAI
       FJE −n ELAI nroff EIJA=@ B troff 6DA −T FJE EI F=IIA@ J troff
EXAMPLES
     eval ‘{doctype chapter.?} | lp
          6OFAIAJ BEAI =A@ chapter.0 chapter.1 
SOURCE
     /rc/bin/doctype
SEE ALSO
      troff eqn tbl pic grap ms$ man$
BUGS
       1 JHKA )1 IJOA EJI >AIJ CKAIIAI =HA EIFEHA@ H=JDAH JD= =??KH=JA




                                                      %
,7                                                                                                   ,7




NAME
        @K   @EI KI=CA
SYNOPSIS
     du  −aefhnqstu   −b size   −p SI−prefix   file ... 
DESCRIPTION
      Du CELAI JDA K>AH B >OJAI =?=JA@ J @=J= >?I B =A@ files =@ HA?KHIELAO B BEAI E
      =A@ @EHA?JHEAI 1J =IIKAI IJH=CA EI GK=JEA@ E KEJI B  " >OJAI >OJAI >O @AB=KJ
      JDAH L=KAI ?= >A IAJ >O JDA −b FJE size EI JDA K>AH B >OJAI FJE=O IKBBENA@ k J
      IFA?EBO KJEFE?=JE >O  " 1B file EI EIIEC JDA ?KHHAJ @EHA?JHO EI KIA@ 6DA ?KJ BH =
      @EHA?JHO E?K@AI JDA ?KJI B JDA ?J=EA@ BEAI =@ @EHA?JHEAI
        6DA −a FJE FHEJI JDA K>AH B >?I BH ALAHO BEA E = @EHA?JHO H=O ?KJI =HA
        FHEJA@ O BH ?J=EA@ @EHA?JHEAI
        6DA −f FJE IKFFHAIIAI JDA FHEJEC B M=HEC AII=CAI
        6DA −n FJE FHEJI JDA IEA E >OJAI =@ JDA =A B A=?D BEA EJ IAJI −a
        6DA −t FJE FHEJI E JDA BH=J B du −n JDA @EBEA@ JEA B A=?D BEA H=JDAH JD= JDA IEA
        1B JDA FJEI −tu =HA IFA?EBEA@ JDA JDA =??AIIA@ JEA EI FHEJA@
        6DA −q FJE FHEJI E JDA BH=J B du −n JDA 31, F=JD B A=?D BEA H=JDAH JD= JDA IEA
        6DA −s FJE ?=KIAI du J @AI?A@ JDA DEAH=H?DO =I =M=OI >KJ J FHEJ O = IK=HO EA BH
        A=?D file
        6DA −e FJE ?=KIAI du J FHEJ L=KAI IEAI JEAI H 31, F=JDI E I?EAJEBE? J=JE LE=
        print  I %g
        6DA −h FJE ?=KIAI du J FHEJ L=KAI IEAI JEAI H 31, F=JDI E I?EAJEBE? J=JE I?=A@ J
        AII JD=  " =@ MEJD = IKEJ=>A 51 FHABEN AC G BH >E=HO CEC=>OJAI
        6DA −p FJE ?=KIAI du J FHEJ L=KAI IEAI JEAI H 31, F=JDI E KEJI B SI−prefix +=IA EI
        ECHA@ MDA EC KF SI−prefix ) AFJO SI−prefix ?HHAIF@I J = I?=A B=?JH B  AC
        FHEJ IEAI E >OJAI
EXAMPLES
     2HEJ JDA IEA B /tmp E BH=?JE= >E=HO CEC=>OJAI
               % du −sepg /tmp
               .6960154 /tmp
        2HEJ JDA IEA B /tmp E >OJAI =@ E I?EAJEBE? J=JE
               % du −sep ’’ /tmp
               7.473408e+08   /tmp
SOURCE
     /sys/src/cmd/du.c




                                                      %
-+0                                                                                    -+0




NAME
       A?D   FHEJ =HCKAJI
SYNOPSIS
     echo  −n   arg ... 
DESCRIPTION
      Echo MHEJAI EJI =HCKAJI IAF=H=JA@ >O >=I =@ JAHE=JA@ >O = AMEA  JDA IJ=@=H@ KJ
      FKJ FJE −n IKFFHAIIAI JDA AMEA
SOURCE
     /sys/src/cmd/echo.c
DIAGNOSTICS
     1B echo @H=MI = AHHH MDEA MHEJEC J IJ=@=H@ KJFKJ JDA ANEJ IJ=JKI EI write error JDAH
     MEIA JDA ANEJ IJ=JKI EI AFJO




                                                %
-+2                                                                                                 -+2




NAME
         A?F    B=IJ ?FO D=@EC AHHHI
SYNOPSIS
     ecp  bcprvZ   B block−size   e max−errors   i issect   o ossect   s sector−size 
           sectors input output
DESCRIPTION
      Ecp ?FEAI sectors @EI IA?JHI B JDA IFA?EBEA@ input BEA J JDA IFA?EBEA@ output BEA Ecp ?FEAI
      KJEFA IA?JHI = >?  =J = JEA BH IFAA@ 9DA ecp A?KJAHI = 1 AHHH EJ JH=IBAHI JDA
      ?KHHAJ >? =C=E =IIKEC JDA BEA EI IAA=>A A IA?JH =J = JEA FHEJI JDA IA?JH K>AHI
      B JDA AHHHI =@ ?JEKAI ?FOEC
         FJEI =HA
          b HA>? input  IDHJ HA=@I JDEI M=I KIA@ =EO MDA HA=@EC = FEFA  IJ=@=H@ EFKJ 
            " *5, IOIJAI
          B IAJI JDA >? IEA $!&" >OJAI >O @AB=KJ J block−size
          c =I BH ?BEH=JE  /dev/cons >ABHA IJ=HJEC JDA ?FO
          e IAJI = =NEK K>AH B ?IA?KJELA 1 AHHHI J FAHEJ =J JDA >ACEEC B JDA ?FO
            >ABHA GKEJJEC J max−errors JI B ?IA?KJELA AHHHI =O E@E?=JA = @AAFAH FH>A IK?D
            =I EIIEC A@E= *O @AB=KJ JDAHA EI  EEJ
          i IAAI J IA?JH issect =IIKEC AHHECE >ABHA >ACEEC EFKJ
          o IAAI J IA?JH ossect =IIKEC AHHECE >ABHA >ACEEC KJFKJ
          p FHEJ HA=IIKHEC FHCHAII HAFHJI DAFBK =EO MDA @A=EC MEJD ?H=O D=H@M=HA
          r ?FO IA?JH CHKFI E HALAHIA H@AH =IIKEC JDA BEAI =HA IAA=>A JDEI EI IJ KIABK MDA
            input =@ output LAH=F
          s IAJI JDA IA?JH IEA # >OJAI >O @AB=KJ J sector−size
          v LAHEBO JDA ?FO >O HAHA=@EC JDA input =@ output BEAI =BJAH ?FOEC = IA?JHI 6DEI EI
            EJA@A@ J BH?A JDA @EI J @AELAH JDA =?JK= @=J= MHEJJA  EJ H=JDAH JD= IA ?=?DA@
            ?FO 6DA ?=JEI B =O @EBBAHA?AI =HA FHEJA@
          Z     5MEA JDA EFKJ IJEH JDA >EJI =HK@ E IA B=IDE 1JA@A@ BH @E=CIEC >=@ @EII >O
               ?FOEC = @EI J EJIAB = BAM JEAI MEJD IMEEC  J @ABA=J ?=?DEC E FAH=JEC IOIJAI
               H @EI ?JHAHI
SEE ALSO
      fcp E cp dd dup!
BUGS
          i o r v =@ AHHH HAJHEAI O MH  @ALE?AI ?=F=>A B IAAEC
         6DA IAJ B FJEI HABA?JI @A?=@AI B ANFAHEA?A @A=EC MEJD JHK>AIA D=H@M=HA
         1B JDA EFKJ BEA EI = J=FA =@ JDA =IJ HA?H@  JDA J=FA >ABHA = BEA =H EI AII JD= blocksize
         >OJAI C JDA ecp ME HA=@ JDHKCD F=IJ JDA BEA =H =@ EJ JDA ANJ BEA




                                                       %!
-,                                                                                                  -,




NAME
        A@   JANJ A@EJH
SYNOPSIS
     ed  −   −o   file 
DESCRIPTION
      Ed EI = LAAH=>A JANJ A@EJH
        1B = file =HCKAJ EI CELA ed IEK=JAI = e ?=@ IAA >AM  JD=J BEA EJ EI HA=@ EJ ed’s
        >KBBAH I JD=J EJ ?= >A A@EJA@ 6DA FJEI =HA
        −      5KFFHAII JDA FHEJEC B ?D=H=?JAH ?KJI >O e r =@ w ?=@I =@ B JDA ?BEHEC
               ! >O ! ?=@I
        −o     BH KJFKJ FEFEC 9HEJA = KJFKJ J JDA IJ=@=H@ AHHH BEA AN?AFJ MHEJEC >O w ?
               =@I 1B  file EI CELA =A /fd/1 JDA HAA>AHA@ BEA IAA JDA e ?=@ >AM
        Ed FAH=JAI  = >KBBAH  = ?FO B JDA BEA EJ EI A@EJEC ?D=CAI =@A E JDA >KBBAH D=LA  ABBA?J
         JDA BEA KJE = w MHEJA ?=@ EI CELA 6DA ?FO B JDA JANJ >AEC A@EJA@ HAIE@AI E = JA
        FH=HO BEA ?=A@ JDA buffer
        +=@I J ed D=LA = IEFA =@ HACK=H IJHK?JKHA AH A H JM addresses BMA@ >O =
        IECA ?D=H=?JAH command FIIE>O BMA@ >O F=H=AJAHI J JDA ?=@ 6DAIA =@@HAIIAI
        IFA?EBO A H HA EAI E JDA >KBBAH EIIEC =@@HAIIAI =HA IKFFEA@ >O @AB=KJ
        1 CAAH= O A ?=@ =O =FFA=H  = EA +AHJ=E ?=@I =M JDA =@@EJE B JANJ
        J JDA >KBBAH 9DEA ed EI =??AFJEC JANJ EJ EI I=E@ J >A E input mode. 1 JDEI @A  ?=@I
        =HA HA?CEA@ = EFKJ EI AHAO ?A?JA@ 1FKJ @A EI ABJ >O JOFEC = FAHE@ . =A =J JDA
        >ACEEC B = EA
        Ed IKFFHJI JDA regular expression J=JE @AI?HE>A@ E regexp$ 4ACK=H ANFHAIIEI =HA KIA@
        E =@@HAIIAI J IFA?EBO EAI =@ E A ?=@ IAA s >AM J IFA?EBO = FHJE B = EA MDE?D
        EI J >A HAF=?A@ 1B EJ EI @AIEHA@ J KIA A B JDA HACK=H ANFHAIIE AJ=?D=H=?JAHI =I = H@E
        =HO ?D=H=?JAH JD=J ?D=H=?JAH =O >A FHA?A@A@ >O \  6DEI =I =FFEAI J JDA ?D=H=?JAH >K@EC
        JDA HACK=H ANFHAIIE BJA / =@ J \ EJIAB
        6 K@AHIJ=@ =@@HAIIEC E ed EJ EI A?AII=HO J M JD=J =J =O JEA JDAHA EI = current line.
        /AAH=O JDA ?KHHAJ EA EI JDA =IJ EA =BBA?JA@ >O = ?=@ DMALAH JDA AN=?J ABBA?J  JDA
        ?KHHAJ EA EI @EI?KIIA@ K@AH JDA @AI?HEFJE B A=?D ?=@ )@@HAIIAI =HA ?IJHK?JA@ =I
        BMI
             6DA ?D=H=?JAH . ?KIJ=HEO ?=A@ @J  =@@HAIIAI JDA ?KHHAJ EA
              6DA ?D=H=?JAH $ =@@HAIIAI JDA =IJ EA B JDA >KBBAH
        !     ) @A?E= K>AH n =@@HAIIAI JDA nJD EA B JDA >KBBAH
        "     ’x =@@HAIIAI JDA EA =HA@ MEJD JDA =A x MDE?D KIJ >A = MAH?=IA AJJAH EAI
               =HA =HA@ MEJD JDA k ?=@
        #     ) HACK=H ANFHAIIE A?IA@ E I=IDAI  / =@@HAIIAI JDA EA BK@ >O IA=H?DEC BHM=H@
               BH JDA ?KHHAJ EA =@ IJFFEC =J JDA BEHIJ EA ?J=EEC = IJHEC JD=J =J?DAI JDA HAC
               K=H ANFHAIIE 1B A?AII=HO JDA IA=H?D MH=FI =HK@ J JDA >ACEEC B JDA >KBBAH
        $     ) HACK=H ANFHAIIE A?IA@ E GKAHEAI ? =@@HAIIAI JDA EA BK@ >O IA=H?DEC >=?M=H@
               BH JDA ?KHHAJ EA =@ IJFFEC =J JDA BEHIJ EA ?J=EEC = IJHEC JD=J =J?DAI JDA HAC
               K=H ANFHAIIE 1B A?AII=HO JDA IA=H?D MH=FI =HK@ J JDA A@ B JDA >KBBAH
        %     ) =@@HAII BMA@ >O = FKI IEC + H = EKI IEC − BMA@ >O = @A?E= K>AH
               IFA?EBEAI JD=J =@@HAII FKI HAIF EKI JDA E@E?=JA@ K>AH B EAI 6DA FKI IEC =O
               >A EJJA@
        &     ) =@@HAII BMA@ >O + H − BMA@ >O = HACK=H ANFHAIIE A?IA@ E I=IDAI IFA?E
               BEAI JDA BEHIJ =J?DEC EA BMEC H FHA?A@EC JD=J =@@HAII 6DA IA=H?D MH=FI =HK@
               EB A?AII=HO 6DA + =O >A EJJA@ I 0/x/ =@@HAIIAI JDA first EA E JDA >KBBAH MEJD =
               x -?IEC JDA HACK=H ANFHAIIE E ? HALAHIAI JDA IA=H?D @EHA?JE




                                                     %"
-,                                                                                                        -,



        '      1B = =@@HAII >ACEI MEJD + H − JDA =@@EJE H IK>JH=?JE EI J=A MEJD HAIFA?J J JDA ?KH
                HAJ EA AC −5 EI K@AHIJ@ J A= .−5
             1B = =@@HAII A@I MEJD + H − JDA  EI =@@A@ HAIF IK>JH=?JA@ )I = ?IAGKA?A B
                JDEI HKA =@ HKA ' JDA =@@HAII − HABAHI J JDA EA >ABHA JDA ?KHHAJ EA HALAH JH=E
                EC + =@ − ?D=H=?JAHI D=LA ?KK=JELA ABBA?J I −− HABAHI J JDA ?KHHAJ EA AII 
             6 =EJ=E ?F=JE>EEJO MEJD A=HEAH LAHIEI B JDA A@EJH JDA ?D=H=?JAH ^ E =@@HAIIAI EI
                AGKEL=AJ J −
        +=@I =O HAGKEHA AH A H JM =@@HAIIAI +=@I MDE?D HAGKEHA  =@@HAIIAI
        HAC=H@ JDA FHAIA?A B = =@@HAII =I = AHHH +=@I MDE?D =??AFJ A H JM =@@HAIIAI
        =IIKA @AB=KJ =@@HAIIAI MDA EIKBBE?EAJ =HA CELA 1B HA =@@HAIIAI =HA CELA JD= = ?
        =@ HAGKEHAI JDA =IJ A H JM @AFA@EC  MD=J EI =??AFJA@ =HA KIA@
        )@@HAIIAI =HA IAF=H=JA@ BH A=?D JDAH JOFE?=O >O = ?= , 6DAO =O =I >A IAF=H=JA@ >O
        = IAE? ; 1 JDEI ?=IA JDA ?KHHAJ EA EI IAJ J JDA FHALEKI =@@HAII >ABHA JDA ANJ =@@HAII
        EI EJAHFHAJA@ 1B  =@@HAII FHA?A@AI = ?= H IAE? EA  EI =IIKA@ EB  =@@HAII B
        MI JDA =IJ EA B JDA >KBBAH EI =IIKA@ 6DA IA?@ =@@HAII B =O JM=@@HAII IAGKA?A
        KIJ ?HHAIF@ J = EA BMEC JDA EA ?HHAIF@EC J JDA BEHIJ =@@HAII
        1 JDA BMEC EIJ B ed ?=@I JDA @AB=KJ =@@HAIIAI =HA IDM E F=HAJDAIAI 6DA F=HA
        JDAIAI =HA J F=HJ B JDA =@@HAII >KJ =HA KIA@ J IDM JD=J JDA CELA =@@HAIIAI =HA JDA @AB=KJ
         ,J A=I JDA ?KHHAJ EA
        .a
        JANJ
        .      4A=@ JDA CELA JANJ =@ =FFA@ EJ =BJAH JDA =@@HAIIA@ EA ,J EI ABJ  JDA =IJ EA EFKJ
               EB JDAHA MAHA =O JDAHMEIA =J JDA =@@HAIIA@ EA )@@HAII 0 EI AC= BH JDEI ?=@
               JANJ EI F=?A@ =J JDA >ACEEC B JDA >KBBAH
         .,.  b+−pagesizepln
                *HMIA 2HEJ = F=CA  H=O  EAI 6DA FJE= + @AB=KJ H − IFA?EBEAI MDAJDAH
                JDA ANJ H FHALEKI F=CA EI J >A FHEJA@ 6DA FJE= pagesize EI JDA K>AH B EAI E
                = F=CA 6DA FJE= p n H l ?=KIAI FHEJEC E JDA IFA?EBEA@ BH=J EEJE=O p 2=CA
                IEA =@ BH=J =HA HAA>AHA@ >AJMAA b ?=@I ,J EI ABJ =J JDA =IJ EA @EI
                F=OA@
         .,.  c
        JANJ
        .       +D=CA ,AAJA JDA =@@HAIIA@ EAI JDA =??AFJ EFKJ JANJ J HAF=?A JDAIA EAI ,J EI
                ABJ =J JDA =IJ EA EFKJ EB JDAHA MAHA A EJ EI ABJ =J JDA EA FHA?A@EC JDA @AAJA@ EAI
         .,.  d
                ,AAJA JDA =@@HAIIA@ EAI BH JDA >KBBAH ,J EI IAJ J JDA EA BMEC JDA =IJ EA
                @AAJA@ H J JDA =IJ EA B JDA >KBBAH EB JDA @AAJA@ EAI D=@  IK??AIIH
        e filename
                -@EJ ,AAJA JDA AJEHA ?JAJI B JDA >KBBAH JDA HA=@ JDA =A@ BEA EJ JDA >KBBAH ,J
                EI IAJ J JDA =IJ EA B JDA >KBBAH 6DA K>AH B ?D=H=?JAHI HA=@ EI JOFA@ 6DA BEA =A
                EI HAA>AHA@ BH FIIE>A KIA E =JAH e r H w ?=@I 1B filename EI EIIEC JDA
                HAA>AHA@ =A EI KIA@
        E filename
                7?@EJE= e IAA q >AM
        f filename
                2HEJ JDA ?KHHAJO HAA>AHA@ BEA =A 1B filename EI CELA JDA ?KHHAJO HAA>AHA@
                BEA =A EI BEHIJ ?D=CA@ J filename
         1,$  g/regular expression/command list
         1,$  g/regular expression/
         1,$  g/regular expression
                />= .EHIJ =H ALAHO EA MDE?D =J?DAI JDA CELA regularANFHAIIE. 6DA BH ALAHO
                IK?D EA ANA?KJA JDA command list MEJD @J EEJE=O IAJ J JD=J EA ) IECA ?=@ H
                JDA BEHIJ B KJEFA ?=@I =FFA=HI  JDA I=A EA MEJD JDA C>= ?=@ )
                EAI B = KJEEA EIJ AN?AFJ JDA =IJ EA KIJ A@ MEJD \ 6DA . JAHE=JEC EFKJ



                                                        %#
-,                                                                                                    -,



               @A BH = a i c ?=@ =O >A EJJA@ EB EJ MK@ >A  JDA =IJ EA B JDA ?
               =@ EIJ 6DA ?=@I g =@ v =HA J FAHEJJA@ E JDA ?=@ EIJ )O ?D=H=?JAH
               JDAH JD= IF=?A H AMEA =O >A KIA@ EIJA=@ B / J @AEEJ JDA HACK=H ANFHAIIE
               6DA IA?@ =@ JDEH@ BHI A= g/regular expression /p
        .i
        JANJ
        .      1IAHJ JDA CELA JANJ >ABHA JDA =@@HAIIA@ EA ,J EI ABJ =J JDA =IJ EA EFKJ H EB JDAHA
               MAHA A =J JDA EA >ABHA JDA =@@HAIIA@ EA 6DEI ?=@ @EBBAHI BH JDA a ?
               =@ O E JDA F=?AAJ B JDA JANJ
         .,.+1  j
              E JDA =@@HAIIA@ EAI EJ = IECA EA EJAHA@E=JA AMEAI =HA @AAJA@ ,J EI ABJ =J
              JDA HAIKJEC EA
         .  kx =H JDA =@@HAIIA@ EA MEJD =A x MDE?D KIJ >A = MAH?=IA AJJAH 6DA =@@HAII BH
                 ’x JDA =@@HAIIAI JDEI EA
         .,.  l
                EIJ 2HEJ JDA =@@HAIIA@ EAI E = K=>ECKKI M=O = J=> EI FHEJA@ =I \t = >=?IF=?A
                =I \b >=?I=IDAI =I \\ =@ FHEJEC ?D=H=?JAHI =I = >=?I=ID = x =@ BKH DAN
                =@A?E= @ECEJI C EAI =HA B@A@ MEJD JDA IA?@ =@ IK>IAGKAJ IK>EAI E@AJA@
                A J=> IJF 1B JDA =IJ ?D=H=?JAH E JDA EA EI = >= EJ EI BMA@ >O \n ) l =O >A
                =FFA@A@ EA p J =O 1 ?=@
         .,.  ma
                LA 4AFIEJE JDA =@@HAIIA@ EAI =BJAH JDA EA =@@HAIIA@ >O a ,J EI ABJ =J JDA =IJ
                LA@ EA
         .,.  n
                K>AH 2AHBH p FHABENEC A=?D EA MEJD EJI EA K>AH =@ = J=> ) n =O >A
                =FFA@A@ EA p J =O 1 ?=@
         .,.  p
                2HEJ JDA =@@HAIIA@ EAI ,J EI ABJ =J JDA =IJ EA FHEJA@ ) p =FFA@A@ J =O 1
                ?=@ ?=KIAI JDA JDA ?KHHAJ EA J >A FHEJA@ =BJAH JDA ?=@ EI ANA?KJA@
         .,.  P
                6DEI ?=@ EI = IOO BH p
        q      3KEJ JDA A@EJH  =KJ=JE? MHEJA B = BEA EI @A ) q H e ?=@ EI ?IE@AHA@ J
               >A E AHHH EB JDA >KBBAH D=I >AA @EBEA@ IE?A JDA =IJ w q H e ?=@
        Q      3KEJ K?@EJE=O
        $ H filename
                  4A=@ E JDA CELA BEA =BJAH JDA =@@HAIIA@ EA 1B  filename EI CELA JDA HAA>AHA@ BEA
                  =A EI KIA@ 6DA BEA =A EI HAA>AHA@ EB JDAHA MAHA  HAA>AHA@ BEA =A
                  =HA=@O 1B JDA HA=@ EI IK??AIIBK JDA K>AH B ?D=H=?JAHI HA=@ EI FHEJA@ ,J EI ABJ =J
                  JDA =IJ EA HA=@ BH JDA BEA
         .,.  sn/regular expression/replacement/
         .,.  sn/regular expression/replacement/g
         .,.  sn/regular expression/replacement
                5K>IJEJKJA 5A=H?D A=?D =@@HAIIA@ EA BH = ??KHHA?A B JDA IFA?EBEA@ HACK=H ANFHAI
                IE  A=?D EA E MDE?D n =J?DAI =HA BK@ n @AB=KJI J  EB EIIEC JDA nJD
                =J?DA@ IJHEC EI HAF=?A@ >O JDA HAF=?AAJ IFA?EBEA@ 1B JDA C>= HAF=?AAJ E@E?=
                JH g =FFA=HI =BJAH JDA ?=@ = IK>IAGKAJ =J?DAI  JDA EA =HA =I HAF=?A@ 1J
                EI = AHHH BH JDA IK>IJEJKJE J B=E  = =@@HAIIA@ EAI )O ?D=H=?JAH JDAH JD=
                IF=?A H AMEA =O >A KIA@ EIJA=@ B / J @AEEJ JDA HACK=H ANFHAIIE =@ JDA
                HAF=?AAJ ,J EI ABJ =J JDA =IJ EA IK>IJEJKJA@ 6DA JDEH@ BH A=I
                sn/regular expression /replacement/p 6DA IA?@ / =O >A EJJA@ EB JDA HAF=?AAJ
                EI AFJO
               ) =FAHI=@ & =FFA=HEC E JDA HAF=?AAJ EI HAF=?A@ >O JDA IJHEC =J?DEC JDA HACK
               =H ANFHAIIE 6DA ?D=H=?JAHI \n MDAHA n EI = @ECEJ =HA HAF=?A@ >O JDA JANJ =J?DA@ >O
               JDA nJD HACK=H IK>ANFHAIIE A?IA@ >AJMAA ( =@ ) 9DA AIJA@ F=HAJDAIEA@



                                                      %$
-,                                                                                                    -,



                IK>ANFHAIIEI =HA FHAIAJ n EI @AJAHEA@ >O ?KJEC ??KHHA?AI B ( IJ=HJEC BH
                JDA ABJ
                ) EJAH= & / \ H AMEA =O >A E?K@A@ E = HAF=?AAJ >O FHABENEC EJ MEJD \
         .,.  t a
                6H=IBAH +FO JDA =@@HAIIA@ EAI =BJAH JDA EA =@@HAIIA@ >O a ,J EI ABJ =J JDA =IJ EA
                B JDA ?FO
         .,.  u
                7@ 4AIJHA JDA FHA?A@EC ?JAJI B JDA BEHIJ =@@HAIIA@ EA IE? MDE?D KIJ >A JDA
                =IJ EA E MDE?D = IK>IJEJKJE M=I =@A @K>A IE?
         1,$  v/regular expression/command list
                6DEI ?=@ EI JDA I=A =I JDA C>= ?=@ g AN?AFJ JD=J JDA ?=@ EIJ EI ANA
                ?KJA@ MEJD @J EEJE=O IAJ J ALAHO EA except JDIA =J?DEC JDA HACK=H ANFHAIIE
         1,$  w filename
                9HEJA JDA =@@HAIIA@ EAI J JDA CELA BEA 1B JDA BEA @AI J ANEIJ EJ EI ?HA=JA@ MEJD @A
                $$$ HA=@=>A =@ MHEJ=>A >O ALAHOA 1B  filename EI CELA JDA HAA>AHA@ BEA
                =A EB =O EI KIA@ 6DA BEA =A EI HAA>AHA@ EB JDAHA MAHA  HAA>AHA@ BEA =A
                =HA=@O ,J EI K?D=CA@ 1B JDA MHEJA EI IK??AIIBK JDA K>AH B ?D=H=?JAHI MHEJJA EI
                FHEJA@
         1,$  W filename
                2AHBH w >KJ =FFA@ J EIJA=@ B LAHMHEJEC =O ANEIJEC BEA ?JAJI
        $ =   2HEJ JDA EA K>AH B JDA =@@HAIIA@ EA ,J EI K?D=CA@
        !shell command
                5A@ JDA HA=E@AH B JDA EA =BJAH JDA ! J rc J >A EJAHFHAJA@ =I = ?=@ ,J EI
                K?D=CA@
         .+1 AMEA
                ) =@@HAII MEJDKJ = ?=@ EI J=A =I = p ?=@ ) JAHE= / =O >A EJJA@
                BH JDA =@@HAII ) >= EA =A EI AGKEL=AJ J .+1p EJ EI KIABK BH IJAFFEC
                JDHKCD JANJ
        1B = EJAHHKFJ IEC= ,- EI IAJ ed FHEJI = ? =@ HAJKHI J EJI ?=@ ALA
        9DA HA=@EC = BEA ed @EI?=H@I 7 ?D=H=?JAHI =@ = ?D=H=?JAHI =BJAH JDA =IJ AMEA
FILES
        /tmp/e*
        ed.hup MH EI I=LA@ DAHA EB JAHE= D=CI KF
SOURCE
     /sys/src/cmd/ed.c
SEE ALSO
      sam sed regexp$
DIAGNOSTICS
     ?name BH E=??AIIE>A BEA ?TMP BH JAFH=HO BEA LAHBM ? BH AHHHI E ?=@I H JDAH
     LAHBMI




                                                      %%
-)+5                                         -)+5




NAME
       A=?I    A@EJH =?HI
SYNOPSIS
     emacs  options 
DESCRIPTION
      6DEI F=CA EJAJE=O ABJ >=
SOURCE
     16
SEE ALSO
      sam vi
BUGS
       ;AI




                                            %&
-3                                                                                                -3




NAME
         AG   JOFAIAJ =JDA=JE?I
SYNOPSIS
     eqn  option ...   file ... 
DESCRIPTION
      Eqn EI = troff FHAFH?AIIH BH JOFAIAJJEC =JDA=JE?I  = JOFAIAJJAH 7I=CA EI =IJ =M=OI
                eqn file ... | troff
         1B  BEAI =HA IFA?EBEA@ eqn HA=@I BH JDA IJ=@=H@ EFKJ Eqn FHAF=HAI KJFKJ BH JDA JOFAIAJJAH
         =A@ E JDA −Tdest FJE @AB=KJ −Tutf IAA troff 9DA HK MEJD JDAH FHAFH?AIIH BE
         JAHI eqn KIK=O ?AI =IJ
         ) EA >ACEEC MEJD .EQ =HI JDA IJ=HJ B = AGK=JE JDA A@ B = AGK=JE EI =HA@ >O =
         EA >ACEEC MEJD .EN AEJDAH B JDAIA EAI EI =JAHA@ I JDAO =O >A @ABEA@ E =?H F=?
         =CAI J CAJ ?AJAHEC K>AHEC AJ? 1J EI =I FIIE>A J IAJ JM ?D=H=?JAHI =I @AEEJAHI  JANJ
         >AJMAA @AEEJAHI EI =I eqn EFKJ ,AEEJAHI =O >A IAJ J ?D=H=?JAHI x =@ y MEJD JDA FJE
         −dxy H HA ?O MEJD delim xy >AJMAA .EQ =@ .EN ABJ =@ HECDJ @AEEJAHI =O
         >A E@AJE?= 6DAO =HA ?KIJ=HEO J=A J >A $$ ,AEEJAHI =HA JKHA@ BB >O delim off
         ) JANJ JD=J EI AEJDAH >AJMAA @AEEJAHI H >AJMAA .EQ =@ .EN EI F=IIA@ JDHKCD
         KJK?DA@
         6AI MEJDE eqn =HA IAF=H=JA@ >O IF=?AI J=>I AMEAI >H=?AI @K>A GKJAI JE@AI H ?EH
         ?KBANAI *H=?AI  =HA KIA@ BH CHKFEC CAAH=O IFA=EC =OMDAHA = IECA ?D=H=?JAH EA x
         ?K@ =FFA=H = ?FE?=JA@ ?IJHK?JE A?IA@ E >H=?AI =O >A KIA@ EIJA=@ 6E@A ~ HAFHA
         IAJI = BK IF=?A E JDA KJFKJ ?EH?KBAN ^ D=B =I K?D
         5K>I?HEFJI =@ IKFAHI?HEFJI =HA FH@K?A@ MEJD JDA AOMH@I sub =@ sup 6DKI x sub i
         =AI x i  a sub i sup 2 FH@K?AI a i  =@ e sup {x sup 2 + y sup 2} CELAI e x + y 
                                               a
         Over =AI BH=?JEI a over b OEA@I __ 
                                               b
                                                                                   
                                                                             _____________ 
         Sqrt FH@K?AI IGK=HA HJI 1 over sqrt {ax sup 2 +bx+c} HAIKJI E _
                                                                               ax + bx + c
                                                                             Ý
                                                                                                  n
         6DA AOMH@I from =@ to EJH@K?A MAH =@ KFFAH EEJI  =H>EJH=HO JDECI E
                                                                                            n
                                                                                                 Σ x i EI =@A
                                                                                                Ý 
         MEJD lim from {n −> inf} sum from 0 to n x sub i
         ABJ =@ HECDJ >H=?AJI >H=?AI AJ? B JDA HECDJ DAECDJ =HA =@A MEJD left =@ right left [
                                                                                               y 
         x sup 2 + y sup 2 over alpha right ] ~=~1 FH@K?AI x + ___  =  6DA
                                                                                               
         right ?=KIA EI FJE= AC= ?D=H=?JAHI =BJAH left =@ right =HA >H=?AI >H=?AJI >=HI c
         =@ f BH ?AEEC =@ BH =@ "" BH JDEC =J = KIABK BH = HECDJIE@AO >H=?AJ
         8AHJE?= FEAI B JDECI =HA =@A MEJD pile lpile cpile =@ rpile pile {a above b
                                  a
         above c} FH@K?AI b 6DAHA ?= >A = =H>EJH=HO K>AH B AAAJI E = FEA lpile ABJ
                                  c
         KIJEBEAI pile =@ cpile ?AJAH MEJD @EBBAHAJ LAHJE?= IF=?EC =@ rpile HECDJ KIJEBEAI
         =JHE?AI =HA =@A MEJD matrix matrix { lcol { x sub i above y sub 2 } ccol
                                      xi 
         { 1 above 2 } } FH@K?AI y         1 =@@EJE JDAHA EI rcol BH = HECDJKIJEBEA@ ?K

         ,E=?HEJE?= =HI =HA =@A MEJD prime dot dotdot hat tilde bar under vec dyad
                                                                                 ___
                                                                                 _
         =@ under x sub 0 sup prime = f(t) bar + g(t) under EI x ′ = f t + gt =@ x
                                                                                     ____
         vec = y dyad EI x = y
         5EAI =@ BJI ?= >A ?D=CA@ MEJD FHABEN FAH=JHI size n size ±n fat roman italic
         bold H font n 5EA =@ BJI ?= >A ?D=CA@ C>=O E = @?KAJ >O gsize n =@ gfont
         n H >O JDA ?=@EA =HCKAJI −sn =@ −fn
         H=O IK>I?HEFJI =@ IKFAHI?HEFJI =HA HA@K?A@ >O ! FEJ IEAI BH JDA FHALEKI IEA JDEI =O
         >A ?D=CA@ >O JDA ?=@EA =HCKAJ −pn



                                                      %'
-3                                                                                               -3



         5K??AIIELA @EIF=O =HCKAJI ?= >A EA@ KF 2=?A mark >ABHA JDA @AIEHA@ EAKF FEJ E JDA
         BEHIJ AGK=JE F=?A lineup =J JDA F=?A JD=J EI J EA KF LAHJE?=O E IK>IAGKAJ AGK=JEI
         5DHJD=@I =O >A @ABEA@ H ANEIJEC AOMH@I HA@ABEA@ MEJD define define thing %
         replacement % @ABEAI = AM JA ?=A@ thing MDE?D ME >A HAF=?A@ >O replacement MDAALAH EJ
         =FFA=HI JDAHA=BJAH 6DA % =O >A =O ?D=H=?JAH JD=J @AI J ??KH E replacement
         AOMH@I EA sum  Σ   int  Þ   inf Ý  =@ IDHJD=@I EA >=  ≥   −>  →   =@ !=  
         =HA HA?CEA@ /HAA AJJAHI =HA IFAA@ KJ E JDA @AIEHA@ ?=IA =I E alpha H GAMMA =JDA
         =JE?= MH@I EA sin cos log =HA =@A 4= =KJ=JE?=O Troff BKH?D=H=?JAH
         AI?=FAI EA \(lh   ?= >A KIA@ =OMDAHA 5JHECI A?IA@ E @K>A GKJAI   =HA F=IIA@
         JDHKCD KJK?DA@ JDEI FAHEJI AOMH@I J >A AJAHA@ =I JANJ =@ ?= >A KIA@ J ?KE?=JA
         MEJD troff MDA = AIA B=EI
FILES
         /sys/lib/troff/font/devutf               BJ @AI?HEFJEI BH 2IJ5?HEFJ
SOURCE
     /sys/src/cmd/eqn
SEE ALSO
      troff tbl
       . II== =@ * 9 AHECD= 6HBB 7IAH I =K= 
      * 9 AHECD= =@   +DAHHO 6OFAIAJJEC =JDA=JE?I 7IAH I /KE@A  Unix Research System
      Programmer’s Manual, 6AJD -@EJE 8KA 
BUGS
         6 A>@A @ECEJI F=HAI AJ? EJ EI A?AII=HO J GKJA JDA =I E bold "12.3"




                                                     &
-:2-+6                                                                                       -:2-+6




NAME
       =J @H=E ANFA?J F=II   @E=AH I?HEFJEC JI
SYNOPSIS
     dial/at  −q   −t seconds  =J?=@
     dial/expect  −iq   −t seconds  goodstring  badstring 
     dial/drain
     dial/pass  −q 
DESCRIPTION
      6DAIA ?=@I =HA KIA@ J MHEJA JAAFDA @E=EC I?HEFJI IJO BH 222 IAIIEI 6DAO =
      ANFA?J IJ=@=H@ EFKJ =@ KJFKJ J >A ?A?JA@ J = ?KE?=JEI @ALE?A AC = IAHE= EA J
      = @A 6DAO ?KE?=JA MEJD JDA KIAH KIEC /dev/cons
       At IA@I atcommand J JDA @A FHABENA@ MEJD JDA IJHEC at 1J JDA HA=@I BH JDA @A
       ANFA?JEC = )6 HAIFIA At ME HAJKH IK??AII EB EJ CAJI =@ OK B CONNECT HAIFIA JDAH
       MEIA EJ ME HAJKH JDA HAIFIA =I = AHHH IJ=JKI 6DA FJEI =HA
       −t     IAJ JDA JEAKJ J seconds 6DA @AB=KJ EI !
       −q     @ J MHEJA J /dev/cons MD=J EI HA=@ BH IJ=@=H@ E 6DA @AB=KJ EI J ?FO ALAHO
              JDEC JDHKCD
       Expect HA=@I IJ=@=H@ EFKJ EC BH A B JDA IJHECI CELA =I =HCKAJI 4A=@EC JDA BEHIJ
       IJHEC ?=KIAI = IK??AIIK ANEJ IJ=JKI 4A=@EC =O B JDA JDAHI ?=KIAI = ANEJ IJ=JKI AGK= J JDA
       IJHEC 6DA ?=@ =I JAHE=JAI  = JEAKJ 6DA FJEI =HA
       −t     IAJ JDA JEAKJ J seconds 6DA @AB=KJ EI !
       −i     ECHA ?=IA MDA @EC JDA =J?DAI
       −q     @ J MHEJA J /dev/cons MD=J EI HA=@ BH IJ=@=H@ E 6DA @AB=KJ EI J ?FO ALAHO
              JDEC JDHKCD
       Pass ?FEAI EFKJ BH /dev/cons J IJ=@=H@ KJFKJ 1J JAHE=JAI  = AMEA 6DA O B=C
       EI −q =@ A=I JDA I=A =I EJ @AI BH expect
       Drain @EI?=H@I =O EFKJ M=EJEC  IJ=@=H@ EFKJ 1J EI KIA@ J IO? KF JDA IJHA= =J JDA IJ=HJ B
       @E=EC H =BJAH = AHHH
EXAMPLE
     6DA BMEC rc I?HEFJ @E=I KJ JDHKCD = 0=OAI ?F=JE>A @A  /dev/eia1 =@ AJI JDA
     KIAH JOFA E = KIAH =A =@ F=IIMH@ >ABHA IJ=HJEC ppp
     #!/bin/rc
     dev=/dev/eia1
     telno=18005551212

       fn initfn {
            dial/drain
            echo +++
            dial/at zh0
       }

       fn dialfn {
            dial/drain
            dial/at dt^$telno
       }
       {
            # set up uart
            if( test −e $dev^ctl ){
                 echo −n b^$baud
                 echo −n m1     # cts/rts flow control
                 echo −n q64000 # big buffer
                 echo −n n1     # nonblocking writes
                 echo −n r1     # rts on



                                                      &
-:2-+6                                                          -:2-+6



                   echo −n d1          # dtr on
                   echo −n c1          # handup when we lose dcd
              } > $dev^ctl

              # get the modem’s attention
              while( ! initfn )
                   sleep 1

              # dial
              while( ! dialfn )
                   sleep 30

              if( ! dial/expect −it 60 ’username:’ ){
                   echo can’’t connect >[1=2]
                   exit connect
              }
              dial/pass
              if( ! dial/expect −it 60 ’password:’ ){
                   echo can’’t connect >[1=2]
                   exit connect
              }
              dial/pass
              if( ! dial/expect −t 60 ’ppp or telnet:’ ){
                   echo can’’t connect >[1=2]
                   exit connect
              }
              echo ppp
              dial/expect −t 5 something
              echo connected >[1=2]

             # start ppp
             ip/ppp $primary −f
        } < $dev > $dev
FILES
        /rc/bin/ipconf/* AN=FA @E=AH I?HEFJI BH FFF
SOURCE
     /sys/src/cmd/dial/*.c
SEE ALSO
      ppp& telco"




                                              &
.)+-5                                                                                             .)+-5




NAME
        B=?AI IAA=E LMDEI    =E>N EJAHB=?A
SYNOPSIS
     faces  −ih   −m maildir 
     seemail
     vwhois person 
DESCRIPTION
      6DA faces ?=@ EJHI E?EC =E =@ @EIF=OI E EJI ME@M = HAFHAIAJ=JE B JDA
      KIAH I =E >N KIEC = I= E=CA BH A=?D AII=CA 6DA E=CA EI JOFE?=O = FHJH=EJ B JDA
      IA@AH 9DE?D E=CA J @EIF=O EI @AJAHEA@ >O JM @EHA?JHEAI KIHKIAHE>B=?A =@ E>B=?A
      -JHEAI E KIHKIAHE>B=?A J=A FHEHEJO LAH JDIA E E>B=?A 5AA face$ BH DM JDAIA @EHA?
      JHEAI =HA HC=EIA@
        1B JDA KIAH EI HKEC plumber" faces HA=?JI J FK> AII=CAI J JDA seemail FHJ JOFE?=O
        BH upas/fs =@ EI JDKI JEBEA@ B AII=CA =@@EJEI =@ @AAJEI
        4ECDJ?E?EC  = AII=CA E? ?=KIAI JD=J AII=CA J >A FK>A@ J showmail ) JOFE?=
        FK> =?JE ME >A J @EIF=O JDA AII=CA IK?D =I >O JDA HKA
              plumb start window mail −s $0
        6DA acme =E HA=@AH EIJAI J JDA showmail FHJ =KJ=JE?=O
        1B JDA KIAH EI J HKEC plumber faces HA=@I JDA C BEA =@ HECDJ?E?EC D=I  ABBA?J
        1B =HHMI =HA LEIE>A ?E?EC  JDA ME I?H JDA @EIF=O E@@A?E?EC  JDA =HHMI I?HI
        J JDA A@
        5J=HJEC faces MEJD JDA −i B=C ?=KIAI faces J HA=@ JDA AII=CAI E /mail/fs/mbox                  H
        JDA =E>NAI IFA?EBEA@ MEJD JDA −m B=C KF IJ=HJKF
        6DA −m FJE @EHA?JI faces J M=J?D BH AII=CAI =HHELEC E maildir                     EIJA=@   B
        /mail/fs/mbox KJEFA −m B=CI =O >A KIA@ J M=J?D KJEFA =E>NAI
        6DA −h B=C ?=KIAI = @EBBAHAJ LAAH=>A >AD=LEH E MDE?D JDA ME@M @EIF=OI JDA DEIJHO B
        AII=CAI HA?AELA@ H=JDAH JD= JDA ?KHHAJ IJ=JA B JDA =E >N 1 F=HJE?K=H B=?AI =HA J
        HALA@ BH JDA I?HAA MDA AII=CAI =HA @AAJA@ )I E JDEI @A ?E?EC >KJJ  E JDA
        @EIF=O ME ?A=H JDA ME@M
        Seemail EI = rc I?HEFJ JD=J ELAI faces −h
        Vwhois JAI faces J @EIF=O JDA E?I B JDA =A@ persons MEJDKJ IA@EC = AII=CA
FILES
        /mail/fs/mbox =E @EHA?JHO
SOURCE
     /sys/src/cmd/faces
     /rc/bin/seemail
     /rc/bin/vwhois
SEE ALSO
      mail marshal nedmail plumber" face$ plumb$




                                                      &!
.)+64                                                                                      .)+64




NAME
       B=?JH FHEAI   B=?JH = K>AH CAAH=JA =HCA FHEAI
SYNOPSIS
     factor  number 
       primes start  finish 
DESCRIPTION
      Factor FHEJI number =@ EJI FHEA B=?JHI A=?D HAFA=JA@ JDA FHFAH K>AH B JEAI 6DA K
      >AH KIJ >A FIEJELA =@ AII JD= #" =>KJ & $ 
       1B  number EI CELA factor HA=@I = IJHA= B K>AHI BH JDA IJ=@=H@ EFKJ =@ B=?JHI JDA
                                                                                              
       1J ANEJI  =O EFKJ J = FIEJELA EJACAH =NEK HKEC JEA EI FHFHJE= J √n
       Primes FHEJI JDA FHEA K>AHI H=CEC BH start J finish MDAHA start =@ finish =HA FIEJELA
       K>AHI AII JD= #$ 1B finish EI EIIEC primes FHEJI MEJDKJ A@ EB start EI EIIEC EJ HA=@I
       JDA IJ=HJEC K>AH BH JDA IJ=@=H@ EFKJ
SOURCE
     /sys/src/cmd/factor.c
     /sys/src/cmd/primes.c




                                                   &"
.-,-:                                                                                     .-,-: 




NAME
       BA@AN KFI KIFI   JH=? IDEFAJI
SYNOPSIS
     fedex tracking−number
     ups tracking−number
     usps tracking−number
DESCRIPTION
      Fedex MHEJAI =L=E=>A IDEFAJ @AJ=EI BH JDA CELA .A@AH= -NFHAII  @ECEJ tracking−number 
      JDA IJ=@=H@ KJFKJ Ups EI IEE=H >KJ J=AI = 7EJA@ 2=H?A 5AHLE?A &@ECEJ tracking−number
      Usps J=AI = 75 2IJ BBE?A tracking−number
SOURCE
     /rc/bin
BUGS
       4A@AIECI B JDA IKH?A MA>IEJA ?= >HA= JDAIA FHCH=I




                                                  &#
.1-                                                                                                .1-




NAME
          BEA   @AJAHEA BEA JOFA
SYNOPSIS
     file  −m   file  
DESCRIPTION
      File FAHBHI = IAHEAI B JAIJI  EJI =HCKAJ files E = =JJAFJ J ?=IIEBO JDAEH ?JAJI >O =
      CK=CA H FKHFIA 1B  =HCKAJI =HA CELA JDA ?=IIEBE?=JE EI FAHBHA@  IJ=@=H@ EFKJ
          1B JDA −m B=C EI CELA file KJFKJI = =FFHFHE=JA 1- Content−Type IFA?EBE?=JE @AI?HE>EC
          JDA type =@ subtype B A=?D BEA
          6DA BEA JOFAI EJ I BH E?K@A @EHA?JHO @ALE?A BEA AHBEA@ BEA AFJO BEA 2= ' ANA
          ?KJ=>A 2)+ =K@E BEA cpio =H?DELA tex dvi BEA =H?DELA IO> J=>A =H?DELA rc I?HEFJ sh
          I?HEFJ 2IJ5?HEFJ troff KJFKJ BEA BH L=HEKI @ALE?AI =E >N /1. .): >A?J ?@A + =@
          )AB IKH?A =IIA>AH IKH?A ?FHAIIA@ BEAI A?HOFJA@ BEA -CEID JANJ ?FHAIIA@ E=CA
          E=CA IK>BJ =@ BJ
          1B = BEA D=I  =FF=HAJ BH=J file I =J JDA ?D=H=?JAH IAJ EJ KIAI J ?=IIEBO EJ =??H@EC J
          )5+11 ANJA@A@ )5+11 =JE )5+11 H 76. D@EC A H HA B JDA BMEC >?I B JDA 7E?@A
          5J=@=H@ -NJA@A@ =JE /HAA +OHEE? )HAE= 0A>HAM )H=>E? ,AL==C=HE *AC=E /KH
          KDE /K=H=JE HEO= 6=E 6AKCK ==@= ==O== 6D=E = 6E>AJ= /AHCE= =F=AIA
          +DEAIA H HA=
          1B = AIA B=EI file @A?E@AI EJI EFKJ EI >E=HO
SOURCE
     /sys/src/cmd/file.c
BUGS
          1J ?= =A EIJ=AI




                                                             &$
.16-4                                                                                              .16-4




NAME
       BEJAH EIJ @AELAH JA LB   BEJAHEC =E
SYNOPSIS
     upas/filter  −bh  rcvr mailbox  regexp file  
       upas/list  −d  add|check patternfile addressfile ...
       upas/deliver recipient fromfile mbox
       upas/token key  tokenfile 
       upas/vf  −r   −s savefile 
DESCRIPTION
      ) KIAH =O BEJAH = E?EC =E >O ?HA=JEC = MH@ HA=@=>AANA?KJ=>A BEA
      /mail/box/username/pipeto. 1B JDA BEA EI = IDA I?HEFJ EJ ?= KIA JDA ?=@I
      @AI?HE>A@ DAHA J EFAAJ = BEJAH
       Filter FHLE@AI IEFA =E BEJAHEC 6DA BEHIJ JM =HCKAJI =HA JDA HA?EFEAJ I =@@HAII =@ =E
       >N JD=J EI JDA I=A =HCKAJI FHLE@A@ J pipeto 6DA HA=EEC =HCKAJI =HA = F=EHI B
       = HACK=H ANFHAIIE =@ = BEA =A 9EJD  B=CI JDA IA@AH I =@@HAII EI =J?DA@ =C=EIJ A=?D
       HACK=H ANFHAIIE IJ=HJEC MEJD JDA BEHIJ 1B JDA ANFHAIIE =J?DAI JDA JDA AII=CA EI @AELAHA@
       J JDA BEA MDIA =A BMI JDA ANFHAIIE 6DA BEA KIJ >A MH@ MHEJ=>A =@ IDK@ >A
       =FFA@ O ) AII=CA JD=J =J?DAI A B JDA ANFHAIIEI EI @AELAHA@ EJ JDA KIAH I IJ=
       @=H@ =E >N
       *O @AB=KJ filter =J?DAI A=?D HACK=H ANFHAIIE =C=EIJ JDA AII=CA I IA@AH 6DA −h B=C
       ?=KIAI filter J =J?D =C=EIJ JDA AJEHA DA=@AH =@ JDA −b B=C ?=KIAI filter J =J?D =C=EIJ JDA
       AJEHA AII=CA DA=@AH =@ >@O
       .H AN=FA J @AAJA =O AII=CAI B FHA?A@A?A >K F=?A E OKH pipeto BEA
               /bin/upas/filter −h $1 $2 ’Precedence: bulk’ /dev/null
       6DHAA JDAH ?=@I ANEIJ MDE?D ?>EA@ >O = rc I?HEFJ =M OK J >KE@ OKH M BEJAH
       List J=AI JM LAH>I check =@ add Check @EHA?JI list J ?DA? A=?D =@@HAII ?J=EA@ E JDA
       addressfileI =C=EIJ = EIJ B F=JJAHI E patternfile 2=JJAHI ?A E BKH BHI

       ~regular−expression         1B =O =@@HAII =J?DAI JDA HACK=H ANFHAIIE list HAJKHI IK??AIIBKO
       =string                    1B =O =@@HAII AN=?JO =J?DAI string list HAJKHI IK??AIIBKO
       !~regular−expression 1B =O =@@HAII =J?DAI JDA HACK=H ANFHAIIE =@  JDAH =@@HAII
                            =J?DAI =   HKA list HAJKHI AHHH IJ=JKI =J?D
       !=string                    1B =O =@@HAII AN=?JO =J?DAI string =@  JDAH =@@HAII =J?DAI = 
                                     HKA list HAJKHI AHHH IJ=JKI =J?D
       1B  =@@HAIIAI =J?D = F=JJAH list HAJKHI  =J?D
       6DA F=JJAH BEA =O =I ?J=E EAI B JDA BH
               #include filename
       J =M F=JJAH BEAI J E?K@A JDAH F=JJAH BEAI ) F=JJAH =J?DAI =HA ?=IA EIAIEJELA List
       IA=H?DAI JDA F=JJAH BEA =@ EJI E?K@AI E H@AH 6DA BEHIJ =J?DEC F=JJAH @AJAHEAI JDA
       =?JE
       List add @EHA?JI list J =@@ = F=JJAH J patternfile BH A=?D =@@HAII E JDA addressfiles JD=J @AID J
       =HA=@O =J?D = F=JJAH
       Token MEJD O A =HCKAJ FHEJI J IJ=@=H@ KJFKJ = KEGKA JA ?HA=JA@ BH JDA ?KHHAJ
       @=JA =@ key 9EJD JM =HCKAJI EJ ?DA?I token =C=EIJ JAI ?HA=JA@ LAH JDA =IJ  @=OI
       MEJD key 1B = =J?D EI BK@ EJ HAJKHI IK??AIIBKO
       Deliver @AELAHI EJ =E >N mbox JDA AII=CA HA=@ BH IJ=@=H@ EFKJ 1J >AOI IJ=@=H@ =E
       BEA ?EC =@ CCEC ?LAJEI
       /sys/src/cmd/upas/filterkit/pipeto.sample EI = I=FA pipeto KIEC JDA BEJAH
       EJ



                                                           &%
.16-4                                                                                           .16-4



        ) I=FA pipefrom /sys/src/cmd/upas/filterkit/pipefrom.sample EI FHLE@A@
        MDE?D =@@I = =@@HAIIAI B OKH KJCEC =E J OKH F=JJAH BEA ;K IDK@ ?FO EJ EJ =
        @EHA?JHO JD=J H=O CAJI >K@ >O OKH FHBEA J /bin
        Vf LEHKI BEJAH J=AI = =E AII=CA =I IJ=@=H@ EFKJ =@ IA=H?DAI BH ANA?KJ=>A 1- =JJ=?D
        AJI AEJDAH HAMHEJEC JDA J >A ANA?KJ=>A H HAA?JEC JDA AII=CA 6DA >AD=LEH
        @AFA@I           JDA   =JJ=?DAJ I    BEA   =A     ANJAIE     =@    1-    ?JAJ   JOFA
        /sys/lib/mimetype ?J=EI JDA EIJ B M ANJAIEI =@ 1- ?JAJ JOFAI 6DA BEBJD
        BEA@ B A=?D EA IFA?EBEAI JDA I=BAJO B = F=HJE?K=H BEA JOFA y OAI m =O>A JHA=JA@ I=A =I
        OAI n  p FHALEKI H r HAA?J Vf =MI =JJ=?DAJI MEJD I=BAJO y H m J F=II JDHKCD
        K=JAHA@ )JJ=?DAJI MEJD I=BAJO n >JD =HA MH=FFA@ E ANJH= 1- DA=@AHI =@ D=LA
        .suspect =FFA@A@ J JDAEH BEA =AI J =LE@ =KJ=JE? ANA?KJE >O =E HA=@AHI )JJ=?D
        AJI MEJD I=BAJO r ?KHHAJO .bat .com .exe =@ .scr = E?HIBJ ANA?KJ=>A ANJA
        IEI =HA J=A =I ?=KIA BH JDA AJEHA AII=CA J >A HAA?JA@ ) I=BAJO B p KIA@ BH JDA
        x−gunzip EA JOFA ?=KIAI JDA FHALEKI ANJAIE J >A JAIJA@ I JD=J x.tar.gz EI JHA=JA@
        JDA I=A =I x.tar
        1B /mail/lib/validateattachment ANEIJI =@ EI ANA?KJ=>A vf HKI EJ  = =JJ=?DAJI
        MEJD I=BAJO n =JJ=?DAJI EJ MK@ H=O I=EJEA 1B validateattachment I ANEJ IJ=JKI ?J=EI
        JDA IJHEC discard vf HAA?JI JDA AJEHA AII=CA 1B JDA IJ=JKI ?J=EI JDA IJHEC accept vf
        @AI J I=EJEA JDA =JJ=?DAJ JDAHMEIA vf I=EJEAI JDA =JJ=?DAJ =I >ABHA 6DA IJ=@=H@
        validateattachment KIAI file J @AJAHEA JDA BEA JOFA 1J =??AFJI JANJ =@ E=CA BEAI =@ @EI
        ?=H@I AII=CAI ?J=EEC ANA?KJ=>AI H zip IAA gzip =H?DELAI B ANA?KJ=>AI
        6DA −r FJE ?=KIAI vf J J I=EJEA 1- =JJ=?DAJI >KJ EIJA=@ J HAA?J AII=CAI EJ @AJAH
        EAI J >A LEHKIAI 6DA −s FJE ?=KIAI vf J C = =JJ=?DAJI B I=BAJO r E JDA =E >N
        savefile
FILES
        /mail/box/*/pipeto                           =E BEJAH
        /sys/lib/mimetype                            1- ?JAJ JOFAI
        /mail/lib/validateattachment                 =JJ=?DAJ ?DA?AH
SOURCE
     /sys/src/cmd/upas/send
     /sys/src/cmd/upas/filterkit
     /sys/src/cmd/upas/vf
SEE ALSO
      aliasmail& faces mail marshal mlmgr nedmail qer& rewrite$ send&
      smtp& upasfs"




                                                     &&
.6                                                                                             .6




NAME
         BJ DJBJ   IEFA JANJ BH=JJAHI
SYNOPSIS
     fmt  option ...   file ... 
         htmlfmt  −a   −c charset   −u url   file ... 
DESCRIPTION
      Fmt ?FEAI JDA CELA files IJ=@=H@ EFKJ >O @AB=KJ J EJI IJ=@=H@ KJFKJ BEEC =@ E@AJEC
      EAI 6DA FJEI =HA
         −l n   KJFKJ EA ACJD EI n E?K@EC E@AJ @AB=KJ %
         −w n   ) IOO BH −l
         −i n   1@AJ n IF=?AI @AB=KJ 
         −j     , J E IDHJ EAI O B@ C EAI
         -FJO EAI =@ EEJE= MDEJA IF=?A E EFKJ EAI =HA FHAIAHLA@ -FJO EAI =HA EIAHJA@ >AJMAA
         EFKJ BEAI
         Fmt EI E@AFJAJ EJ A=LAI =HA=@O BH=JJA@ JANJ K?D=CA@
         Htmlfmt FAHBHI = IEE=H IAHLE?A >KJ =??AFJI =I EFKJ JANJ BH=JJA@ MEJD 06 J=CI 1J =??AFJI
         fmt I −l =@ −w B=CI =@ =I
         −a     H=O htmlfmt IKFFHAIIAI JDA ?JAJI B BH BEA@I =@ =?DHI 74I =@ E=CA
                BEAI JDEI B=C ?=KIAI EJ J FHEJ JDA E IGK=HA >H=?AJI
         −c charset
               ?D=CA JDA @AB=KJ ?D=H=?JAH IAJ BH EI&&#' J charset 6DEI EI JDA ?D=H=?JAH IAJ
               =IIKA@ EB JDAHA EI J A IFA?EBEA@ >O JDA DJ EJIAB E = AJ= @EHA?JELA
         −u url 7IA url =I JDA >=IA 74 BH JDA @?KAJ MDA @EIF=OEC =?DHI IAJI −a.
SOURCE
     /sys/src/cmd/fmt.c
         /sys/src/cmd/htmlfmt
BUGS
         Htmlfmt =AI  =JJAFJ J HA@AH JDA JM@EAIE= CAAJHO B J=>AI EJ KIJ JHA=JI JDA
         J=>A AJHEAI =I F=E J>ABH=JJA@ JANJ




                                                        &'
.467-                                                                                .467-




NAME
        BHJKA   I=FA EAI BH = BEA
SYNOPSIS
     fortune  file 
DESCRIPTION
      Fortune FHEJI = AEA =FDHEI ?DIA =J H=@ 1B = file EI IFA?EBEA@ JDA I=OEC EI J=A
      BH JD=J BEA JDAHMEIA EJ EI IAA?JA@ BH /sys/games/lib/fortunes
FILES
        /sys/games/lib/fortunes
        /sys/games/lib/fortunes.index B=IJ KF J=>A =EJ=EA@ =KJ=JE?=O
SOURCE
     /sys/src/cmd/fortune.c




                                                 '
.4-3                                                                                          .4-3




NAME
       BHAG   FHEJ DEIJCH= B ?D=H=?JAH BHAGKA?EAI
SYNOPSIS
     freq  −cdorx   file ... 
DESCRIPTION
      Freq HA=@I JDA CELA BEAI @AB=KJ IJ=@=H@ EFKJ =@ FHEJI DEIJCH=I B JDA ?D=H=?JAH BHAGKA
      ?EAI *O @AB=KJ freq ?KJI A=?D >OJA =I = ?D=H=?JAH K@AH JDA −r FJE EJ EIJA=@ ?KJI 76.
      IAGKA?AI JD=J EI HKAI
       -=?D AH AJHO B JDA J=>A EI FHEJA@ FHA?A@A@ >O JDA >OJA L=KA E @A?E= ?J= DAN =@
       7E?@A ?D=H=?JAH EB FHEJ=>A 1B =O FJEI =HA CELA JDA −d −x −o −c B=CI IFA?EBO = IK>
       IAJ B L=KA BH=JI @A?E= DAN ?J= =@ ?D=H=?JAH HAIFA?JELAO
SOURCE
     /sys/src/cmd/freq.c
SEE ALSO
      utf$ wc




                                                   '
/)-5                                                                                          /)-5




NAME
       "I #I BAIJ KCCA EBA =DCC A I>= IK@K     JEA M=IJAHI
SYNOPSIS
     games/4s
     games/5s
     games/festoon  −pet   sentences  percent−invented−nouns  
     games/juggle  −d delay   −h hands   start  pattern
     games/life startfile
     games/mahjongg  −c   −f   −b background   −t tileset   −l layout 
     games/memo  −h 
     games/sokoban  level 
     games/sudoku
DESCRIPTION
      6DAHA =HA = BAM C=AI E /bin/games

       4s 5s        6HO J BE ?FAJA HMI KIEC "IGK=HA H #IGK=HA JEAI LA JEAI ABJ H HECDJ
                     >O LEC JDA KIA 4J=JA JEAI MEJD >KJJI  =@ ! ,HF JEAI BH HA FEJI
                     MEJD >KJJ H JDA IF=?A >=H AOI a =@ j LA ABJ s =@ k HJ=JA ABJ d =@
                     l HJ=JA HECDJ f =@ ; LA HECDJ z p =@ Esc JCCA IKIFA@HAIKA q Del
                     =@ control−D GKEJ
       festoon       /AAH=JA = BBE?E=EC >KJ KJJAHO IAIE?= >KHA=K?H=JE? HAFHJ =I pic |
                     eqn | tbl | troff −mm EFKJ FJEI −p −e =@ −t =@@ CE>>AHEID @E=
                     CH=I AGK=JEI =@ J=>AI
       juggle        ,EIF=O JDA KCCEC pattern KIEC JDA FJE= EEJE= start F=JJAH 6DA K>AH B
                     D=@I ELLA@ @AB=KJ  ?= >A IFA?EBEA@ MEJD −h =@ delay ?= >A KIA@ J IFAA@
                     KF H IM @M JDA =?JE @AB=KJ EI  6HO JDA F=JJAH !!!!!!""!!!!!! H
                     !!!!#!#### !!!!!!                 H            ;97531/-+)               IAA
                     http://seehuhn.de/jong/theory.html
       life          2=O JDA C=A B EBA CELA = EEJE= FIEJE 6DAHA EI = E>H=HO B EJAHAIJEC EE
                     JE= FIEJEI JDA E>H=HO EI ?IKJA@ EB startfile ?=J >A BK@
       mahjongg      4ALA = JEAI BH JDA >=H@ +E?  JEAI MEJD JDA I=A B=?A JD=J =HA J
                     >?A@ >O JDAHI ) >?A@ JEA EI A JD=J EI F=HJE=O H BKO ?LAHA@  JF H
                     D=I AECD>KHEC JEAI J JDA ABJ =@ HECDJ 6DA C=A BEEIDAI MDA AEJDAH = JEAI
                     =HA CA H JDAHA =HA  HA LAI ABJ 6DA =HCKAJI =HA BH ?D=CEC >=?
                     CHK@ > JEA J =@ =OKJ  E=CAI ? IAA?JI = JHKA?H >KBBAH E=CA BH
                     KIA MEJD @H=MJAH H E ?=IA IAA?JEC = JEA >I?KHAI EJ ?FAJAO B ?=KIAI
                     =DCC J E@E?=JA >?A@ JEAI  KIALAH 6DA N AO ME CAAH=JA =
                     AM ALA R HAIJ=HJI JDA ?KHHAJ A Q =@ Del GKEJ H CELAI = DEJ AEJDAH JHOEC J
                     =J?D JDA ?KHHAJO IAA?JA@ JEA H EB  JEA EI IAA?JA@ BE@EC KJ JDA BEHIJ =L=E
                     =>A JEA U =@ Bksp K@ JDA =IJ LA C JHEAI J ILA JDA ALA
       memo          4ALA = JEAI BH JDA >=H@ )J BEHIJ FE?JKHAI B L=HEKI *A =>I AFOAAI
                     K?AJ 6A?DCEAI C =@ /A@= ME =FFA=H AHEA JDA IAGKA?A JDA
                     ?E? J DE@A JDA =@ >ACE 7IA JDA KIA J IAA?J JM JEAI 1B JDAO =HA JDA
                     I=A JDA JEAI ME @EI=FFA=H JDAHMEIA JDA JEAI ME BEF >=? =@ OK ME CAJ =
                     ?D=?A J JHO =C=E *KJJ ! CAAH=JAI = AK =MEC OK J HAIJ=HJ IMEJ?D
                     >AJMAA A=IO =@ D=H@ @AI =@ ANEJ 6DA −h FJE IAJI JDA C=A J D=H@
                     @A ?A JDA C=A D=I >AA ?FAJA@ = AII=CA FFI KF MEJD DM C EJ
                     J J ME 7IA JDA >KJJ ! AK J ?DIA = @A H ?E? J F=O =C=E
       sokoban       /KE@A /A@= JDHKCD = H BK B M=I FA>>AI =@ DAI J FKJ JDA FA>>AI E
                     ;KH C= EI J =HH=CA = FA>>AI EJ DAI >O FKIDEC JDA =HK@ >KJ OK ?=
                     O FKID = FA>>A EB JDAHA EI  M= H =JDAH FA>>A >?EC JDA M=O )HHM
                     AOI LA /A@= KF@MABJHECDJ N =@ P AOI IMEJ?D >AJMAA JDA ANJ =@
                     FHALEKI ALAI R HAIJ=HJI JDA ?KHHAJ ALA Del =@ Q GKEJ *KJJ ! ELAI =
                     AK J HAIJ=HJ JDA ?KHHAJ ALA =@ @EBBAHAJ ALA IAJI =@ A =@ @EI=>A =E
                     =JE B KJEIJAF LAI *KJJ AJI OK ?D=CA >AJMAA ALAI *KJJ  AJI



                                                    '
/)-5                                                                                           /)-5



                      OK @ KJEIJAF LAI =@ FKIDAI >O ?E?EC EJ  JDA @AIJE=JE MDAHA OK
                      M=J /A@= J C /A@= ME O LA EB EJ ?= HA=?D JDA @AIJE=JE .H =
                      KJEIJAF FKID JDA FA>>A KIJ >A ANJ J /A@= JDA @AIJE=JE KIJ >A  JDA
                      I=A HM H ?K =@ JDAHA KIJ >A = BHAA F=?A ANJ J JDA @AIJE=JE MDAHA
                      JDA FA>>A ?= >A FKIDA@ J JDAHMEIA EB FIIE>A /A@= ME M= J JDA @AIJE
                      =JE MEJDKJ FKIDEC JDA FA>>A Sokoban =??AFJI = ALA BEA =I EJI =HCKAJ
        sudoku        Sudoku EI = FKA C=A BH =F= 6DA C= B JDA C=A EI J BE JDA K>AHI 
                      J ' E = IGK=HAI B JDA 'N' >=H@ BMEC = BAM IEFA HKAI  @ECEJ IDK@
                      HAFA=J  JDA I=A HM =@ ?K =@  @ECEJ IDK@ HAFA=J E JDA I=A !N!
                      >NAI KJEA@ MEJD JDE?AH EAI 6DA >=H@ EI EEJE=O BEA@ MEJD = F=HJE= IKJE
                      MDE?D ?= >A KIA@ BH EBAHHEC @ECEJI BH JDA AFJO IGK=HAI 6DA JF HM B JDA
                      >=H@ ?J=EI JDA @ECEJI  JDHKCD ' ?E?EC  A B JDIA @ECEJI IAA?JI JD=J
                      K>AH BH F=?AAJ  JDA >=H@ ?E?EC EJ =C=E ME @AIAA?J JD=J @ECEJ +E?
                      EC  = AFJO IGK=HA ME JDA =BBEN JDA IGK=HA MEJD JDA IAA?JA@ @ECEJ H EB 
                      @ECEJ EI IAA?JA@ AFJO JDA IGK=HA
                      *KJJ ! FHAIAJI = AK MEJD JDA BMEC FJEI
                       New         =KJCAAH=JA = AM H=@ >=H@
                       Check       =H E HA@ =O @ECEJI J F=?A@ =??H@EC J JDA HKAI
                       Solve       FHAIAJ JDA >=H@ I IKJE
                       Clear       ?A=H JDA >=H@ J EJI IJ=HJEC H =IJ =@A@ IJ=JA
                       Save        I=LA JDA ?KHHAJ >=H@ J /tmp/sudoku−save
                       Load        =@ JDA =IJ I=LA@ >=H@ BH /tmp/sudoku−save
                       Print       FHEJ JDA ?KHHAJ >=H@ =@ IKJE E = BH=J IKEJ=>A BH =@@EJE E
                                   JDA sudoku E>H=HO J /tmp/sudoku−board
                       Offline FHAJJOFHEJ JDA >=H@ BH BBEA ILEC J /tmp/sudoku−print
                       Exit        GKEJ JDA C=A
                      *KJJ FHAIAJI = EIJ B sudoku >=H@I B L=HOEC @ACHAAI B @EBBE?KJO BH
                      /sys/games/lib/sudoku/boards
                      2HAIIEC JDA Q AO GKEJI sudoku
FILES
        /sys/games/lib/[45]scores               I?HA BEAI B 4s =@ 5s
        /sys/games/lib/life/*                   EJAHAIJEC IJ=HJEC FIEJEI
        /sys/games/lib/mahjongg/*               E=CA IFHEJAI ALAI =@ >=?CHK@I KIA@ >O mahjongg
        /lib/face/*                             JEAI BH memo
        /sys/games/lib/sokoban/*                E=CA IFHEJAI =@ ALAI KIA@ >O sokoban
        /sys/games/lib/sudoku/*                 E=CAI =@ >=H@I KIA@ >O sudoku
SOURCE
     /sys/src/games
BUGS
        1 4s =@ 5s KIA M=HFEC MDA JDA C=A EI HAIKA@ =@ MDA = AM JEA =FFA=HI @AI J
        D=FFA MDA JDA KIA ?KHIH EI KJIE@A JDA C=A ME@M 6DIA MD FHABAH J KIA JDA AO
        >=H@ MEJDKJ JDA KIA ?KHIH >?EC JDA LEAM H >AEC M=HFA@ = JDA JEA =O ?IE@AH JDEI
        = BA=JKHA




                                                     '!
/4)2                                                                                                /4)2




NAME
       CH=F   FE? FHAFH?AIIH BH @H=MEC CH=FDI
SYNOPSIS
     grap  file ... 
DESCRIPTION
      Grap EI = pic FHAFH?AIIH BH @H=MEC CH=FDI  = JOFAIAJJAH /H=FDI =HA IKHHK@A@ >O JDA
      troff ?=@I .G1 =@ .G2 ,=J= =HA I?=A@ =@ FJJA@ MEJD JE? =HI IKFFEA@ =KJ=JE
      ?=O +=@I ANEIJ J @EBO JDA BH=A =@@ =>AI LAHHE@A JDA @AB=KJ JE?I ?D=CA JDA FJ
      JEC IJOA @ABEA ?H@E=JA H=CAI =@ JH=IBH=JEI =@ E?K@A @=J= BH BEAI 1 =@@EJE
      grap FHLE@AI JDA I=A FI ?@EJE=I =@ =?H FH?AIIEC JD=J pic @AI
       frame ht e wid e top dotted ... 5AJ JDA BH=A =HK@ JDA CH=FD J IFA?EBEA@ ht =@ wid
       @AB=KJ EI  >O ! E?DAI 6DA EA styles dotted dashed invis solid @AB=KJ B JDA
       sides top bot left right B JDA BH=A ?= >A IAJ E@AFA@AJO
       label side "a label" "as a set of strings" adjust 2=?A =>A  IFA?EBEA@ IE@A
       @AB=KJ IE@A EI >JJ adjust EI up H down left right expr J IDEBJ @AB=KJ FIEJE
       width expr IAJI JDA ME@JD ANFE?EJO
       ticks side in at optname expr, expr, ... 2KJ JE?I  side =J expr, ..., =@ =>A MEJD "expr" 1B
       =O expr EI BMA@ >O  =>A JE? MEJD  =@ JKH BB = =KJ=JE? =>AI 1B  ?J=EI
       %f I JDAO ME >A EJAHFHAJA@ =I printf BH=JJEC EIJHK?JEI BH JDA JE? L=KA 6E?I FEJ in
       H out @AB=KJ KJ 6E? EJAH=JH EIJA=@ B at ... KIA from expr to expr by op expr MDAHA op
       EI FJE=O +−*/ BH =@@EJELA H KJEFE?=JELA IJAFI by ?= >A EJJA@ J CELA IJAFI B IEA 
       1B  JE?I =HA HAGKAIJA@ JDAO =HA IKFFEA@ =KJ=JE?=O IKFFHAII JDEI MEJD ticks off )KJ
       =JE? JE?I H=O A=LA = =HCE B %  A=?D IE@A IAJ JDEI J =OJDEC >O margin = expr
       grid side linedesc at optname expr, expr, ... ,H=M CHE@I FAHFA@E?K=H J side E IJOA linedesc =J
       expr, .... 1JAH=JHI =@ =>AI MH =I MEJD JE?I
       coord optname x min, max y min, max log x log y 5AJ H=CA B ?H@I =@ FJE= C
       I?=EC  AEJDAH H >JD 6DEI LAHHE@AI ?FKJ=JE B @=J= H=CA ,AB=KJ L=KA B optname EI
       ?KHHAJ ?H@E=JA IOIJA A=?D coord @ABEAI = AM ?H@E=JA IOIJA
       plot "str" at point "str" at point 2KJ str =J point 6ANJ FIEJE ?= >A GK=EBEA@ MEJD rjust
       ljust above below =BJAH 
       line from point to point linedesc ,H=M EA BH DAHA J JDAHA arrow MHI E F=?A B
       line
       next optname at point linedesc +JEKA FJ B @=J= E optname to point @AB=KJ EI ?KHHAJ
       draw optname linedesc ... 5AJ @A BH next KIA JDEI IJOA BH M  =@ FJ  =J A=?D
       FEJ EB CELA
       new optname linedesc ... 5AJ @A BH next >KJ @EI?A?J BH FHALEKI
       ) EIJ B K>AHI x y1 y2 y3 ... EI JHA=JA@ =I plot bullet at x,y1 plot bullet at x,y2
       AJ? H =I next at x,y1 AJ? EB draw EI IFA?EBEA@ )>I?EII=A B  ! =HA FHLE@A@ EB JDAHA EI
       O A EFKJ K>AH FAH EA
       ) FEJ optname expr, expr =FI JDA FEJ J JDA =A@ ?H@E=JA IOIJA ) linedesc EI A B
       dot dash invis solid FJE=O BMA@ >O = ANFHAIIE
       define name {whatever} ,ABEA = =?H 6DAHA =HA =?HI =HA=@O @ABEA@ BH IJ=@=H@ FJ
       JEC IO>I EA bullet circle star plus AJ? E /sys/lib/grap.defines MDE?D
       EI E?K@A@ EB EJ ANEIJI
       var = expr -L=K=JA = ANFHAIIE FAH=JHI =HA + − * =@ / .K?JEI =HA log =@ exp
       >JD >=IA  sin cos sqrt rand HAJKHI H=@ K>AH   max(e,e)
       min(e,e) int(e)
       print expr print "..." )I = @A>KCCEC =E@ FHEJ expr H string  JDA IJ=@=H@ AHHH
       copy "file name" 1?K@A JDEI BEA HECDJ DAHA




                                                      '"
/4)2                                                                                               /4)2



         copy thru macro 2=II HAIJ B EFKJ KJE .G2 JDHKCD macro JHA=JEC A=?D BEA@ >=
         H  =I = =HCKAJ macro ?= >A JDA =A B = =?H FHALEKIO @ABEA@ H JDA >@O B A
         E F=?A EA /plot $1 at $2,$3/
         copy thru macro until "string" 5JF ?FO MDA EFKJ EI string ABJKIJEBEA@
         pic remainder of line +FO J KJFKJ MEJD A=@EC >=I HALA@
         graph Name pic−position 5J=HJ = AM BH=A F=?A EJ =J IFA?EBEA@ FIEJE AC graph Thing2
         with .sw at Thing1.se + (0.1,0) Name KIJ >A ?=FEJ=EA@ J AAF pic D=FFO
         .anything at beginning of line +FEA@ LAH>=JE
         sh %anything % 2=II ALAHOJDEC >AJMAA JDA % I J JDA IDA =I MEJD =?HI % =O >A =O ?D=H
         =?JAH =@ anything =O E?K@A AMEAI
         # anything ) ?AJ MDE?D EI @EI?=H@A@
         H@AH EI IJO EHHAAL=J  ?=JACHO EI =@=JHO )O =HCKAJI  JDA .G1 EA =HA F=?A@
          JDA CAAH=JA@ .PS EA BH pic
EXAMPLES
         .G1
         frame ht 1 top invis right invis
         coord x 0, 10 y 1, 3 log y
         ticks left in at 1 "bottommost tick", 2,3 "top tick"
         ticks bot in from 0 to 10 by 2
         label bot "silly graph"
         label left "left side label" "here"
         grid left dashed at 2.5
         copy thru / circle at $1,$2 /
         1 1
         2 1.5
         3 2
         4 1.5
         10 3
         .G2

                top tick                                                      




                                          
        left side label
              here
                                              




        bottommost tick         
                           0         2         4           6       8         10

                                              silly graph

FILES
         /sys/lib/grap.defines            @ABEEJEI B IJ=@=H@ FJJEC ?D=H=?JAHI AC >KAJ
SOURCE
     /sys/src/cmd/grap
SEE ALSO
      pic troff
        *AJAO =@ * 9 AHECD= /4)2 ) =CK=CA BH 6OFAIAJJEC /H=FDI  Unix Research Sys-
      tem Programmer’s Manual, 6AJD -@EJE 8KA 




                                                      '#
/4)20                                                                                              /4)20




NAME
       CH=FD   @H=M = CH=FD
SYNOPSIS
     graph  option ... 
DESCRIPTION
      Graph MEJD  FJEI J=AI F=EHI B K>AHI BH JDA IJ=@=H@ EFKJ =I =>I?EII=I xL=KAI =@
      H@E=JAI yL=KAI B = CH=FD 5K??AIIELA FEJI =HA ?A?JA@ >O IJH=ECDJ EAI 6DA CH=FD EI
      A?@A@  JDA IJ=@=H@ KJFKJ BH @EIF=O >O plot BEJAHI
       1B = H@E=JA EI BMA@ >O = KAHE? IJHEC JD=J IJHEC EI FHEJA@ =I = =>A >ACEEC  JDA
       FEJ =>AI =O >A IKHHK@A@ MEJD GKJAI " " E MDE?D ?=IA JDAO =O >A AFJO H ?J=E
       >=I =@ K>AHI =>AI ALAH ?J=E AMEAI
       6DA BMEC FJEI =HA HA?CEA@ A=?D =I = IAF=H=JA =HCKAJ
       −a      5KFFO =>I?EII=I =KJ=JE?=O  xL=KAI =FFA=H E JDA EFKJ 5F=?EC EI CELA >O JDA
               ANJ =HCKAJ @AB=KJ  ) IA?@ FJE= =HCKAJ EI JDA IJ=HJEC FEJ BH =KJ=JE?
               =>I?EII=I @AB=KJ  H  MEJD = C I?=A E x H JDA MAH EEJ CELA >O −x
       −b      *HA= @EI?A?J JDA CH=FD =BJAH A=?D =>A E JDA EFKJ
       −c      +D=H=?JAH IJHEC CELA >O ANJ =HCKAJ EI @AB=KJ =>A BH A=?D FEJ
       −g      ANJ =HCKAJ EI CHE@ IJOA   CHE@  BH=A MEJD JE?I     BK CHE@ @AB=KJ
       −l      ANJ =HCKAJ EI = ACA@ J JEJA JDA CH=FD /HE@ H=CAI =HA =KJ=JE?=O FHEJA@ =I F=HJ
               B JDA JEJA KAII = −s FJE EI FHAIAJ
       −m      ANJ =HCKAJ EI @A IJOA B ?A?JEC EAI  @EI?A?JA@  ?A?JA@ 5A
               @ALE?AI CELA @EIJECKEID=>A EA IJOAI BH JDAH I= EJACAHI @A  @AB=KJ >ACEI
               MEJD IJOA  =@ HJ=JAI IJOAI BH IK??AIIELA ?KHLAI K@AH FJE −o
       −o      LAH=O 6DA H@E=JAI BH n IKFAHFIA@ ?KHLAI =FFA=H E JDA EFKJ MEJD A=?D =>I?EII=
               L=KA 6DA ANJ =HCKAJ EI n
       −p      ANJ =HCKAJ EI A H HA B JDA ?D=H=?JAHI bcgkmrwy, ?DIEC FA ?HI >O JDAEH
               EEJE= AJJAH =I E plot$ 5K??AIIELA ?KHLAI ME ?O?A JDHKCD JDA ?HI E JDA CELA H@AH
       −s      5=LA I?HAA  AM F=CA BH JDEI CH=FD
       −x l 1B l EI FHAIAJ x=NEI EI C=HEJDE? ANJ  H  =HCKAJI =HA MAH =@ KFFAH x E
            EJI 6DEH@ =HCKAJ EB FHAIAJ EI CHE@ IF=?EC  x =NEI H=O JDAIA GK=JEJEAI =HA
            @AJAHEA@ =KJ=JE?=O
       −y l 5EE=HO BH y
       −e      =A =KJ=JE?=O @AJAHEA@ x =@ y I?=AI AGK=
       −h      ANJ =HCKAJ EI BH=?JE B IF=?A BH DAECDJ
       −w      5EE=HO BH ME@JD
       −r      ANJ =HCKAJ EI BH=?JE B IF=?A J LA HECDJ >ABHA FJJEC
       −u      5EE=HO J LA KF >ABHA FJJEC
       −t      6H=IFIA DHEJ= =@ LAHJE?= =NAI FJE −a M =FFEAI J JDA LAHJE?= =NEI
       1B = IFA?EBEA@ MAH EEJ AN?AA@I JDA KFFAH EEJ JDA =NEI EI HALAHIA@
SOURCE
     /sys/src/cmd/graph
SEE ALSO
      plot grap
BUGS
       5ACAJI JD=J HK KJ B >K@I =HA @HFFA@ J ME@MA@ C=HEJDE? =NAI =O J >A
       HALAHIA@ FJE −e =?JK=O =AI =KJ=JE? EEJI H=JDAH JD= =KJ=JE? I?=EC AGK=




                                                       '$
/4-2                                                                                           /4-2




NAME
       CHAF   IA=H?D = BEA BH = F=JJAH
SYNOPSIS
     grep  −bchiLlnsv   −e  pattern  −f patternfile  file ... 
DESCRIPTION
      Grep IA=H?DAI JDA EFKJ files IJ=@=H@ EFKJ @AB=KJ BH EAI JD=J =J?D JDA pattern = HACK=H
      ANFHAIIE =I @ABEA@ E regexp$ MEJD JDA =@@EJE B = AMEA ?D=H=?JAH =I = =JAH=JELA IK>
      IJEJKJA BH | MEJD MAIJ FHA?A@A?A H=O A=?D EA =J?DEC JDA F=JJAH EI IAA?JA@  =@
      A=?D IAA?JA@ EA EI ?FEA@ J JDA IJ=@=H@ KJFKJ 6DA FJEI =HA
       −c     2HEJ O = ?KJ B =J?DEC EAI
       −h     , J FHEJ BEA =A J=CI DA=@AHI MEJD KJFKJ EAI
       −e     6DA BMEC =HCKAJ EI J=A =I = pattern 6DEI FJE =AI EJ A=IO J IFA?EBO F=JJAHI
              JD=J ECDJ ?BKIA =HCKAJ F=HIEC IK?D =I −n
       −i     1CHA =FD=>AJE? ?=IA @EIJE?JEI 6DA EFAAJ=JE B@I EJ MAH ?=IA = AJJAHI E
              JDA F=JJAH =@ EFKJ >ABHA EJAHFHAJ=JE =J?DA@ EAI =HA FHEJA@ E JDAEH HECE=
              BH
       −l     A 2HEJ JDA =AI B BEAI MEJD IAA?JA@ EAI @ J FHEJ JDA EAI
       −L     2HEJ JDA =AI B BEAI MEJD  IAA?JA@ EAI JDA ?LAHIA B −l
       −n     =H A=?D FHEJA@ EA MEJD EJI EA K>AH ?KJA@ E EJI BEA
       −s     2H@K?A  KJFKJ >KJ HAJKH IJ=JKI
       −v     4ALAHIA FHEJ EAI JD=J @ J =J?D JDA F=JJAH
       −f     6DA F=JJAH =HCKAJ EI JDA =A B = BEA ?J=EEC HACK=H ANFHAIIEI A FAH EA
       −b     , J >KBBAH JDA KJFKJ MHEJA A=?D KJFKJ EA =I I =I EJ EI @EI?LAHA@
       KJFKJ EAI =HA J=CCA@ >O BEA =A MDA JDAHA EI HA JD= A EFKJ BEA 6 BH?A JDEI J=C
       CEC E?K@A /dev/null =I = BEA =A =HCKAJ
       +=HA IDK@ >A J=A MDA KIEC JDA IDA AJ=?D=H=?JAHI $*[^|()=\ =@ AMEA E pattern EJ
       EI I=BAIJ J A?IA JDA AJEHA ANFHAIIE E IECA GKJAI ’    ’ ) ANFHAIIE IJ=HJEC MEJD 
       ME JHA=J JDA HAIJ B JDA ANFHAIIE =I EJAH= ?D=H=?JAHI
SOURCE
     /sys/src/cmd/grep
SEE ALSO
      ed awk sed sam regexp$
DIAGNOSTICS
     -NEJ IJ=JKI EI K EB =O EAI =HA IAA?JA@ H K MDA  EAI =HA IAA?JA@ H = AHHH
     ??KHI




                                                   '%
/5                                                                                                  /5




NAME
        CI   )=@@E /DIJI?HEFJ 2IJ5?HEFJ =@ 2,. =CK=CA EJAHFHAJAH
SYNOPSIS
     gs  options   files  
DESCRIPTION
      /DIJI?HEFJ EI = FHCH=EC =CK=CA IEE=H J )@>A 5OIJAI 2IJ5?HEFJ =@ 2,. =CK=CAI
      MDE?D =HA E JKH IEE=H J .HJD Gs HA=@I files E IAGKA?A =@ ANA?KJAI JDA =I /DIJI?HEFJ
      FHCH=I )BJAH @EC JDEI EJ HA=@I BKHJDAH EFKJ BH JDA IJ=@=H@ EFKJ 1B JDA file − EI =A@
      DMALAH EJ HAFHAIAJI JDA IJ=@=H@ EFKJ MDE?D EI HA=@ E H@AH =@ J =BJAH JDA BEAI  JDA ?
      =@ EA -=?D EA EI EJAHFHAJA@ IAF=H=JAO 6DA GKEJ ?=@ H A@BBEA ANEJI JDA EJAH
      FHAJAH
        6DA EJAHFHAJAH HA?CEAI IALAH= IMEJ?DAI @AI?HE>A@ >AM MDE?D =O =FFA=H =OMDAHA E JDA
        ?=@ EA =@ =FFO J = BEAI JDAHA=BJAH
        6DA −h H −? FJEI CELA DAF =@ EIJ JDA =L=E=>A @ALE?AI JDA @AB=KJ EI plan9 MDE?D FH
        @K?AI ?FHAIIA@ E=CA BEAI IKEJ=>A BH LEAMEC MEJD page >KJ JA JD=J page ME ELA
        gs =KJ=JE?=O IAA EJI =K=
        /DIJI?HEFJ =O >A >KEJ MEJD KJEFA KJFKJ @ALE?AI /DIJI?HEFJ H=O FAI JDA BEHIJ A
        =@ @EHA?JI KJFKJ J EJ 6 KIA @ALE?A NO =I JDA EEJE= KJFKJ @ALE?A E?K@A JDA IMEJ?D
                −sDEVICE=xyz
        E JDA ?=@ EA 6DEI IMEJ?D KIJ FHA?A@A JDA BEHIJ 2IJ5?HEFJ BEA =@ O EJI BEHIJ EL?=JE
        D=I =O ABBA?J KJFKJ @ALE?AI ?= =I >A IAA?JA@ >O JDA MH@ selectdevice E JDA EFKJ =
        CK=CA H >O IAJJEC JDA ALEHAJ L=HE=>A GS_DEVICE 6DA H@AH B FHA?A@A?A BH JDAIA
        =JAH=JELAI DECDAIJ J MAIJ EI
                selectdevice
                ?=@ EA
                GS_DEVICE
                plan9
        H=O KJFKJ CAI @EHA?JO J = I?H=J?D BEA 6 IA@ JDA KJFKJ J = IAHEAI B BEAI foo1.xyz
        foo2.xyz AJ? KIA JDA IMEJ?D
                −sOutputFile=foo%d.xyz
        6DA @ =O >A =O printf IAA fprintf  BH=J IFA?EBE?=JE -=?D BEA ME HA?AELA A F=CA B
        KJFKJ 1B JDA BEA =A >ACEI MEJD = FEFA ?D=H=?JAH JDA KJFKJ ME >A IAJ =I IJ=@=H@ EFKJ J
        JDA BMEC FEFAEA .H AN=FA
                −sOutputFile=|lp
        5FA?EBOEC JDA BEA − ME IA@ JDA BEAI J IJ=@=H@ KJFKJ JDEI =I HAGKEHAI A=>EC JDA −q
        FJE
   Initialization files
        9DA EC BH JDA EEJE=E=JE BEAI gs_*.ps JDA BEAI HA=JA@ J BJI H JDA BEA BH JDA
        run FAH=JH /DIJI?HEFJ BEHIJ I BH JDA BEA EB EJ @AI J IJ=HJ MEJD = I=ID E JDA ?KHHAJ
        @EHA?JHO JDA E JDAIA @EHA?JHEAI E JDA BMEC H@AH
             )O @EHA?JHEAI IFA?EBEA@ >O −I IMEJ?DAI E JDA ?=@ EA IAA >AM
              )O @EHA?JHEAI IFA?EBEA@ >O JDA GS_LIB ALEHAJ L=HE=>A
        !     6DA @EHA?JHEAI /sys/lib/ghostscript /sys/lib/ghostscript/font =@
               /sys/lib/postscript/font
        6DA GS_LIB H −I F=H=AJAHI =O >A = IECA @EHA?JHO H = ?IAF=H=JA@ EIJ
   Options
       −− filename arg1 ...
              6=A JDA ANJ =HCKAJ =I = BEA =A =I KIK= >KJ J=A = HA=EEC =HCKAJI ALA EB
              JDAO D=LA JDA IOJ=?JE? BH B IMEJ?DAI =@ @ABEA JDA =A )4/7-65 E KIAH@E?J J
              IOIJA@E?J =I = =HH=O B JDIA IJHECI before HKEC JDA BEA 9DA /DIJI?HEFJ BEEIDAI
              ANA?KJEC JDA BEA EJ ANEJI >=? J JDA IDA
        −Dname=token




                                                     '&
/5                                                                                                     /5



        −dname=token
             ,ABEA = =A E IOIJA@E?J MEJD JDA CELA @ABEEJE 6DA JA KIJ >A AN=?JO A
             JA =I @ABEA@ >O JDA JA FAH=JH =@ KIJ J ?J=E =O MDEJA IF=?A
        −Dname
        −dname
             ,ABEA = =A E IOIJA@E?J MEJD L=KAK
        −Sname=string
        −sname=string
             ,ABEA = =A E IOIJA@E?J MEJD = CELA IJHEC =I L=KA 6DEI EI @EBBAHAJ BH −d .H
             AN=FA −dname=35 EI AGKEL=AJ J JDA FHCH= BH=CAJ
                    /name 35 def
             MDAHA=I −sname=35 EI AGKEL=AJ J
                    /name (35) def
        −q     3KEAJ IJ=HJKF IKFFHAII H= IJ=HJKF AII=CAI =@ =I @ JDA AGKEL=AJ B −dQUIET
        −gnumber1xnumber2
             -GKEL=AJ J −dDEVICEWIDTH=number1 =@ −dDEVICEHEIGHT=number2 6DEI EI
             BH JDA >AABEJ B @ALE?AI IK?D =I ME@MI JD=J =M ME@JD =@ DAECDJ J >A IFA?EBEA@
        −rnumber
        −rnumber1xnumber2
             -GKEL=AJ J −dDEVICEXRESOLUTION=number1 =@ −dDEVICEYRESOLUTION=
             number2 6DEI EI BH JDA >AABEJ B @ALE?AI IK?D =I FHEJAHI JD=J IKFFHJ KJEFA : =@ ;
             HAIKJEI 1B O A K>AH EI CELA EJ EI KIA@ BH >JD : =@ ; HAIKJEI
        −Idirectories
              )@@I JDA @AIEC=JA@ EIJ B @EHA?JHEAI =J JDA DA=@ B JDA IA=H?D F=JD BH E>H=HO BEAI
        JA JD=J CIEEJFI =AI IOIJA@E?J HA=@O I JDA L=KAI B =AI @ABEA@ MEJD ,@5I
        ?=J >A ?D=CA@ =JDKCD B ?KHIA JDAO ?= >A IKFAHIA@A@ >O @ABEEJEI E KIAH@E?J H JDAH
        @E?JE=HEAI
  Special names
      −dBATCH
             -NEJ =BJAH JDA =IJ BEA D=I >AA FH?AIIA@ 6DEI EI AGKEL=AJ J EIJEC quit.ps =J JDA A@ B
             JDA EIJ B BEAI
        −dDISKFONTS
             +=KIAI E@ELE@K= ?D=H=?JAH KJEAI J >A =@A@ BH JDA @EI JDA BEHIJ JEA JDAO =HA
             A?KJAHA@ H=O /DIJI?HEFJ =@I = JDA ?D=H=?JAH KJEAI MDA EJ =@I = BJ
             6DEI =O =M =@EC HA BJI EJ 4) =J JDA ANFAIA B IMAH HA@AHEC
        −dNOCACHE
             ,EI=>AI ?D=H=?JAH ?=?DEC O KIABK BH @A>KCCEC
        −dNOBIND
             ,EI=>AI JDA >E@ FAH=JH O KIABK BH @A>KCCEC
        −dNODISPLAY
             5KFFHAIIAI JDA H= EEJE=E=JE B JDA KJFKJ @ALE?A 6DEI =O >A KIABK MDA @A>KC
             CEC
        −dNOPAUSE
             ,EI=>AI JDA FHFJ =@ F=KIA =J JDA A@ B A=?D F=CA 6DEI =O >A @AIEH=>A BH =FFE?=
             JEI MDAHA =JDAH FHCH= AC page EI @HELEC /DIJI?HEFJ
        −dSAFER
             ,EI=>AI JDA deletefile =@ renamefile FAH=JHI =@ JDA =>EEJO J FA BEAI E
             =O @A JDAH JD= HA=@O 6DEI =O >A @AIEH=>A BH IFAHI H JDAH IAIEJELA ALE
             HAJI .EAI E JDA /fd @EHA?JHO =O IJE >A FAA@ BH MHEJEC
        −dWRITESYSTEMDICT
             A=LAI IOIJA@E?J MHEJ=>A 6DEI EI A?AII=HO MDA HKEC IFA?E= KJEEJO FHCH=I IK?D
             =I BJ ? =@ F?D=HIJH MDE?D KIJ >OF=II H= 2IJ5?HEFJ =??AII FHJA?JE




                                                      ''
/5                                                                                                  /5



        −sDEVICE=device
             5AA?JI = =JAH=JA EEJE= KJFKJ @ALE?A =I @AI?HE>A@ =>LA
        −sOutputFile=filename
             5AA?JI = =JAH=JA KJFKJ BEA H FEFA BH JDA EEJE= KJFKJ @ALE?A =I @AI?HE>A@ =>LA
FILES
        /sys/lib/ghostscript/*
             5J=HJKFBEAI KJEEJEAI AN=FAI =@ >=IE? BJ @ABEEJEI
        /sys/lib/ghostscript/fonts/*
             )@@EJE= BJ @ABEEJEI
SOURCE
     /sys/src/cmd/gs
SEE ALSO
      page ps2pdf
      6DA /DIJI?HEFJ @?KAJ BEAI E doc =@ man IK>@EHA?JHEAI B JDA IKH?A @EHA?JHO
BUGS
        6DA JHA=JAJ B IJ=@=H@ EFKJ EI IJ=@=H@




                                                     
/81-9                                                                                            /81-9




NAME
       CLEAM   EJAH=?JELA CH=FD LEAMAH
SYNOPSIS
     gview  −mp   −l logfile   files 
DESCRIPTION
      Gview HA=@I FOC= EAI H = FOC= EA @H=MEC BH = ASCII EFKJ BEA MDE?D @AB=KJI
      J IJ=@=H@ EFKJ =@ LEAMI EJ EJAH=?JELAO MEJD ?=@I J  E =@ KJ FAHBH IEFA
      A@EJEC FAH=JEI =@ @EIF=O EBH=JE =>KJ FEJI =@ FOEAI KJEFA EFKJ BEAI =HA
      =MA@ EB OK M=J J LAH=O IALAH= EA @H=MECI 6DA A@EJEC ?=@I ?= ?D=CA JDA ?H
      =@ JDE?AII B JDA FOEAI @AAJA H K@AAJA IA B JDA =@ FJE=O HJ=JA =@ LA
      JDA 1J EI =I FIIE>A J CAAH=JA = KJFKJ BEA JD=J HABA?JI JDAIA ?D=CAI =@ EI E JDA I=A
      BH=J =I JDA EFKJ
       5E?A JDA move =@ rotate ?=@I =HA K@AIEH=>A MDA KIJ LEAMEC = CH=FD JDAO =HA O
       A=>A@ EB gview EI ELA@ MEJD JDA −m FJE
       6DA −p FJE FJI O JDA LAHJE?AI B JDA FOCI
       +E?EC  = FOEA MEJD >KJJ  @EIF=OI JDA ?H@E=JAI =@ = t L=KA JD=J JAI DM B=H =C
       JDA FOEA (t =J JDA BEHIJ LAHJAN t =J JDA BEHIJ LAHJAN t# D=BM=O >AJMAA JDA IA?@
       =@ JDEH@ LAHJE?AI AJ? 6DA −l FJE CAAH=JAI = C BEA JD=J EIJI = FEJI IAA?JA@ E JDEI =
       AH
       6DA IJ EFHJ=J EJAH=?JELA FAH=JEI =HA J zoom in >O IMAAFEC KJ = HA?J=CA H J zoom
       out I JD=J ALAHOJDEC ?KHHAJO >AEC @EIF=OA@ IDHEI J BEJ E JDA IMAFJKJ HA?J=CA JDAH
       FJEI  JDA >KJJ ! AK =HA unzoom MDE?D HAIJHAI JDA ?H@E=JA IOIJA J JDA @AB=KJ
       IJ=JA MDAHA ALAHOJDEC BEJI  JDA I?HAA recenter MDE?D J=AI = FEJ =@ =AI EJ JDA ?AJAH B
       JDA ME@M =@ square up MDE?D =AI JDA DHEJ= =@ LAHJE?= I?=A B=?JHI AGK=
       6 J=A = CH=FD B = BK?JE MDAHA IA F=HJ EI =IJ EA=H =@ IAA DM EJ @ALE=JAI BH =
       IJH=ECDJ EA IAA?J JM FEJI  JDEI F=HJ B JDA CH=FD EA IAA?J A MEJD >KJJ  =@ JDA
       IAA?J JDA JDAH =@ JDA KIA JDA slant ?=@  JDA >KJJ ! AK 6DEI I=JI JDA ?H@E
       =JA IOIJA I JD=J JDA EA >AJMAA JDA JM IAA?JA@ FEJI =FFA=HI DHEJ= >KJ LAHJE?= IJE
       A=I FIEJELA y 6DA JDA zoom in ?=@ ?= >A KIA@ J =??AJK=JA @ALE=JEI BH DHE
       J= 6DAHA EI =I = unslant ?=@ JD=J K@AI = B JDEI =@ CAI >=? J = KI=JA@ ?H
       @E=JA IOIJA
       6DAHA EI = recolor ?=@  >KJJ ! JD=J AJI OK IAA?J = ?H =@ ?D=CA ALAHOJDEC J D=LA
       JD=J ?H =@ = IEE=H ?=@  >KJJ JD=J O =BBA?JI JDA IAA?JA@ FOEA 1B JDA EFKJ
       BEA KIAI JDA Multi(...) BA=JKHA ANF=EA@ >AM AEJDAH B=LH B recolor =MI OK J JOFA =
       @ECEJ E EAK B IAA?JEC = ?H
       6DA thick H thin ?=@  >KJJ ?D=CAI JDA JDE?AII B JDA IAA?JA@ FOEA =@ JDAHA EI
       =I = K@ ?=@ BH IK?D A@EJI .E=O >KJJ ! D=I ?=@I J read = AM EFKJ BEA
       =@ @EIF=O EJ  JF B ALAHOJDEC AIA restack JDA @H=MEC H@AH E ?=IA EAI B @EBBAHAJ ?H
       =HA @H=M  JF B A=?D JDAH write ALAHOJDEC EJ = KJFKJ BEA H exit JDA FHCH=
       -=?D FOEA E = EFKJ H KJFKJ BEA EI = IF=?A@AEEJA@ x y ?H@E=JA F=EH  = EA >O EJIAB
       =@ JDA FOEA EI = IAGKA?A B IK?D LAHJE?AI BMA@ >O = =>A 6DA =>A ?K@ >A KIJ = >=
       EA H EJ ?K@ >A = IJHEC E @K>A GKJAI H LEHJK=O =O JANJ JD=J @AI J ?J=E IF=?AI =@
       EI  = EA >O EJIAB 6DA =>A =J JDA A@ B JDA =IJ FOEA EI FJE= 1J EI J AC= J D=LA
       JM ?IA?KJELA =>AI IE?A JD=J MK@ @AJA = AHLAHJAN FOEA =@ A=?D FOEA KIJ
       D=LA =J A=IJ A LAHJAN ALAHJAN FOEAI =HA KIABK BH I?=JJAH FJI 7@AH JDA −l FJE
       = AMEA ?=KIAI JDA IAA?JA@ FOEA I =>A J =FFA=H E JDA C BEA MDAHA EJ ?K@ >A IAA >O
       ELEC tail −f E =JDAH ME@M

       1B JDA =>A =BJAH = FOEA ?J=EI JDA MH@ Thick H = ?H =A (Red Pink Dkred
       Orange Yellow Dkyellow Green Dkgreen Cyan Blue Ltblue Magenta
       Violet Gray Black White MDE?DALAH ?H =A ?AI BEHIJ ME >A KIA@ J ?H JDA
       FOEA )JAH=JELAO =>AI ?= ?J=E Multi BMA@ >O IECAAJJAH LAHIEI B JDAIA
       =AI (R P r O Y y G g C B b M V A K W A=?D FJE=O FHA?A@A@ >O T 6DA
       recolor BMA@ >O = AH @ECEJ n IAA?JI JDA nJD =JAH=JELA BH A=?D FOEA



                                                    
/81-9                                                                                        /81-9



EXAMPLE
     6 IAA = CH=FD B JDA BK?JE ysin(N)/N CAAH=JA EFKJ MEJD = =M I?HEFJ =@ FEFA EJ EJ gview
              awk ’BEGIN{for(x=.1;x<500;x+=.1)print x,sin(x)/x}’ | gview
SOURCE
     /sys/src/cmd/gview.c
SEE ALSO
      awk tail
BUGS
       6DA KIAH EJAHB=?A BH JDA slant ?=@ EI ?KJAHEJKEJELA 2AHD=FI EJ MK@ >A >AJJAH J D=LA =
       I?DAA BH IMAAFEC KJ = F=H=ACH=
       6DA −p FJE =AI JDA EJAH=?JELA FEJ IAA?JE BA=JKHA >AD=LA IJH=CAO =@ EI KA?AII=HO
       IE?A ANJH= >= EAI E JDA EFKJ =?DEALA AIIAJE=O JDA I=A ABBA?J




                                                  
/12                                                                                             /12




NAME
       CEF CKEF >EF  >KEF  ?FHAII K?FHAII EF KEF     ?FHAII =@ ANF=@ @=J=
SYNOPSIS
     gzip −cvD1−9 file ...
       gunzip −ctTvD file ...
       bzip2 −cvD1−9 file ...
       bunzip2 −cvD file ...
       compress  −cv   file ... 
       uncompress  −cv   file ... 
       zip −avD1−9 −f zipfile file ...
       unzip −cistTvD −f zipfile file ...
DESCRIPTION
      Gzip A?@AI BEAI MEJD = DO>HE@ AFAEL '%% =@ 0KBB= ?FHAIIE =CHEJD M =I
      deflate IJ B JDA JEA JDA HAIKJEC BEA EI I=AH =@ ME ALAH >A K?D >ECCAH KJFKJ
      BEAI =HA =A@ >O J=EC JDA =IJ F=JD AAAJ B A=?D BEA =HCKAJ =@ =FFA@EC .gz EB JDA
      HAIKJEC =A A@I MEJD .tar.gz EJ EI ?LAHJA@ J .tgz EIJA=@ Gunzip HALAHIAI JDA FH
      ?AII 1JI KJFKJ BEAI =HA =A@ >O J=EC JDA =IJ F=JD AAAJ B A=?D BEA =HCKAJ ?LAHJEC
      .tgz J .tar.gz =@ IJHEFFEC =O .gz JDA HAIKJEC =A KIJ >A @EBBAHAJ BH JDA HECE=
      =A
       Bzip2 =@ bunzip2 =HA IEE=H E EJAHB=?A J gzip =@ gunzip >KJ KIA = @EBEA@ *KHHMI9DAAAH
       >? IHJEC ?FHAIIE =CHEJD 6DA @AB=KJ IKBBEN BH KJFKJ BEAI EI .bz2 MEJD .tar.bz2
       >A?EC .tbz Bunzip2 HA?CEAI JDA ANJAIE .tbz2 =I = IOO BH .tbz
       Compress =@ uncompress =HA IEE=H E EJAHB=?A J gzip =@ gunzip >KJ KIA JDA AFAEL
       9A?D ?FHAIIE =CHEJD 6DA @AB=KJ IKBBEN BH KJFKJ BEAI EI .Z Compress EI A B JDA
       @AIJ ME@AIFHA=@ 7EN ?FHAIIE FHCH=I
       Zip A?@AI JDA =A@ BEAI =@ F=?AI JDA HAIKJI EJ JDA =H?DELA zipfile H JDA IJ=@=H@ KJFKJ
       EB  BEA EI CELA Unzip ANJH=?JI BEAI BH = =H?DELA ?HA=JA@ >O zip 1B  BEAI =HA =A@ =I
       =HCKAJI = B BEAI E JDA =H?DELA =HA ANJH=?JA@ ) @EHA?JHO I =A EFEAI = HA?KHIELAO ?
       J=EA@ BEAI =@ IK>@EHA?JHEAI Zip EI JDA de facto IJ=@=H@ BH ?FHAIIE  E?HIBJ FAH=J
       EC IOIJAI
       A B JDAIA FHCH=I HALAI JDA HECE= BEAI 1B JDA FH?AII B=EI JDA B=KJO KJFKJ BEAI =HA
       HALA@
       6DA FJEI =HA
       −a       )KJ=JE?E=O ?HA=JAI @EHA?JHEAI =I AA@A@ AA@A@ BH EF BEAI ?HA=JA@ >O >HA
                EFAAJ=JEI MDE?D EJ @EHA?JHEAI
       −c       9HEJA J IJ=@=H@ KJFKJ H=JDAH JD= ?HA=JEC = KJFKJ BEA
       −i       +LAHJ = =H?DELA BEA =AI J MAH ?=IA
       −s       5JHA=EC @A I =J JDA BEA @=J= =@=?AJ J A=?D ?FHAIIA@ BEA H=JDAH JD=
                IAAEC E JDA ?AJH= BEA @EHA?JHO 6DEI EI JDA @A KIA@ >O unzip EB  zipfile EI IFA?E
                BEA@ 1B −s EI CELA −T EI ECHA@
       −t       EIJ =J?DEC BEAI E JDA =H?DELA H=JDAH JD= ANJH=?JEC JDA
       −T       5AJ JDA KJFKJ JEA J JD=J IFA?EBEA@ E JDA =H?DELA
       −1  −9 5AJI JDA ?FHAIIE ALA −1 EI JKA@ BH IFAA@ −9 BH EE= KJFKJ IEA 6DA >AIJ
                ?FHEIA EI −6 JDA @AB=KJ
       −v       2H@K?A HA @AI?HEFJELA KJFKJ 9EJD −t =@@I JDA K?FHAIIA@ IEA E >OJAI =@ JDA
                @EBE?=JE JEA J JDA KJFKJ 9EJDKJ −t FHEJI JDA =AI B BEAI  IJ=@=H@ AHHH
                =I JDAO =HA ?FHAIIA@ H @A?FHAIIA@
       −D       2H@K?A @A>KCCEC KJFKJ




                                                   !
/12                                                                                            /12



SOURCE
     /sys/src/cmd/gzip
     /sys/src/cmd/bzip2
     /sys/src/cmd/compress
SEE ALSO
      tar
      ) 6A?DEGKA BH 0ECD 2AHBH=?A ,=J= +FHAIIE 6AHHO ) 9A?D IEEE Computer L %
       $ KA '&" FF &'
BUGS
       Unzip ?= O ANJH=?J BEAI MDE?D =HA K?FHAIIA@ H ?FHAIIA@ MEJD JDA deflate ?FHAI
       IE I?DAA 4A?AJ EF BEAI B= EJ JDEI ?=JACHO 8AHO HA?AJ EF BEAI =O D=LA J=>AI B ?
       JAJI JD=J unzip ?=J HA=@ 5K?D BEAI =HA IJE HA=@=>A >O ELEC unzip MEJD JDA −s FJE




                                                   "
0/-6                                                                                               0/-6




NAME
       DCAJ   HAJHEALA = MA> F=CA ?HHAIF@EC J = KH
SYNOPSIS
     hget  −dhv   −o ofile   −p body   −x netmntpt   −r header  url
DESCRIPTION
      Hget HAJHEALAI JDA MA> F=CA IFA?EBEA@ >O JDA 74 url =@ MHEJAI EJ =>IAJ JDA −o FJE J IJ=
      @=H@ KJFKJ 6DA M 74 JOFAI =HA DJJF =@ BJF
       1B url EI B JOFA 0662 =@ JDA −p FJE EI IFA?EBEA@ JDA = 0662 256 EI FAHBHA@ MEJD body =I
       JDA @=J= J >A FIJA@
       6DA −o FJE EI KIA@ J AAF = ?= BEA E IO? MEJD = MA> F=CA 1B JDA MA> F=CA D=I >AA @E
       BEA@ =JAH JD= JDA BEA EJ EI ?FEA@ EJ JDA BEA 1B JDA BEA EI KF J @=JA >KJ E?FAJA hget ME
       BAJ?D JDA EIIEC >OJAI
       FJE −h ?=KIAI 0662 DA=@AHI J >A FHEJA@ J IJ=@=H@ KJFKJ E =@@EJE J JDA JH=IBAHHA@
       MA> F=CA
       FJE −r IA@I = =H>EJH=HO 0662 header
       FJE −d JKHI  @A>KCCEC MHEJJA J IJ=@=H@ AHHH
       H=O hget KIAI JDA 12 IJ=? KJA@ K@AH /net 6DA −x FJE ?= >A KIA@ J IFA?EBO JDA
       KJ FEJ B = @EBBAHAJ 12 IJ=? J KIA
       FJE −v MHEJAI FHCHAII EAI J IJ=@=H@ AHHH ?A = IA?@ -=?D EA ?J=EI JM K>AHI
       JDA >OJAI JH=IBAHHA@ I B=H =@ JDA JJ= ACJD J >A JH=IBAHHA@
       1B JDA ALEHAJ L=HE=>A httpproxy EI IAJ EJ EI KIA@ =I = 74 @AJEC = 0662 FHNO IAHLAH
       ) 0662 =??AIIAI KIA JDEI IAHLAH J CAJ JDA F=CA EIJA=@ B ?=EC JDA @AIJE=JE IAHLAH
SOURCE
     /sys/src/cmd/hget.c
SEE ALSO
      ftpfs"




                                                     #
01564;                                                                                     01564;




NAME
        DEIJHO    FHEJ BEA =AI BH JDA @KF
SYNOPSIS
     history  −Dabcemnw   −fuv   −d dumpfilesystem   −s yyyymmdd  files ...
DESCRIPTION
      History FHEJI JDA =AI @=JAI =@ IEAI =@ @EBEAH B = LAHIEI B JDA =A@ files EC
      >=?M=H@I E JEA IJHA@ E JDA @KF BEA IOIJA 1B JDA BEA ANEIJI E JDA =E JHAA JDA BEHIJ EA
      B KJFKJ ME >A EJI ?KHHAJ IJ=JA .H AN=FA
                  history /adm/users
        FH@K?AI
                  May   14 15:29:18     EDT   2001   /adm/users 10083 [adm]
                  May   14 15:29:18     EDT   2001   /n/dump/2001/0515/adm/users 10083 [adm]
                  May   11 17:26:24     EDT   2001   /n/dump/2001/0514/adm/users 10481 [adm]
                  May   10 16:40:51     EDT   2001   /n/dump/2001/0511/adm/users 10476 [adm]
                         ...
        9DA FHAIAJA@ MEJD = F=JD B JDA BH /n/fs/path history ME KIA fsdump =I JDA =A B JDA
        @KF BEA IOIJA =@ ME FHEJ = DEIJHO B path
        6DA −v FJE A=>AI LAH>IA @A>KCCEC FHEJKJ
        6DA −D FJE ?=KIAI diff J >A HK BH A=?D =@=?AJ F=EH B @KF BEAI 6DA FJEI
        −abcemnw =HA F=IIA@ JDHKCD J diff; JDA EJJAKIA@ diff option −f EI HAF=?A@ >O JDA BK?JE=
        EJO @AI?HE>A@ >AM =@ JDA −r FJE EI @EI=MA@
        6DA −u FJE ?=KIAI JEAI J >A FHEJA@ E /6 76 H=JDAH JD= ?= JEA
        6DA −d FJE IAA?JI IA JDAH @KF BEA IOIJA IK?D =I /n/bootesdump
        6DA −f FJE BH?AI JDA IA=H?D J ?JEKA ALA MDA JDA BEA E GKAIJE @AI J ANEIJ KIABK
        BH BEAI JD=J O ANEIJ EJAHEJJAJO
        .E=O JDA −s FJE IAJI JDA IJ=HJEC IJ HA?AJ @=JA BH JDA KJFKJ
EXAMPLES
     +DA? DM BJA = KIAH D=I >AA CCA@ E
                  history /usr/ches/tmp
FILES
        /n/dump
SOURCE
     /sys/src/cmd/history.c
SEE ALSO
      fs"
      yesterday




                                                     $
0+                                                                                                 0+




NAME
       D?   EJAH=?JELA B=JEC FEJ =CK=CA
SYNOPSIS
     hoc  −e expression   file ... 
DESCRIPTION
      Hoc EJAHFHAJI = IEFA =CK=CA BH B=JEC FEJ =HEJDAJE? =J =>KJ JDA ALA B *)51+ MEJD +
      EA IOJ=N =@ BK?JEI
       6DA =A@ files =HA HA=@ =@ EJAHFHAJA@ E H@AH 1B  file EI CELA H EB file EI − hoc EJAHFHAJI JDA
       IJ=@=H@ EFKJ 6DA −e FJE =MI EFKJ J hoc J >A IFA?EBEA@  JDA ?=@ EA J >A
       JHA=JA@ =I EB EJ =FFA=HA@ E = BEA
       Hoc EFKJ ?IEIJI B expressions =@ statements -NFHAIIEI =HA AL=K=JA@ =@ JDAEH HAIKJI
       FHEJA@ 5J=JAAJI JOFE?=O =IIECAJI =@ BK?JE H FH?A@KHA @ABEEJEI FH@K?A  KJ
       FKJ KAII JDAO ANFE?EJO ?= print
       8=HE=>A =AI D=LA JDA KIK= IOJ=N E?K@EC _ JDA =A _ >O EJIAB ?J=EI JDA L=KA B JDA
       =IJ ANFHAIIE AL=K=JA@ 6DA L=HE=>AI E PI PHI GAMMA =@ DEG =HA FHA@ABEA@ JDA =IJ EI
       #' # @ACHAAI FAH H=@E=
       -NFHAIIEI =HA BHA@ MEJD JDAIA +EA FAH=JHI EIJA@ >O @A?HA=IEC FHA?A@A?A
       ^      ANFAJE=JE
       ! − ++ −−
       * / %
       + −
       > >= < <= == !=
       &&
       ||
       = += −= *= /= %=
       *KEJ E BK?JEI =HA abs acos asin atan A =HCKAJ cos cosh exp int log
       log10 sin sinh sqrt tan =@ tanh 6DA BK?JE read(x) HA=@I = L=KA EJ JDA L=HE
       =>A x =@ HAJKHI  =J -. JDA IJ=JAAJ print FHEJI = EIJ B ANFHAIIEI JD=J =O E?K@A
       IJHEC ?IJ=JI IK?D =I "hello\n"
       +JH BM IJ=JAAJI =HA ifelse while =@ for MEJD >H=?AI BH CHKFEC AMEA A@I
       = IJ=JAAJ *=?I=IDAMEA EI AGKEL=AJ J = IF=?A
       .K?JEI =@ FH?A@KHAI =HA EJH@K?A@ >O JDA MH@I func =@ proc return EI KIA@ J
       HAJKH MEJD = L=KA BH = BK?JE
EXAMPLES
     func gcd(a, b) {
          temp = abs(a) % abs(b)
          if(temp == 0) return abs(b)
          return gcd(b, temp)
     }
     for(i=1; i<12; i++) print gcd(i,12)
SOURCE
     /sys/src/cmd/hoc
SEE ALSO
      bc dc
      * 9 AHECD= =@ 4 2EA The Unix Programming Environment, 2HAJE?A0= '&"
BUGS
       -HHH HA?LAHO EI EFAHBA?J MEJDE BK?JE =@ FH?A@KHA @ABEEJEI




                                                     %
064..                                                                                  064.. 




NAME
        DJHBB   06 BH=JJEC =@ JOFAIAJJEC
SYNOPSIS
     htmlroff  −iuv   −m name   −r aN   file  
DESCRIPTION
      Htmlroff =??AFJI troff EFKJ E JDA =A@ files =@ BH=JI EJ =I 06 BH LEAMEC E = MA>
      >HMIAH
        1B  file =HCKAJ EI CELA htmlroff HA=@I JDA IJ=@=H@ EFKJ ) =HCKAJ ?IEIJEC B = IECA
        EKI − EI J=A J >A = BEA =A ?HHAIF@EC J JDA IJ=@=H@ EFKJ 6DA FJEI =HA
        −i     4A=@ IJ=@=H@ EFKJ =BJAH JDA EFKJ BEAI =HA AND=KIJA@
        −mname
             2H?AII JDA =?H BEA /sys/lib/tmac/tmac.name >ABHA JDA EFKJ files
        −raN 5AJ HACEIJAH a A ?D=H=?JAH =A J N
        −u     /AAH=JA 76. KJFKJ *O @AB=KJ htmlroff ?LAHJI 7E?@A HKAI EJ JDA ?HHAIF@EC
               06 AJEJO IAGKA?AI &alpha; &nbsp; =@ I  Htmlroff ELAI tcs BH JDA
               ?LAHIE
        −v     /AAH=JA @A>KCCEC KJFKJ =@ M=HECI =>KJ IKIFE?EKI EFKJ
        IJ troff EFKJ BEAI AIFA?E=O JDIA KIEC JDA ms$ =?HI ?= >A KIA@ K=JAHA@ 1 CAAH=
        JDA =?H BEA tmac.html IDK@ >A FH?AIIA@ =BJAH FH?AIIEC JDAH IJ=@=H@ =?H BEAI =I E
        htmlroff −ms −mhtml
        Htmlroff$ @AI?HE>AI JDA ?D=CAI J JDA EFKJ =CK=CA
        Mhtml$ @AI?HE>AI JDA AM =?HI
EXAMPLES
     .H=J JDA 2= ' MA> F=CA
               cd /usr/web/plan9
               htmlroff −mhtml index.tr >index.html
        .H=J = F=FAH
               cd /sys/doc
               pic auth.ms | tbl | eqn | htmlroff −ms −mhtml >auth.html
FILES
        /sys/lib/troff/font/devutf/utfmap
             =FFEC BH troff JM?D=H=?JAH =AI EA \(*a J 7E?@A ?D=H=?JAHI EA 
SOURCE
     /sys/src/cmd/htmlroff
SEE ALSO
      tcs troff htmlroff$ mhtml$




                                                     &
1,1..                                                                                             1,1.. 




NAME
        E@EBB   EJAH=?JELA @EBB
SYNOPSIS
     idiff  −bw  file1 file2
DESCRIPTION
      Idiff EJAH=?JELAO AHCAI file1 =@ file2 J IJ=@=H@ KJFKJ 9DAHALAH file1 =@ file2 @EBBAH idiff
      @EIF=OI JDA @EBBAHA?AI E JDA IJOA B diff −n  IJ=@=H@ AHHH =@ FHFJI JDA KIAH J
      IAA?J = ?DK 8=E@ HAIFIAI =HA
        <        7IA JDA ?DK BH file1
        >        7IA JDA ?DK BH file2
        =        7IA JDA @EBB KJFKJ EJIAB
        q< q> q=
              7IA JDA CELA HAIFIA BH = BKJKHA GKAIJEI
        !cmd -NA?KJA cmd =@ FHFJ =C=E
        Idiff ELAI diff J ?F=HA JDA BEAI 6DA −b =@ −w B=CI EB F=IIA@ =HA F=IIA@ J diff
FILES
        /tmp/idiff.*
SOURCE
     /sys/src/cmd/idiff.c
SEE ALSO
      diff
      AHECD= =@ 2EA The Unix Programming Environment 2HAJE?A0= '&"




                                                     '
1                                                                                                 1




NAME
       E   HA=JE= @=J=>=IA FAH=JH
SYNOPSIS
     join  options  file1 file2
DESCRIPTION
      Join BHI  JDA IJ=@=H@ KJFKJ = E B JDA JM HA=JEI IFA?EBEA@ >O JDA EAI B file1 =@
      file2 1B A B JDA BEA =AI EI − JDA IJ=@=H@ EFKJ EI KIA@
       File1 =@ file2 KIJ >A IHJA@ E E?HA=IEC )5+11 ?=JEC IAGKA?A  JDA BEA@I  MDE?D JDAO =HA
       J >A EA@ H=O JDA BEHIJ E A=?D EA
       6DAHA EI A EA E JDA KJFKJ BH A=?D F=EH B EAI E file1 =@ file2 JD=J D=LA E@AJE?= E BEA@I
       6DA KJFKJ EA H=O ?IEIJI B JDA ? BEA@ JDA JDA HAIJ B JDA EA BH file1 JDA JDA
       HAIJ B JDA EA BH file2
       1FKJ BEA@I =HA H=O IAF=H=JA@ IF=?AI H J=>I KJFKJ BEA@I >O IF=?A 1 JDEI ?=IA KJEFA
       IAF=H=JHI ?KJ =I A =@ A=@EC IAF=H=JHI =HA @EI?=H@A@
       6DA BMEC FJEI =HA HA?CEA@ MEJD 251: IOJ=N
       −a n    1 =@@EJE J JDA H= KJFKJ FH@K?A = EA BH A=?D KF=EH=>A EA E BEA n MDAHA n
               EI  H 
       −v n    EA −a EJJEC KJFKJ BH F=EHA@ EAI
       −e s    4AF=?A AFJO KJFKJ BEA@I >O IJHEC s
       −1 m
       −2 m E  JDA mJD BEA@ B file1 H file2
       −jn m
               )H?D=E? AGKEL=AJ BH −n m
       −ofields
              -=?D KJFKJ EA ?FHEIAI JDA @AIEC=JA@ BEA@I 6DA ?=IAF=H=JA@ BEA@ @AIEC=JHI
              =HA AEJDAH 0 A=EC JDA E BEA@ H D=LA JDA BH nm MDAHA n EI = BEA K>AH =@ m
              EI = BEA@ K>AH )H?D=E? KI=CA =MI IAF=H=JA =HCKAJI BH BEA@ @AIEC=JHI
       −tc     7IA ?D=H=?JAH c =I JDA O IAF=H=JH J=> ?D=H=?JAH  EFKJ =@ KJFKJ -LAHO =FFA=H
               =?A B c E = EA EI IECEBE?=J
EXAMPLES
     sort −t: +1 /adm/users | join −t: −1 2 −a 1 −e "" − bdays
          )@@ >EHJD@=OI J JDA /adm/users BEA A=LEC KM >EHJD@=OI AFJO 6DA =OKJ B
          /adm/users       EI   CELA E users$     bdays   ?J=EI    IHJA@  EAI  EA
          ken:Feb 4, 1953
       tr : ’ ’ </adm/users | sort −k 3 3 >temp
       join −1 3 −2 3 −o 1.1,2.1 temp temp | awk ’$1 < $2’
            2HEJ = F=EHI B KIAHI MEJD E@AJE?= KIAHE@I
SOURCE
     /sys/src/cmd/join.c
SEE ALSO
      sort comm awk
BUGS
       9EJD @AB=KJ BEA@ IAF=H=JE JDA ?=JEC IAGKA?A EI JD=J B sort −b −ky,y MEJD −t JDA
       IAGKA?A EI JD=J B sort −tx −ky,y
       A B JDA BEAI KIJ >A H=@O =??AIIE>A




                                                     
2/                                                                                                     2/




NAME
         FC CEB FC FF >F L  OKL E? JCEB JFF JFC JE?        LEAM =@ ?LAHJ FE?JKHAI
SYNOPSIS
     jpg  −39cdefFkJrtv   file ... 
     gif  −39cdektv   file ... 
     png  −39cdektv   file ... 
     ppm  −39cdektv   file ... 
     bmp  file 
     v210  −39cdektv   file ... 
     yuv  file 
         togif  −c comment   −l loopcount   −d msec   −t transindex   file ...  −d msec  file ... 
         toppm  −c comment   file 
         topng  −c comment    −g gamma   file 
         ico  file 
         toico  file ... 
DESCRIPTION
      6DAIA FHCH=I HA=@ @EIF=O =@ MHEJA E=CA BEAI E FK>E? BH=JI Jpg gif png ppm bmp
      v210 =@ yuv HA=@ BEAI E JDA ?HHAIF@EC BH=JI =@ >O @AB=KJ @EIF=O JDA E JDA ?KHHAJ
      ME@M FJEI ?=KIA JDA EIJA=@ J ?LAHJ JDA E=CAI J 2= ' E=CA BH=J =@ MHEJA JDA
      J IJ=@=H@ KJFKJ Togif Toppm =@ topng HA=@ 2= ' E=CAI BEAI ?LAHJ JDA J /1. 22
      H 2/ =@ MHEJA JDA J IJ=@=H@ KJFKJ
         6DA @AB=KJ >AD=LEH B jpg gif =@ ppm EI J @EIF=O JDA file H IJ=@=H@ EFKJ EB  BEA EI
         =A@ ?A = BEA EI @EIF=OA@ JOFEC = ?D=H=?JAH ?=KIAI JDA FHCH= J @EIF=O JDA ANJ E=CA
         6OFEC = q ,- H ?JH, ANEJI JDA FHCH= .H = HA KIAHBHEA@O EJAHB=?A KIA page
         MDE?D ELAI JDAIA FHCH=I J ?LAHJ JDA E=CAI J IJ=@=H@ BH=J @EIF=OI JDA =@ BBAHI
         I?HEC F=EC =@ AK@HELA =LEC=JE =C JDA BEAI
         6DAIA FHCH=I ID=HA =O FJEI
         −e      ,EI=>A .O@5JAE>AHC AHHH @EBBKIE MDE?D EI KIA@ J EFHLA JDA =FFA=H=?A B E=CAI
                  ?H=FFA@ @EIF=OI JOFE?=O MEJD & >EJI FAH FENA 2HE=HEO KIABK BH @A>KCCEC EB
                 JDA @EIF=O D=I JHKA 4/* ?H JDA E=CA ME >A @EIF=OA@ E BK CHO
         −k      +LAHJ =@ @EIF=O JDA E=CA =I = >=? =@ MDEJA HA=O CHAOI?=A E=CA
         −v      +LAHJ JDA E=CA J = 4/*8 ?H=FFA@ E=CA ALA EB JDA @EIF=O D=I JHKA 4/* ?H
         −d      5KFFHAII @EIF=O B JDA E=CA JDEI EI IAJ =KJ=JE?=O >O =O B JDA BMEC FJEI
         −c      +LAHJ JDA E=CA J = 2= ' HAFHAIAJ=JE =I @ABEA@ >O image$ =@ MHEJA EJ J IJ=
                 @=H@ KJFKJ
         −9      EA −c >KJ FH@K?A = K?FHAIIA@ E=CA 6DEI I=LAI FH?AIIEC JEA F=HJE?K=HO
                 MDA JDA KJFKJ EI >AEC FEFA@ J =JDAH FHCH= IK?D =I page IE?A EJ =LE@I ?
                 FHAIIE =@ @A?FHAIIE
         −t      +LAHJ JDA E=CA EB EJ EI E ?H J = JHKA ?H 4/* E=CA
         −3      EA −t >KJ BH?A JDA E=CA J 4/* ALA EB EJ EI HECE=O CHAOI?=A
         Jpg D=I JM ANJH= FJEI KIA@ J FH?AII JDA KJFKJ B JDA  LE@A ?=H@
         −f      AHCA JM =@=?AJ E=CAI MDE?D HAFHAIAJ JDA JM BEA@I B = LE@A FE?JKHA EJ = IECA
                 E=CA
         −F      6DA EFKJ EI = JE 2-/ BEA MEJD KJEFA E=CAI HAFHAIAJEC BH=AI B JDA LEA
                 5AJI −f
         6DA togif =@ toppm FHCH=I C JDA JDAH M=O JDAO ?LAHJ BH 2= ' E=CAI J /1. =@ 22
         =@ D=LA  @EIF=O ?=F=>EEJO *JD =??AFJ = FJE −c J IAJ JDA ?AJ BEA@ B JDA HAIKJEC
         BEA 1B JDAHA EI O A EFKJ FE?JKHA togif ?LAHJI JDA E=CA J /1. BH=J 1B JDAHA =HA =O
         files JDKCD EJ ME =IIA>A JDA EJ = =E=JA@ /1. BEA 6DA FJEI ?JH JDEI FH?AII




                                                       
2/                                                                                                  2/



         −lloopcount
               *O @AB=KJ JDA =E=JE ME F BHALAH loopcount IFA?EBEAI DM =O JEAI J F )
               L=KA B AH A=I F BHALAH =@ = AC=JELA L=KA A=I J IJF =BJAH F=OEC JDA
               IAGKA?A ?A
         −dmsec
              *O @AB=KJ JDA E=CAI =HA @EIF=OA@ =I B=IJ =I JDAO ?= >A HA@AHA@ 6DEI FJE IFA?EBEAI
              JDA JEA E EEIA?@I J F=KIA MDEA @EIF=OEC JDA ANJ =A@ file
         Gif JH=I=JAI BEAI JD=J ?J=E = JH=IF=HA?O E@AN >O =JJ=?DEC = =FD= ?D=A J JDA ?
         LAHJA@ E=CA
         Ico @EIF=OI = 9E@MI E? E? BEA 1B  BEA EI IFA?EBEA@ ico HA=@I BH IJ=@=H@ EFKJ 1?
         BEAI ?J=E IAJI B E?I HAFHAIAJA@ >O = E=CA =@ = =I +E?EC JDA HECDJ >KJJ FFI KF
         = AK JD=J AJI OK MHEJA =O E? I E=CA =I = 2= ' E=CA widthxheight.image MHEJA =O
         E? I =I =I = 2= ' E=CA widthxheight.mask H ANEJ 5AA?JEC A B JDA MHEJA AK EJAI
         OEA@I = IECDJ ?KHIH LA JDA IECDJ LAH JDA E? =@ HECDJ ?E? =C=E J MHEJA
         Toico J=AI = EIJ B 2= ' E=CA BEAI H IJ=@=H@ EFKJ =@ ?HA=JAI = IECA E? BEA 6DA =II
         E JDA E? BEA ME >A JDA MDEJA IF=?A E JDA E=CA 6DA E? BEA EI MHEJJA J IJ=@=H@ KJFKJ
SOURCE
     /sys/src/cmd/jpg
SEE ALSO
      page image$
      http://www.w3.org/Graphics/JPEG/itu−t81.pdf
      http://www.w3.org/Graphics/GIF/spec−gif89a.txt
      http://www.w3.org/TR/2003/REC−PNG−20031110
      http://netpbm.sourceforge.net/doc/ppm.html
      http://en.wikipedia.org/wiki/Windows_bitmap
      http://en.wikipedia.org/wiki/Yuv
BUGS
         9HEJEC = =E=JA@ /1. KIEC togif EI = ?KIO K@AHJ=EC




                                                      
*)2                                                                                       *)2




NAME
       >=F    IDM = EIJ B =L=E=>A AO>=H@ =FI =@ IMEJ?D >AJMAA JDA
SYNOPSIS
     kbmap  file 
DESCRIPTION
      Kbmap IDMI = IECA ?K ?IEIJEC B JDA =AI B AO>=H@ =FI BH @EBBAHAJ =FD=>AJI
      =L=E=>A  JDA IOIJA 9EJD  =HCKAJI kbmap ME  BH BEAI E /sys/lib/kbmap
       +E?EC JDA HECDJ KIA >KJJ ME DECDECDJ JDA AJHO =@ BH?A JDA AO>=H@ =FFEC @ABEA@ E
       JDA ?HHAIF@EC BEA J >A?A ?KHHAJ BH JDA IOIJA JOFEC G GKEJI
       Kbmap HAGKEHAI JD=J JDA BEA /dev/kbmap IAHLA@ >O kbmap! ANEIJI =@ EI MHEJ=>A

SOURCE
     /sys/src/cmd/kbmap.c
SEE ALSO
      kbmap!
BUGS
       J = AO>=H@I =F JDA AJEHA IAJ B ?D=H=?JAHI I A D=I J IMEJ?D >=? J JDA @AB=KJ =F
       >ABHA ?D=CEC J =JDAH




                                                  !
1                                                                                                 1




NAME
          E I=O >HA   FHEJ ?=@I J E FH?AIIAI
SYNOPSIS
     kill name ...
          slay name ...
          broke  user 
DESCRIPTION
      Kill FHEJI ?=@I JD=J ME ?=KIA = FH?AIIAI ?=A@ name =@ MA@ >O JDA ?KHHAJ KIAH J >A
      JAHE=JA@ 7IA JDA send ?=@ B rio H FEFA JDA KJFKJ B kill EJ rc J ANA?KJA JDA
      ?=@I
          Kill IKCCAIJI IA@EC = kill JA J JDA FH?AII JDA I=A AII=CA @AELAHA@ J JDA FH?AII I
          ctl BEA IAA proc! EI = IKHAH EB DA=LO D=@A@ E >KJ EI A?AII=HO EB JDA BBA@EC FH?AII EI
          ECHEC JAI 6DA slay ?=@ FHEJI ?=@I J @ JDEI
          Broke FHEJI ?=@I JD=J ME ?=KIA = FH?AIIAI E JDA Broken IJ=JA =@ MA@ >O user >O
          @AB=KJ JDA ?KHHAJ KIAH J C =M=O 9DA = FH?AII @EAI >A?=KIA B = AHHH ?=KCDJ >O JDA IOI
          JA EJ =O ECAH E JDA Broken IJ=JA J =M AN=E=JE MEJD = @A>KCCAH -NA?KJEC JDA ?
          =@I FHEJA@ >O broke AJI JDA IOIJA HA?=E JDA HAIKH?AI KIA@ >O JDA >HA FH?AIIAI
SOURCE
     /rc/bin/kill
     /rc/bin/broke
SEE ALSO
      ps stop notify  proc!




                                                       "
64)+-                                                                                      64)+-




NAME
       JH=?A   EJAHFHAJ AHA IJ=? @KFI
SYNOPSIS
     ktrace  −i  kernel pc sp  link 
DESCRIPTION
      Ktrace JH=I=JAI = DAN=@A?E= AHA IJ=? @KF EJ = IAGKA?A B acid ?=@I J IDM
      JDA FEJI E JDA ?= JH=?A 6DA kernel =HCKAJ IDK@ >A JDA F=JD B JDA AHA >AEC @A>KCCA@
      =@ pc =@ sp =HA JDA 2+ =@ 52 L=KAI CELA E JDA IJ=? @KF .H 125 AHAI JDA ?JAJI B
      JDA link HACEIJAH KIJ =I >A IKFFEA@
       ) IJ=? JH=?A ?IEIJI B = ktrace ?=@ BMA@ >O = IAHEAI B EAI ?J=EEC BEA@I B JDA
       BH location=contents
       ktrace /kernel/path 80105bc1 8048e174
       8048e114=80105ac6 8048e120=80140bb4 8048e134=8010031c
       8048e16c=80137e45 8048e170=80105bc1 8048e178=80137e62
       ...
       6DA JH=?A ?= >A A@EJA@ J FHLE@A JDA ?HHA?J AHA F=JD =@ JDA F=IJA@ EJ = IDA ME@M 1B
       JDA −i FJE EI FHAIAJ ktrace EIJA=@ FHFJI BH JDA ?JAJI B JDA AHO ?=JEI E
       MDE?D EJ EI EJAHAIJA@ JDEI EI KIABK MDA JDA IJ=? JH=?A EI  = I?HAA H=JDAH JD= E = =?DEA
       HA=@=>A BH
SOURCE
     /sys/src/cmd/ktrace.c
SEE ALSO
      acid rdbfs"
BUGS
       9DA AN=EEC = AHA JH=?A HAIKJEC BH = EJAHHKFJ  JF B JDAH EJAHHKFJI O JDA JF
       IJ ?= JH=?A EI FHEJA@




                                                  #
-)                                                                                              -)




NAME
       A= A KA        DAF BE@ AHO A=I
SYNOPSIS
     leak  −abcds   −f binary   −r res   −x width  pid ...
       kmem  kernel 
       umem pid  textfile 
DESCRIPTION
      Leak AN=EAI JDA =A@ FH?AIIAI MDE?D IDK@ >A ID=HEC JDAEH @=J= =@ >II IACAJI BH
      AHO A=I 1J KIAI = =H =@ IMAAFIJOA =CHEJD J @AJAHEA MDE?D =?=JA@ >?I =HA
       CAH HA=?D=>A BH JDA IAJ B HJ FEJAHI 6DA IAJ B HJ FEJAHI EI ?HA=JA@ >O EC
      JDHKCD JDA ID=HA@ >II IACAJ =I MA =I A=?D FH?AII I HACEIJAHI
       7AII @EHA?JA@ JDAHMEIA leak FHEJI BH A=?D >? = EA MEJD IALA IF=?AIAF=H=JA@ BEA@I JDA
       IJHEC block JDA =@@HAII B JDA >? JDA IEA B JDA >? JDA BEHIJ JM MH@I B JDA >? =@
       JDA BK?JE =AI HAFHAIAJA@ >O JDA BEHIJ JM MH@I B JDA >? 7IK=O JDA BEHIJ JM MH@I B
       JDA >? ?J=E JDA =? =@ HA=? J=CI IAA malloc  KIABK BH BE@EC MD =?=JA@ JDA
       A=A@ >?I
       1B JDA −s H JDA −c FJE EI CELA leak ME EIJA=@ FHAIAJ = IAGKA?A B acid ?=@I JD=J
       IDM A=?D A=O =?=JE IEJA 9EJD −s = ?AJ =FFA=HI ANJ J A=?D ?=@ J E@E?=JA
       DM =O IJ >?I MAHA =?=JA@ =J JD=J FEJ E JDA FHCH= 9EJD −c JDA ?AJI =HA
       ANJA@A@ J E@E?=JA =I JDA JJ= K>AH B >OJAI IJ =J JD=J FEJ E JDA FHCH= =@ = =@@E
       JE= ?AJ EA CELAI JDA LAH= JJ= K>AH B >OJAI
       1B JDA −a FJE EI CELA leak ME FHEJ EBH=JE =I @A?HE>A@ =>LA >KJ BH = =?=JA@ >?I
       J O A=A@ AI 1B JDA −d FJE EI CELA leak ME FHEJ EBH=JE =I @A?HE>A@ =>LA >KJ
       BH = BHAA >?I EA JDIA BHAA@ H JDIA JD=J =HA J OAJ E KIA BH=CAJ=JE 6DA −a =@
       −d FJEI ?= >A ?>EA@
       1B JDA −b FJE EI CELA leak ME FHEJ = 2= ' E=CA BEA CH=FDE?=O IK=HEEC JDA AHO
       =HA=I 1 JDA E=CA A=?D FENA HAFHAIAJI res @AB=KJ & >OJAI 6DA ?H ?@A EI
       dark blue    +FAJAO =?=JA@
       bright blue +J=EI =? DA=@AHI
       bright red   +J=EI =? DA=@AHI BH A=A@ AHO
       dark red     +J=EI A=A@ AHO
       yellow       +FAJAO BHAA
       white        2=@@EC J BE KJ JDA E=CA 6DA >HECDJ FENAI HAFHAIAJEC DA=@AHI DAF E ?KJEC
                    JDA K>AH B >?I =CEBOEC JDA E=CAI MEJD lens EI BJA KIABK
       1B CELA = =A H=JDAH JD= = EIJ B FH?AII E@I leak A?DAI >=? = ?=@EA MEJD FH?AII
       E@I B ALAHO FH?AII MEJD JD=J =A
       6DA −f FJE IFA?EBEAI = >E=HO J C  JDA acid ?=@EA KIA@ J EIFA?J JDA FH?AIIAI
       =@ EI O A?AII=HO MDA EIFA?JEC FH?AIIAI IJ=HJA@ BH IJHEFFA@ >E=HEAI
       Umem FHEJI = IK=HO B = =?=JA@ >?I E JDA FH?AII MEJD E@ pid -=?D EA B JDA IK
       =HO CELAI JDA ?KJ =@ JJ= IEA B >?I =?=JA@ =J = =?=JE FEJ 6DA EIJ EI IHJA@ >O
       ?KJ E @A?HA=IEC H@AH Umem FHEJI IK=HEAI = =?=JEI J KIJ AHO A=I >KJ EJ
       EI B=IJAH =@ HAGKEHAI AII AHO JD= leak .
       Kmem EI EA umem >KJ FHEJI = IK=HO BH JDA HKEC AHA
EXAMPLES
     EIJ IJ >?I E 8.out 6DEI @AFA@I  JDA B=?J JD=J JDAHA EI O ?A EIJ=?A B 8.out HKEC
     EB JDAHA MAHA HA JDA KJFKJ B leak −s 8.out MK@ AA@ A@EJEC >ABHA IA@EC J JDA
     IDA
                % leak −s 8.out
                leak −s 229 230
                % leak −s 8.out | rc



                                                    $
-)                                                                                        -)



              src(0x0000bf1b); // 64
              src(0x000016f5); // 7
              src(0x0000a988); // 7
              %
       8EAM JDA AHO KI=CA CH=FDE? BH JDA ME@M IOIJA
              % leak −b rio | rc | page
       EIJ JDA JF =?=JE FEJI E JDA AHA BEHIJ >O ?KJ =@ JDA >O JJ= IEA
              % kmem | sed 10q
              % kmem | sort −nr +1 | sed 10q
SOURCE
     /sys/lib/acid/leak
     /sys/src/cmd/aux/acidleak.c
     /rc/bin/leak
     /rc/bin/kmem
     /rc/bin/umem
SEE ALSO
      getcallerpc  setmalloctag E malloc 
BUGS
       Leak =@ kmem @AFA@  JDA EJAH= IJHK?JKHA B JDA E>? F AHO =?=JH IAA pool 
       5E?A JDA )51251: ALEHAJ KIAI = @EBBAHAJ =?=JH leak ME J MH  )2- FHCH=I
       Leak EI J IFAA@O =@ acidleak ?= ?IKA HA AHO JD= JDA FH?AIIAI >AEC AN=EA@
       6DAIA ?=@I HAGKEHA /sys/src/libc/port/pool.acid J >A FHAIAJ =@ CAAH=JA@
       BH pool.c




                                                     %
-5                                                                                           -5




NAME
       AI   EJAH=?JELA I?HAA =CEBEAH
SYNOPSIS
     lens
DESCRIPTION
      Lens FHAIAJI = =CEBEA@ LEAM E EJI ME@M B = =H>EJH=HO =HA=  JDA I?HAA 6DA @AB=KJ =C
      EBE?=JE EI " IDMEC A=?D FENA =I = " " FENA >? E lens I ME@M 6DEI =O >A ?D=CA@ >O
      JOFEC = @ECEJ  JDA AO>=H@ MEJD 0 IJ=@EC BH  H >O KIEC JDA + =@ − AOI J E?HA=IA H
      @A?HA=IA JDA =CEBE?=JE >O A KEJ 6DA MAH EEJ EI  JDA KFFAH $
       6DA EJAHB=?A J E@E?=JA MD=J =HA= J =CEBO EI @E?J=JA@ >O JDA KIA KJEFANEC HKAI B
       rio 5J=HJ >O FHAIIEC KIA >KJJ  E JDA lens ME@M =@ @H=CCEC MEJD JDA >KJJ FHAIIA@
       J JDA ?AJAH B JDA =HA= J =CEBO Lens ME KF@=JA JDA @EIF=O =I JDA KIA LAI 4AA=IEC
       JDA >KJJ BHAAAI JDA lens @EIF=O 6DA =CEBEA@ LEAM EI IJ=JE? = I=FIDJ J = LEA >KJ
       JOFEC = IF=?A H . AO E JDA lens ME@M ME HABHAID JDA @EIF=O =I ME ?D=CEC JDA =CEBE?=
       JE
       6 =A ?KJEC FENAI A=IEAH JOFEC = g JCCAI MDAJDAH = ?DA?AH>=H@ CHE@ EI EFIA@  JDA
       =CEBEA@ =HA=
       *KJJ ! >HECI KF = AK B =?JEI
SOURCE
     /sys/src/cmd/lens.c
BUGS
       6DAHA IDK@ >A = A=IEAH M=O J E@E?=JA MD=J J =CEBO




                                                   &
-:                                                                                              -:




NAME
         AN   CAAH=JH B ANE?= ==OIEI FHCH=I
SYNOPSIS
     lex  −tvn9   file ... 
DESCRIPTION
      Lex CAAH=JAI FHCH=I J >A KIA@ E IEFA ANE?= ==OIEI B JANJ 6DA EFKJ files IJ=@=H@
      EFKJ @AB=KJ ?J=E HACK=H ANFHAIIEI J >A IA=H?DA@ BH =@ =?JEI MHEJJA E + J >A ANA
      ?KJA@ MDA ANFHAIIEI =HA BK@
         ) + IKH?A FHCH= lex.yy.c EI CAAH=JA@ 6DEI FHCH= MDA HK ?FEAI KHA?CEA@ FH
         JEI B JDA EFKJ J JDA KJFKJ =@ ANA?KJAI JDA =II?E=JA@ + =?JE BH A=?D HACK=H ANFHAIIE
         JD=J EI HA?CEA@
         6DA FJEI D=LA JDA BMEC A=ECI
         −t      2=?A JDA HAIKJ  JDA IJ=@=H@ KJFKJ EIJA=@ B E BEA lex.yy.c
         −v      2HEJ = AEA IK=HO B IJ=JEIJE?I B JDA CAAH=JA@ ==OAH
         −n      FFIEJA B −v −n EI @AB=KJ
         −9      )@@I ?@A J >A =>A J ?FEA JDHKCD JDA =JELA + ?FEAHI
EXAMPLES
     6DEI FHCH= ?LAHJI KFFAH ?=IA J MAH HALAI >=I =J JDA A@ B EAI =@ HAF=?AI KJE
     FA >=I >O IECA >=I
         %%
         [A−Z]     putchar(yytext[0]+’a’−’A’);
         [ ]+$
         [ ]+ putchar(’ ’);
FILES
         lex.yy.c                          KJFKJ
         /sys/lib/lex/ncform               JAF=JA
SEE ALSO
      yacc sed
       - AI =@ - 5?DE@J -: ANE?= )=OAH /AAH=JH  Unix Research System Programmer’s
      Manual, 6AJD -@EJE 8KA 
SOURCE
     /sys/src/cmd/lex
BUGS
         +=J D=@A 76.
         6DA =IJAHE@ J E JDEI @EI=KH EI IJE E H>EJ




                                                         '
+                                                                                          +




NAME
       ?   HK = ?=@ K@AH ?
SYNOPSIS
     lock  −w  lockfile  command  argument   
DESCRIPTION
      Lock HKI command @AB=KJ rc MEJD arguments MDEA D@EC lockfile FA =@ LAHMHEJEC =J
      A=IJ A >OJA A=?D EKJA J AAF JDA AN?KIELA=??AII ? =ELA 1B lockfile @AI J =HA=@O D=LA
      JDA AN?KIELA=??AII >EJ IAJ E EJI @A JDA AN?KIELA=??AII >EJI =HA IAJ E EJI @A =@
      qid.type
       7@AH −w lock M=EJI BH AN?KIELA =??AII J lockfile EIJA=@ B KIJ JHOEC ?A
       Lock IAJI /env/prompt J ?J=E JDA =A B JDA ? BEA
EXAMPLES
     *KE@ = replica @=J=>=IA MDEA FHALAJEC ?EIEI MEJD JDAH ??KHHA?AI
              cd /sys/lib/dist
              lock scan.lock replica/scan $dist/sources.replica
SOURCE
     /sys/src/cmd/lock.c
SEE ALSO
      intro# stat#




                                                     
                                                                                                 




NAME
           BE@ EAI E = IHJA@ EIJ
SYNOPSIS
     look  −dfnixtc   string   file 
DESCRIPTION
      Look ?IKJI = IHJA@ file =@ FHEJI = EAI JD=J >ACE MEJD string 1J KIAI >E=HO IA=H?D
        6DA BMEC FJEI =HA HA?CEA@ FJEI dfnt =BBA?J ?F=HEII =I E sort
        −i     1JAH=?JELA 6DAHA EI  string =HCKAJ EIJA=@ look J=AI EAI BH JDA IJ=@=H@ EFKJ
               =I IJHECI J >A A@ KF
        −x     -N=?J 2HEJ O EAI B JDA BEA MDIA AO =J?DAI string AN=?JO
        −d      ,EHA?JHO H@AH O AJJAHI @ECEJI J=>I =@ >=I F=HJE?EF=JA E ?F=HEII
        −f     .@ 7FFAH ?=IA AJJAHI ?F=HA AGK= J MAH ?=IA
        −n     KAHE? ?F=HEI MEJD EEJE= IJHEC B @ECEJI FJE= EKI IEC =@ FJE= @A?E=
               FEJ
        −tc +D=H=?JAH c JAHE=JAI JDA IHJ AO E JDA file *O @AB=KJ J=> JAHE=JAI JDA AO 1B c EI
              EIIEC JDA AJEHA EA ?FHEIAI JDA AO
        1B  file EI IFA?EBEA@ /lib/words EI =IIKA@ MEJD ?=JEC IAGKA?A df
FILES
        /lib/words
SOURCE
     /sys/src/cmd/look.c
SEE ALSO
      sort grep
DIAGNOSTICS
     6DA ANEJ IJ=JKI EI not found EB  =J?D EI BK@ =@               no dictionary          EB file H JDA
     @AB=KJ @E?JE=HO ?=J >A FAA@




                                                      
2                                                                                                 2




NAME
        F   FHEJAH KJFKJ
SYNOPSIS
     lp  option ...   file ... 
DESCRIPTION
      Lp EI = CAAH=EA@ KJFKJ FHEJEC IAHLE?A 1J ?= >A KIA@ J GKAKA BEAI BH FHEJEC ?DA? =
      GKAKA H E >I E = GKAKA 6DA FJEI =HA
        −d dest 5AA?J JDA @AIJE=JE FHEJAH 1B dest EI ? EIJ JDA ?KHHAJO =L=E=>A FHEJAHI 1 JDA
                =>IA?A B −d JDA @AIJE=JE EI J=A BH JDA ALEHAJ L=HE=>A LPDEST ,AIJE
                =JE stdout EI JDA IJ=@=H@ KJFKJ ,AIJE=JE safari EI /dev/lpt1data EA
                FHEJAH FHJ  = !&$ =?DEA =IIKA@ J >A ?A?JA@ J = 2IJ5?HEFJ FHEJAH ,AIJE
                =JEI hpdeskjet =@ bjc240l =HA =I /dev/lpt1data >KJ =IIKA@ J >A ?
                A?JA@ J = 02 ,AIAJ $% H += *+ " Lp ?= FHEJ J =O FHEJAH IKFFHJA@ >O
                /DIJI?HEFJ KIEC IOJ=N gs!device MDAHA device EI = /DIJI?HEFJ KJFKJ @ALE?A 5AA
                gs =@ JDA canonbjc240l AJHO E /sys/lib/lp/devices
        −k      E JDA >I CELA =I IK>IAGKAJ =HCKAJI EIJA=@ B BEA =AI BH JDA CELA @AIJE
                =JE
        −p proc 6DA CELA FH?AIIH EI ELA@ 6DA @AB=KJ FH?AIIH EI generic MDE?D JHEAI J @
                JDA HECDJ JDEC BH HACK=H JANJ troff KJFKJ H tex KJFKJ 1B  FH?AIIEC EI
                @AIEHA@ noproc =O >A IFA?EBEA@
        −q      2HEJ JDA GKAKA BH JDA CELA @AIJE=JE .H IA @ALE?AI E?K@A FHEJAH IJ=JKI
        −R      5JFI =@ HAIJ=HJI JDA FHEJAH @=A 1B JDA FHEJAH EI MA@CA@ EJ EI BJA KIABK J ?O?A
                JDA FMAH  JDA FHEJAH >ABHA HKEC JDEI ?=@
        6DA HA=EEC FJEI =O >A KIA@ J =BBA?J JDA KJFKJ =J = CELA @ALE?A 6DAIA FJEI =O J
        >A =FFE?=>A J = @ALE?AI
        −c n        2HEJ n ?FEAI
        −f font     5AJ JDA BJ @AB=KJ CW.11
        −H          5KFFHAII FHEJEC B DA=@AH F=CA
        −i n        5AA?J F=FAH EFKJ JH=O n =O >A = K>AH ' JDA MH@ man BH JDA =K= BAA@ IJ
                    =@H simplex H duplex J CAJ IECA H @K>A IE@A@ KJFKJ KJEFA EFKJ JH=O
                    FJEI =O >A IFA?EBEA@ EB JDAO =HA IAF=H=JA@ >O ?=I
        −l   n      5AJ JDA K>AH B EAI FAH F=CA J n
        −L          2HEJ F=CAI E =@I?=FA @A EA JKHA@ ' @ACHAAI
        −m   v      5AJ =CEBE?=JE J v
        −n   n      2HEJ n CE?= F=CAI FAH FDOIE?= F=CA
        −o   list   2HEJ O F=CAI MDIA F=CA K>AHI =FFA=H E JDA ?=IAF=H=JA@ list B K>AHI
                    =@ H=CAI ) H=CA n−m A=I F=CAI n JDHKCD m = H=CA −n A=I BH JDA >ACE
                    EC J F=CA n = H=CA n− A=I BH F=CA n J JDA A@
        −r          4ALAHIA JDA H@AH B F=CA FHEJEC
        −x v        5AJ JDA DHEJ= BBIAJ B JDA FHEJ E=CA A=IKHA@ E E?DAI
        −y v        5AJ JDA LAHJE?= BBIAJ B JDA FHEJ E=CA A=IKHA@ E E?DAI
EXAMPLES
     eqn paper | troff −ms | lp −dsafari
          6OFAIAJ =@ FHEJ = F=FAH ?J=EEC AGK=JEI
        pr −l100 file | lp −l100 −fCW.8
             2HEJ = BEA E = I= BJ =J  EAI FAH F=CA
        lp −dstdout /dev/windows/3/window > doc.ps
             +LAHJ = E=CA J = FIJI?HEFJ BEA
SOURCE
     /rc/bin/lp
     /sys/src/cmd/lp
SEE ALSO
      lp&
      2 /E? ) /KE@A J JDA F 2HEJAH 5FAH 



                                                    
2                                                                              2



BUGS
        J = FJEI MH MEJD = KJFKJ @ALE?AI )O KIAH ?= E =O >




                                                      !
5                                                                                                           5




NAME
        I ?     EIJ ?JAJI B @EHA?JHO
SYNOPSIS
     ls  −dlmnpqrstuFQT  name ...
        lc  −dlmnqrstuFQT  name ...
DESCRIPTION
      .H A=?D @EHA?JHO =HCKAJ ls EIJI JDA ?JAJI B JDA @EHA?JHO BH A=?D BEA =HCKAJ ls
      HAFA=JI EJI =A =@ =O JDAH EBH=JE HAGKAIJA@ 9DA  =HCKAJ EI CELA JDA ?KHHAJ
      @EHA?JHO EI EIJA@ *O @AB=KJ JDA KJFKJ EI IHJA@ =FD=>AJE?=O >O =A
        Lc EI JDA I=A =I ls >KJ IAJI JDA −p FJE =@ FEFAI JDA KJFKJ JDHKCD mc
        6DAHA =HA = K>AH B FJEI
        −d          1B =HCKAJ EI = @EHA?JHO EIJ EJ J EJI ?JAJI
        −l          EIJ E C BH=J CELEC @A IAA >AM BEA IOIJA JOFA AC BH @ALE?AI JDA # ?@A
                    AJJAH JD=J =AI EJ IAA intro! JDA EIJ=?A H IK>@ALE?A K>AH MAH CHKF IEA E
                    >OJAI =@ JEA B =IJ @EBE?=JE BH A=?D BEA
        −m          EIJ JDA =A B JDA KIAH MD IJ HA?AJO @EBEA@ JDA BEA
        −n          , J IHJ JDA EIJEC
        −p          2HEJ O JDA BE= F=JD AAAJ B A=?D BEA =A
        −q          EIJ JDA qid IAA stat  B A=?D BEA JDA FHEJA@ BEA@I =HA E JDA H@AH F=JD LAHIE =@
                    JOFA
        −r          4ALAHIA JDA H@AH B IHJ
        −s          /ELA IEA E >OJAI BH A=?D AJHO
        −t          5HJ >O JEA @EBEA@ =JAIJ BEHIJ EIJA=@ B >O =A
        −u          7@AH −t IHJ >O JEA B =IJ =??AII K@AH −l FHEJ JEA B =IJ =??AII
        −F          )@@ JDA ?D=H=?JAH / =BJAH = @EHA?JHO =AI =@ JDA ?D=H=?JAH * =BJAH = ANA?KJ=>A BEAI
        −T          2HEJ JDA ?D=H=?JAH t >ABHA A=?D BEA EB EJ D=I JDA JAFH=HO B=C IAJ =@ − JDAHMEIA
        −Q          *O @AB=KJ FHEJA@ BEA =AI =HA GKJA@ EB JDAO ?J=E ?D=H=?JAHI IFA?E= J rc 6DA −Q
                    B=C @EI=>AI JDEI >AD=LEH
        6DA @A FHEJA@ K@AH JDA −l FJE ?J=EI  ?D=H=?JAHI EJAHFHAJA@ =I BMI JDA BEHIJ
        ?D=H=?JAH EI
        d           EB JDA AJHO EI = @EHA?JHO
        a           EB JDA AJHO EI = =FFA@O BEA
        −           EB JDA AJHO EI = F=E BEA
        6DA ANJ AJJAH EI l EB JDA BEA EI AN?KIELA =??AII A MHEJAH H HA=@AH =J = JEA
        6DA =IJ ' ?D=H=?JAHI =HA EJAHFHAJA@ =I JDHAA IAJI B JDHAA >EJI A=?D 6DA BEHIJ IAJ HABAHI J MAH
        FAHEIIEI JDA ANJ J FAHEIIEI J JDAHI E JDA I=A KIAHCHKF =@ JDA =IJ J = JDAHI
        9EJDE A=?D IAJ JDA JDHAA ?D=H=?JAHI E@E?=JA FAHEIIE HAIFA?JELAO J HA=@ J MHEJA H J ANA
        ?KJA JDA BEA =I = FHCH= .H = @EHA?JHO ANA?KJA FAHEIIE EI EJAHFHAJA@ J A= FAHEIIE
        J IA=H?D JDA @EHA?JHO BH = IFA?EBEA@ BEA 6DA FAHEIIEI =HA E@E?=JA@ =I BMI
        r    EB   JDA BEA EI HA=@=>A
        w    EB   JDA BEA EI MHEJ=>A
        x    EB   JDA BEA EI ANA?KJ=>A
        −    EB   A B JDA =>LA FAHEIIEI EI CH=JA@
SOURCE
     /sys/src/cmd/ls.c
     /rc/bin/lc




                                                             "
5                        5



SEE ALSO
      stat  mc




                        #
)1                                                                                              )1




NAME
        =E CBEIDEC   =E =@ =E>NAI
SYNOPSIS
     mail  arg ... 
        go.fishing
DESCRIPTION
      =E EI = IDA I?HEFJ JD=J ELAI nedmail JDA =E HA=@AH MDA  HA?EFEAJI =FFA=H  JDA
      ?=@ EA =@ marshal JDA =E FHAF=HAH JDAHMEIA ) ?=@ EA FJEI =HA F=IIA@
      JDHKCD 5AA JDA = F=CAI BH JDIA JM ?=@I BH HA @AJ=EI
        1?EC =E BH = KIAH username EI FKJ E JDA BEA /mail/box/username/mbox KAII AEJDAH
        JDA BEA /mail/box/username/forward H /mail/box/username/pipeto ANEIJI 6DA
        =E>N KIJ D=LA =FFA@O =@ AN?KIELA=??AII @A IAA chmod ) KIAH KIJ ?HA=JA
        DEI H DAH M =E>N KIEC JDA −c FJE B nedmail =E>NAI =HA ?HA=JA@ MHEJ=>A
        =FFA@O >KJ J HA=@=>A >O JDAHI
        1B JDA BEA /mail/box/username/forward ANEIJI =@ EI HA=@=>A >O ALAHOA E?EC =E
        ME >A BHM=H@A@ J JDA =@@HAIIAI ?J=EA@ E JDA BEHIJ EA B JDA BEA 6DA BEA =O ?J=E KJE
        FA =@@HAIIAI .HM=H@EC FI =HA ?=KCDJ =@ HAILA@ >O ?= @AELAHO
        1B JDA BEA /mail/box/username/pipeto ANEIJI =@ EI HA=@=>A =@ ANA?KJ=>A >O ALAHOA EJ
        ME >A HK BH A=?D E?EC AII=CA BH JDA KIAH 6DA AII=CA ME >A FEFA@ J EJ H=JDAH JD=
        =FFA@A@ J DEIDAH =E >N 6DA BEA EI HK =I KIAH none 1JI JM =HCKAJI =HA JDA MEJD =HCK
        AJI B JDA @AIJE=JE =@@HAII AC local!gremlin =@ JDA KIAH I =E >N F=JD AC
        /mail/box/gremlin/mbox
  Auto−answer
     6 KIA mail =I = =IMAHEC =?DEA MDEA OK =HA =M=O HK go.fishing MDE?D ME ?HA=JA
     /mail/box/$user/gone.fishing =I = B=C BH pipeto FH?AIIEC =@ JHK?=JA
     /mail/box/$user/gone.addrs          )O     ANEIJEC   pipeto       BEA   JD=J     KIAI
     /mail/lib/pipeto.lib ME ELA JDA gone.fishing =?DEAHO MDA EJ ?=I spool H
     spool−tagged−spam
        1B /mail/box/$user/gone.msg ANEIJI EJ ME >A IAJ KIJ ?A J ALAHOA MD IA@I OK
        =E JD=J EIJI OKH =@@HAII E = To H Cc DA=@AH EB J /mail/lib/gone.msg ME >A IAJ
        7F OKH HAJKH HALA /mail/box/$user/gone.fishing J IJF =KJ=JE? HAIFIAI
FILES
        /sys/log/mail                                =E C BEA
        /mail/box/*                                  =E @EHA?JHEAI
        /mail/box/*/mbox                             =E>N BEAI
        /mail/box/*/forward                          BHM=H@EC =@@HAIIAI
        /mail/box/*/pipeto                           =E BEJAH
        /mail/box/*/L.reading                        KJK= AN?KIE ? BH KJEFA >N HA=@AHI
        /mail/box/*/L.mbox                           KJK= AN?KIE ? BH =JAHEC >N
        /lib/face/48x48x?                            @EHA?JHEAI B E?I BH seemail
        /mail/lib/pipeto.lib                         DAFAH BK?JEI BH FEFAJ BEAI
        /mail/lib/gone.msg                           @AB=KJ L=?=JE AII=CA
        /mail/lib/gone.fishing                       =KJHAIF@AH =I pipeto I?HEFJ
        /mail/box/$user/gone.fishing                 B=C J =?JELA CA FH?AIIEC
        /mail/box/$user/gone.addrs                   EIJ B IA@AHI =IMAHA@ >O gone.fishing
SOURCE
     /rc/bin/mail
     /rc/bin/go.fishing
SEE ALSO
      aliasmail& faces filter marshal mlmgr nedmail qer& rewrite$ send&
      smtp& upasfs"




                                                      $
)1+,                                                                                    )1+,




NAME
       =E?@   =E JDA KJFKJ B = B=EA@ ?=@
SYNOPSIS
     mailcmd  −m addr  command line
DESCRIPTION
      Mailcmd HKI JDA ?=@ EA KIEC rc 1B JDA ?=@ ANEJI MEJD = AHHH IJ=JKI mailcmd
      =EI JDA ?=@ I KJFKJ J JDA =A@ =@@HAIIAI >O @AB=KJ JDA ?KHHAJ KIAH
       Mailcmd EI JOFE?=O KIA@ J HK =KJ=JE? I?HEFJI IK?D =I JDIA IJ=HJA@ >O cron&
SOURCE
     /rc/bin/mailcmd
SEE ALSO
      cron&




                                                    %
)                                                                                              )




NAME
        = = IEC    FHEJ H BE@ F=CAI B JDEI =K=
SYNOPSIS
     man  −bnpPStw   section ...  title ...
        lookman key ...
        sig function ...
DESCRIPTION
      Man ?=JAI =@ FHEJI F=CAI B JDEI =K= =A@ title E JDA IFA?EBEA@ sections Title EI CELA E
      MAH ?=IA -=?D section EI = K>AH F=CAI =HA@  5 BH AN=FA >AC J ?D=FJAH  1B 
      section EI IFA?EBEA@ F=CAI E = IA?JEI =HA FHEJA@ )O =A BH JDA )- IA?JE =J JDA JF
      B JDA F=CA ME IAHLA =I = title
        6DA FJEI =HA
        −n     ,AB=KJ 2HEJ JDA F=CAI  JDA IJ=@=H@ KJFKJ KIEC nroff
        −b     2HEJ JDA F=CAI KIEC nroff =@ IA@ JDA J plumber" BH @EIF=O E JDA A@EJH
        −p     4K proof  JDA IFA?EBEA@ = F=CAI
        −P     4K page  JDA IFA?EBEA@ = F=CAI
        −S     , J IA=H?D JDA =K= E@E?AI BH JDA =AI O FHEJ F=CAI MDIA BEA =AI =J?D
               JDA =AI
        −t     4K troff =@ IA@ EJI KJFKJ J IJ=@=H@ KJFKJ
        −w     2HEJ JDA =AI B JDA = F=CA IKH?A BEAI
        Lookman FHEJI JDA =AI B = =K= IA?JEI JD=J ?J=E = B JDA key MH@I CELA  JDA
        ?=@ EA
        Sig FHEJI JDA IEC=JKHA EA + @ABEEJE B JDA functionI CELA  JDA ?=@ EA
FILES
        /sys/man/?/*
             troff IKH?A BH =K= JDEI F=CA EI /sys/man/1/man
        /sys/man/?/INDEX
             E@E?AI IA=H?DA@ J BE@ F=CAI ?HHAIF@EC J JEJAI
        /sys/lib/man/secindex
             ?=@ J =A = E@AN BH = CELA IA?JE
        /sys/lib/man/lookman/index
             E@AN BH lookman
SOURCE
     /rc/bin/man
     /rc/bin/lookman
SEE ALSO
      page proof
BUGS
        6DA =K= M=I EJA@A@ J >A JOFAIAJ IA @AJ=E EI I=?HEBE?A@  JANJ JAHE=I
        6DAHA EI  =KJ=JE? A?D=EI J AAF JDA E@E?AI KF J @=JA
        -N?AFJ BH IFA?E= ?=IAI man @AI J HA?CEA JDECI JD=J IDK@ >A HK JDHKCD tbl =@H eqn




                                                     &
)450)                                                                                      )450)




NAME
        =HID=   BH=JJEC =@ IA@EC =E
SYNOPSIS
     upas/marshal  −[aA] attachment   −C copyaddr   −nrx#   −R reply−msg   −s subject 
      −t mime−type   mailaddr ... 
DESCRIPTION
      Marshal >KE@I = =E AII=CA BH IJ=@=H@ EFKJ =@ F=IIAI EJ EB JDA >@O EI AFJO BH
      JH=IEIIE H @AELAHO J /mail/box/username/pipefrom EB EJ ANEIJI JDAHMEIA J
      /bin/upas/send 6DA AII=CA BH=J EI >JD 4.+ &              =@ 1- ?BH=J I marshal
      =@@I =O HAGKEHA@ DA=@AHI J =HA=@O E JDA AII=CA FHABENA@ >O JDA ?JAJI B
      /mail/box/username/headers 6DEI =MI JDA =@@EJE B FAHI= DA=@AHI EA From:
      EAI MEJD = BK =A H = @EBBAHAJ HAJKH =@@HAII +=@ EA FJEI @EHA?J =HID= J =@@ =
      IK>A?J EA =@ =FFA@ =JJ=?DAJI 6DA =HCKAJI J marshal =HA JDA =@@HAIIAI B JDA HA?EFE
      AJI
        9DA HKEC E = rio ME@M marshal =KJ=JE?=O FKJI JDA ME@M EJ D@ @A IAA
        rio JDEI A=I JD=J JDA AII=CA ?= >A A@EJA@ BHAAO >A?=KIA JDEC ME >A IAJ J marshal
        KJE JDA -5+ AO EI DEJ J ANEJ D@ @A
        6DA FJEI =HA
        −afile     @EHA?JI marshal J =FFA@ file =I = EA =JJ=?DAJ 7AII ANFE?EJO IFA?EBEA@ >O
                   JDA −t FJE JDA JOFA B JDA =JJ=?DAJ EI @AJAHEA@ >O HKEC JDA file ?
                   =@
        −Afile     EI EA −a >KJ JDA AII=CA @EIFIEJE EI =HA@ =I inline @EHA?JEC =O =E HA=@AH
                   J @EIF=O JDA =JJ=?DAJ EB EJ ?= MDA JDA =E AII=CA EI HA=@
        −Ccopyaddr =@@I = Cc: DA=@AH MEJD copyaddr =@ =I =@@I copyaddr =I = HA?EFEAJ
        −n         EJAJE=O  IJ=@=H@ EFKJ
        −#xr       =HA = F=IIA@ =I ?=@ EA FJEI J JDA send JD=J marshal ELAI
        −Rreplymsg JAI =HID= MD=J AII=CA JDEI A EI E HAFO J Replymsg EI = upasfs" @EHA?JHO
                   ?J=EEC JDA AII=CA Marshal KIAI =O AII=CA E@ E JDEI AII=CA E EJI
                   In−Reply−To           BEA@       1J    =I     F=IIAI      JDA    @EHA?JHO      J
                   /mail/box/username/pipefrom E JDA replymsg ALEHAJ L=HE=>A
                   6DKI pipefrom ?= =JAH JDA AII=CA J IADM =J?D JDA HAFO J JDA AII=CA
                   EJ EI HAFOEC J
        −ssubject  =@@I = Subject: DA=@AH EA J JDA AII=CA EB A @AI J =HA=@O ANEIJ
        −ttype     IAJI JDA ?JAJ JOFA BH JDA =JJ=?DAJI BH = IK>IAGKAJ −a =@ −A FJEI
        Marshal =I ANF=@I =O KIAH =E =E=IAI ?J=EA@ E /mail/box/username/names. 6DA
        BH=J B JDA =E=I BEA EI JDA I=A =I JD=J BH IOIJA =E=IAI IAA aliasmail&
        Marshal KIAI JDA CE =A =I JDA HAFO =@@HAII 6DEI ?= >A LAHHE@A KIEC JDA ALEHAJ
        L=HE=>A upasname 1JI L=KA ME >A?A >JD JDA ALAFA =@ From: =E>N =A .H
        AN=FA
                 upasname=natasha@kremvax.com upas/mail boris@squirrel.com
FILES
        /mail/box/*/dead.letter
SOURCE
     /sys/src/cmd/upas/marshal
SEE ALSO
      aliasmail& faces filter mail mlmgr nedmail qer& rewrite$ send& smtp&
      upasfs"




                                                     '
+                                                                                          +




NAME
        ?   KJE?K FHEJ
SYNOPSIS
     mc  −   −N   file ... 
DESCRIPTION
      Mc IFEJI JDA EFKJ EJ =I =O ?KI =I ME BEJ E N FHEJ FIEJEI 1B HK E = rio H
      acme ME@M JDA @AB=KJ N EI JDA K>AH B >=I JD=J ME BEJ =?HII JDA ME@M JDAHMEIA
      JDA @AB=KJ N EI & 7@AH FJE − A=?D EFKJ EA A@EC E = ? : EI FHEJA@ IAF=H=JAO
SOURCE
     /sys/src/cmd/mc.c
SEE ALSO
      rio acme acme" pr lc E ls




                                                     !
                                                                                                   




NAME
         A>AH=A       =EJ=E =A HA=JA@ BEAI
SYNOPSIS
     mk  −f mkfile    option ...   target ... 
        membername aggregate ...
DESCRIPTION
      Mk KIAI JDA @AFA@A?O HKAI IFA?EBEA@ E mkfile J ?JH JDA KF@=JA KIK=O >O ?FE=JE B
      targets KIK=O BEAI BH JDA IKH?A BEAI KF MDE?D JDAO @AFA@ 6DA mkfile @AB=KJ mkfile
      ?J=EI = rule BH A=?D J=HCAJ JD=J E@AJEBEAI JDA BEAI =@ JDAH J=HCAJI KF MDE?D EJ @AFA@I =@
      = rc I?HEFJ = recipe J KF@=JA JDA J=HCAJ 6DA I?HEFJ EI HK EB JDA J=HCAJ @AI J ANEIJ H EB EJ
      EI @AH JD= =O B JDA BEAI EJ @AFA@I  Mkfile =O =I ?J=E meta−rules JD=J @ABEA =?JEI
      BH KF@=JEC EFE?EJ J=HCAJI 1B  target EI IFA?EBEA@ JDA J=HCAJ B JDA BEHIJ HKA J AJ=HKA E
      mkfile EI KF@=JA@
        6DA ALEHAJ L=HE=>A $NPROC @AJAHEAI DM =O J=HCAJI =O >A KF@=JA@ IEKJ=AKIO
        2= ' IAJI $NPROC =KJ=JE?=O J JDA K>AH B +27I  JDA ?KHHAJ =?DEA
        FJEI =HA
        −a        )IIKA = J=HCAJI J >A KJ B @=JA 6DKI ALAHOJDEC EI KF@=JA@
        −degp   2H@K?A @A>KCCEC KJFKJ p EI BH F=HIEC g BH CH=FD >KE@EC e BH ANA?KJE
        −e        -NF=E MDO A=?D J=HCAJ EI =@A
        −i        .H?A =O EIIEC EJAHA@E=JA J=HCAJI J >A =@A
        −k        , =I K?D MH =I FIIE>A E JDA B=?A B AHHHI
        −n        2HEJ >KJ @ J ANA?KJA JDA ?=@I AA@A@ J KF@=JA JDA J=HCAJI
        −s        =A JDA ?=@ EA =HCKAJI IAGKAJE=O H=JDAH JD= E F=H=A
        −t        6K?D KF@=JA JDA @EBEA@ @=JA B BEA J=HCAJI MEJDKJ ANA?KJEC =O HA?EFAI
        −wtarget1,target2,...
                  2HAJA@ JDA @EBO JEA BH A=?D target EI JDA ?KHHAJ JEA KIABK E ?K?JE MEJD
                  −n J A=H MD=J KF@=JAI MK@ >A JHECCAHA@ >O @EBOEC JDA targets
        6DA rc I?HEFJ membername ANJH=?JI A>AH =AI IAA )CCHAC=JAI >AM BH EJI =HCK
        AJI
   The mkfile
      ) mkfile ?IEIJI B assignments @AI?HE>A@ K@AH -LEHAJ  =@ rules ) HKA ?J=EI
      targets =@ = tail ) J=HCAJ EI = EJAH= IJHEC =@ EI H=O = BEA =A 6DA J=E ?J=EI AH H
      HA prerequisites =@ = FJE= recipe MDE?D EI = rc I?HEFJ -=?D EA B JDA HA?EFA KIJ
      >ACE MEJD MDEJA IF=?A ) HKA J=AI JDA BH
               target: prereq1 prereq2
                       rc recipe using prereq1, prereq2 to build target
        9DA JDA HA?EFA EI ANA?KJA@ JDA BEHIJ ?D=H=?JAH  ALAHO EA EI AE@A@
        )BJAH JDA ?  JDA J=HCAJ EA = HKA =O IFA?EBO attributes @AI?HE>A@ >AM
        ) meta−rule D=I = J=HCAJ B JDA BH A%B MDAHA A =@ B =HA FIIE>O AFJO IJHECI ) AJ=HKA
        =?JI =I = HKA BH =O FJAJE= J=HCAJ MDIA =A =J?DAI A%B MEJD % HAF=?A@ >O = =H>EJH=HO
        IJHEC ?=A@ JDA stem 1 EJAHFHAJEC = AJ=HKA JDA IJA EI IK>IJEJKJA@ BH = ??KHHA?AI B %
        E JDA FHAHAGKEIEJA =AI 1 JDA HA?EFA B = AJ=HKA JDA ALEHAJ L=HE=>A $stem ?J=EI
        JDA IJHEC =J?DA@ >O JDA % .H AN=FA = AJ=HKA J ?FEA = + FHCH= KIEC 2c ECDJ
        >A
               %:        %.c
                           2c $stem.c
                           2l −o $stem $stem.2
        AJ=HKAI =O ?J=E = =FAHI=@ & H=JDAH JD= = FAH?AJ IEC % ) % =J?DAI = =NE=
        ACJD IJHEC B =O ?D=H=?JAHI = & =J?DAI = =NE= ACJD IJHEC B =O ?D=H=?JAHI AN?AFJ
        FAHE@ H I=ID
        6DA JANJ B JDA mkfile EI FH?AIIA@ =I BMI EAI >ACEEC MEJD < BMA@ >O = BEA =A =HA
        HAF=?A@ >O JDA ?JAJI B JDA =A@ BEA EAI >ACEEC MEJD <| BMA@ >O = BEA =A =HA



                                                          !
                                                                                                       



        HAF=?A@ >O JDA KJFKJ B JDA ANA?KJE B JDA =A@ BEA *= EAI =@ ?AJI MDE?D HK
        BH KGKJA@ # ?D=H=?JAHI J JDA BMEC AMEA =HA @AAJA@ 6DA ?D=H=?JAH IAGKA?A
        >=?I=IDAMEA EI @AAJA@ I C EAI E mkfile =O >A B@A@ HA?EFA EAI =HA FH
        ?AIIA@ >O IK>IJEJKJEC BH ‘{command} JDA KJFKJ B JDA command MDA HK >O rc 4ABAHA?AI
        J L=HE=>AI =HA HAF=?A@ >O JDA L=HE=>AI L=KAI 5FA?E= ?D=H=?JAHI =O >A GKJA@ KIEC IECA
        GKJAI ’’ =I E rc
        )IIECAJI =@ HKAI =HA @EIJECKEIDA@ >O JDA BEHIJ KGKJA@ ??KHHA?A B : HKA H = =IIEC
        AJ
        ) =JAH HKA =O @EBO H LAHHE@A = ANEIJEC HKA K@AH JDA BMEC ?@EJEI
               1B JDA J=HCAJI B JDA HKAI AN=?JO =J?D =@ A HKA ?J=EI O = FHAHAGKEIEJA ?=KIA
               =@  HA?EFA JDA ?=KIA EI =@@A@ J JDA FHAHAGKEIEJAI B JDA JDAH HKA 1B AEJDAH H >JD
               J=HCAJI =HA LEHJK= JDA HA?EFA EI =M=OI ANA?KJA@
               1B JDA J=HCAJI B JDA HKAI =J?D AN=?JO =@ JDA FHAHAGKEIEJAI @ J =J?D =@ >JD HKAI
               ?J=E HA?EFAI mk HAFHJI = =>ECKKI HA?EFA AHHH
               1B JDA J=HCAJ =@ FHAHAGKEIEJAI B >JD HKAI =J?D AN=?JO JDA IA?@ HKA LAHHE@AI JDA
               BEHIJ
  Environment
      4KAI =O =A KIA B rc ALEHAJ L=HE=>AI ) AC= HABAHA?A B JDA BH $OBJ EI
      ANF=@A@ =I E rc ) HABAHA?A B JDA BH ${name:A%B=C%D} MDAHA A, B, C, D =HA FIIE
      >O AFJO IJHECI D=I JDA L=KA BHA@ >O ANF=@EC $name =@ IK>IJEJKJEC C BH A =@ D BH B
      E A=?D MH@ E $name JD=J =J?DAI F=JJAH A%B
        8=HE=>AI ?= >A IAJ >O =IIECAJI B JDA BH
              var=attr=value
        *=I E JDA value >HA= EJ EJ MH@I =I E rc >KJ MEJDKJ JDA IKHHK@EC F=HAJDAIAI 5K?D
        L=HE=>AI =HA ANFHJA@ J JDA ALEHAJ B HA?EFAI =I JDAO =HA ANA?KJA@ KAII U JDA O AC=
        =JJHE>KJA attr EI FHAIAJ 6DA EEJE= L=KA B = L=HE=>A EI J=A BH E E?HA=IEC H@AH B FHA?A
        @A?A JDA @AB=KJ L=KAI >AM mk’s ALEHAJ JDA mkfiles =@ =O ?=@ EA =IIEC
        AJ =I = =HCKAJ J mk ) L=HE=>A =IIECAJ =HCKAJ LAHHE@AI JDA BEHIJ >KJ J =O IK>
        IAGKAJ =IIECAJ J JD=J L=HE=>A
        6DA L=HE=>A MKFLAGS ?J=EI = JDA FJE =HCKAJI =HCKAJI IJ=HJEC MEJD − H ?J=EEC
        = =@ MKARGS ?J=EI = JDA J=HCAJI E JDA ?= J mk
        1J EI HA?A@A@ JD=J BEAI IJ=HJ MEJD
               </$objtype/mkfile
        J IAJ CC LD AS O YACC =@ MK J L=KAI =FFHFHE=JA J JDA J=HCAJ =H?DEJA?JKHA IAA JDA AN=
        FAI >AM
  Execution
      ,KHEC ANA?KJE mk @AJAHEAI MDE?D J=HCAJI KIJ >A KF@=JA@ =@ E MD=J H@AH J >KE@ JDA
      names IFA?EBEA@  JDA ?=@ EA 1J JDA HKI JDA =II?E=JA@ HA?EFAI
        ) J=HCAJ EI ?IE@AHA@ KF J @=JA EB EJ D=I  FHAHAGKEIEJAI H EB = EJI FHAHAGKEIEJAI =HA KF J @=JA
        =@ EJ EI AMAH JD= = EJI FHAHAGKEIEJAI ?A JDA HA?EFA BH = J=HCAJ D=I ANA?KJA@ JDA J=HCAJ EI
        ?IE@AHA@ KF J @=JA
        6DA @=JA IJ=F KIA@ J @AJAHEA EB = J=HCAJ EI KF J @=JA EI ?FKJA@ @EBBAHAJO BH @EBBAHAJ
        JOFAI B J=HCAJI 1B = J=HCAJ EI virtual JDA J=HCAJ B = HKA MEJD JDA V =JJHE>KJA EJI @=JA IJ=F EI EE
        JE=O AH MDA JDA J=HCAJ EI KF@=JA@ JDA @=JA IJ=F EI IAJ J JDA IJ HA?AJ @=JA IJ=F B EJI
        FHAHAGKEIEJAI JDAHMEIA EB = J=HCAJ @AI J ANEIJ =I = BEA EJI @=JA IJ=F EI IAJ J JDA IJ
        HA?AJ @=JA IJ=F B EJI FHAHAGKEIEJAI H AH EB EJ D=I  FHAHAGKEIEJAI JDAHMEIA JDA J=HCAJ EI
        JDA =A B = BEA =@ JDA J=HCAJ I @=JA IJ=F EI =M=OI JD=J BEA I @EBE?=JE @=JA 6DA @=JA
        IJ=F EI ?FKJA@ MDA JDA J=HCAJ EI AA@A@ E JDA ANA?KJE B = HKA EJ EI J = IJ=JE? L=KA
        ANEIJAJ J=HCAJI JD=J D=LA FHAHAGKEIEJAI =@ =HA JDAIALAI FHAHAGKEIEJAI =HA JHA=JA@ IFA?E=O
        5K?D = J=HCAJ t EI CELA JDA @=JA IJ=F B EJI IJ HA?AJ FHAHAGKEIEJA =@ EB JDEI ?=KIAI = JDA J=H
        CAJI MDE?D D=LA t =I = FHAHAGKEIEJA J >A KF J @=JA t EI ?IE@AHA@ KF J @=JA JDAHMEIA t EI
        =@A E JDA H= B=IDE 6DA −i B=C LAHHE@AI JDEI IFA?E= JHA=JAJ




                                                       !
                                                                                                  



        .EAI =O >A =@A E =O H@AH JD=J HAIFA?JI JDA FHA?A@EC HAIJHE?JEI
        ) HA?EFA EI ANA?KJA@ >O IKFFOEC JDA HA?EFA =I IJ=@=H@ EFKJ J JDA ?=@
                     /bin/rc −e −I
        JDA −e EI EJJA@ EB JDA E =JJHE>KJA EI IAJ 6DA ALEHAJ EI =KCAJA@ >O JDA BMEC L=HE
        =>AI
        $alltarget
                  = JDA J=HCAJI B JDEI HKA
        $newprereq
                  JDA FHAHAGKEIEJAI JD=J ?=KIA@ JDEI HKA J ANA?KJA
        $newmember
                  JDA FHAHAGKEIEJAI JD=J =HA A>AHI B = =CCHAC=JA JD=J ?=KIA@ JDEI HKA J ANA?KJA
                  9DA JDA FHAHAGKEIEJAI B = HKA =HA A>AHI B = =CCHAC=JA $newprereq ?
                  J=EI JDA =A B JDA =CCHAC=JA =@ KJ B @=JA A>AHI MDEA $newmember ?
                  J=EI O JDA =A B JDA A>AHI
        $nproc        JDA FH?AII IJ BH JDEI HA?EFA 1J I=JEIBEAI  $nproc$NPROC
        $pid          JDA FH?AII E@ BH JDA mk ANA?KJEC JDA HA?EFA
        $prereq       = JDA FHAHAGKEIEJAI BH JDEI HKA
        $stem         EB JDEI EI = AJ=HKA $stem EI JDA IJHEC JD=J =J?DA@ % H & JDAHMEIA EJ EI
                      AFJO .H HACK=H ANFHAIIE AJ=HKAI IAA >AM JDA L=HE=>AI stem0 
                      stem9 =HA IAJ J JDA ?HHAIF@EC IK>ANFHAIIEI
        $target       JDA J=HCAJI BH JDEI HKA JD=J AA@ J >A HA=@A
        6DAIA L=HE=>AI =HA =L=E=>A O @KHEC JDA ANA?KJE B = HA?EFA J MDEA AL=K=JEC JDA mkfile
        7AII JDA HKA D=I JDA Q =JJHE>KJA JDA HA?EFA EI FHEJA@ FHEH J ANA?KJE MEJD HA?CE=>A ALE
        HAJ L=HE=>AI ANF=@A@ +=@I HAJKHEC AFJO IJ=JKI IAA intro ?=KIA mk J
        JAHE=JA
        4A?EFAI =@ >=?GKJA@ rc ?=@I E F=?AI IK?D =I =IIECAJI ANA?KJA E = ?FO B mk’s
        ALEHAJ ?D=CAI JDAO =A J ALEHAJ L=HE=>AI =HA J LEIE>A BH mk
        8=HE=>A IK>IJEJKJE E = HKA EI @A MDA JDA HKA EI HA=@ L=HE=>A IK>IJEJKJE E JDA HA?EFA EI
        @A MDA JDA HA?EFA EI ANA?KJA@ .H AN=FA
               bar=a.c
               foo: $bar
                       $CC −o foo $bar
               bar=b.c
        ME ?FEA b.c EJ foo EB a.c EI AMAH JD= foo
  Aggregates
     =AI B JDA BH ab HABAH J A>AH b B JDA =CCHAC=JA a +KHHAJO JDA O =CCHAC=JAI IKF
     FHJA@ =HA ar =H?DELAI
  Attributes
      6DA ? IAF=H=JEC JDA J=HCAJ BH JDA FHAHAGKEIEJAI =O >A EA@E=JAO BMA@ >O attributes
      =@ =JDAH ? 6DA =JJHE>KJAI =HA
        D      1B JDA HA?EFA ANEJI MEJD = K IJ=JKI JDA J=HCAJ EI @AAJA@
        E      +JEKA ANA?KJE EB JDA HA?EFA @H=MI AHHHI
        N      1B JDAHA EI  HA?EFA JDA J=HCAJ D=I EJI JEA KF@=JA@
        n      6DA HKA EI = AJ=HKA JD=J ?=J >A = J=HCAJ B = LEHJK= HKA O BEAI =J?D JDA F=J
               JAH E JDA J=HCAJ
        P      6DA ?D=H=?JAHI =BJAH JDA P KJE JDA JAHE=JEC : =HA J=A =I = FHCH= =A 1J ME >A
               ELA@ =I rc −c prog ’arg1’ ’arg2’ =@ IDK@ HAJKH = K ANEJ IJ=JKI EB =@
               O EB =HC EI KF J @=JA MEJD HAIFA?J J =HC  ,=JA IJ=FI =HA IJE FHF=C=JA@ E JDA H
               = M=O




                                                      !!
                                                                                               



        Q      6DA HA?EFA EI J FHEJA@ FHEH J ANA?KJE
        R      6DA HKA EI = AJ=HKA KIEC HACK=H ANFHAIIEI 1 JDA HKA % D=I  IFA?E= A=EC
               6DA J=HCAJ EI EJAHFHAJA@ =I = HACK=H ANFHAIIE =I @ABEA@ E regexp$ 6DA FHAHAGKEIEJAI
               =O ?J=E HABAHA?AI J IK>ANFHAIIEI E BH \n =I E JDA IK>IJEJKJA ?=@ B
               sam
        U      6DA J=HCAJI =HA ?IE@AHA@ J D=LA >AA KF@=JA@ ALA EB JDA HA?EFA @E@ J @ I
        V      6DA J=HCAJI B JDEI HKA =HA =HA@ =I LEHJK= 6DAO =HA @EIJE?J BH BEAI B JDA I=A
               =A
EXAMPLES
     ) IEFA BEA J ?FEA = FHCH=
               </$objtype/mkfile

               prog: a.$O b.$O c.$O
                     $LD $LDFLAGS −o $target $prereq

               %.$O: %.c
                     $CC $CFLAGS $stem.c
        LAHHE@A B=C IAJJECI E JDA BEA
               % mk target ’CFLAGS=−S −w’
        =EJ=E = E>H=HO
               libc.a(%.$O):N: %.$O
               libc.a:     libc.a(abs.$O) libc.a(access.$O) libc.a(alarm.$O) ...
                     ar r libc.a $newmember
        5JHEC ANFHAIIE L=HE=>AI J @AHELA =AI BH = =IJAH EIJ
               NAMES=alloc arc bquote builtins expand main match mk var word
               OBJ=${NAMES:%=%.$O}
        4ACK=H ANFHAIIE AJ=HKAI
               ([^/]*)/(.*)\.$O:R: \1/\2.c
                     cd $stem1; $CC $CFLAGS $stem2.c
        ) ?HHA?J M=O J @A= MEJD yacc CH==HI 6DA BEA lex.c E?K@AI JDA BEA x.tab.h H=JDAH
        JD= y.tab.h E H@AH J HABA?J ?D=CAI E ?JAJ J KIJ @EBE?=JE JEA
               lex.$O:     x.tab.h
               x.tab.h:    y.tab.h
                     cmp −s x.tab.h y.tab.h || cp y.tab.h x.tab.h
               y.tab.c y.tab.h: gram.y
                     $YACC −d gram.y
        6DA =>LA AN=FA ?K@ =I KIA JDA P =JJHE>KJA BH JDA x.tab.h HKA
               x.tab.h:Pcmp −s: y.tab.h
                     cp y.tab.h x.tab.h
SOURCE
     /sys/src/cmd/mk
SEE ALSO
      rc regexp$
        ) 0KA  = 5K??AIIH J =A 
        )@HAM / 0KA =@ *> .=@HA= =EJ=EEC .EAI  2= ' MEJD  
BUGS
        1@AJE?= HA?EFAI BH HACK=H ANFHAIIE AJ=HKAI O D=LA A J=HCAJ
        5AAECO =FFHFHE=JA EFKJ EA CFLAGS=−DHZ=60 EI F=HIA@ =I = AHHAKI =JJHE>KJA ?HHA?J
        EJ >O EIAHJEC = IF=?A =BJAH JDA BEHIJ =




                                                    !"
                                                                                        



        6DA HA?EFAI FHEJA@ >O mk >ABHA >AEC F=IIA@ J rc BH ANA?KJE =HA IAJEAI AHHAKIO
        ANF=@A@ BH FHEJEC , J JHKIJ MD=J I FHEJA@ HAO  MD=J rc @AI




                                                !#
,14                                                                                          ,14




NAME
       @EH   =A = @EHA?JHO
SYNOPSIS
     mkdir  −p   −m mode  dirname ...
DESCRIPTION
      Mkdir ?HA=JAI JDA IFA?EBEA@ @EHA?JHEAI 1J HAGKEHAI MHEJA FAHEIIE E JDA F=HAJ @EHA?JHO
       1B JDA −p B=C EI CELA mkdir ?HA=JAI =O A?AII=HO F=HAJ @EHA?JHEAI =@ @AI J ?F=E EB JDA
       J=HCAJ @EHA?JHO =HA=@O ANEIJI
       6DA −m B=C IAJI JDA FAHEIIEI J >A KIA@ MDA ?HA=JEC JDA @EHA?JHO 6DA @AB=KJ EI %%%
SEE ALSO
      rm
      cd E rc
SOURCE
     /sys/src/cmd/mkdir.c
DIAGNOSTICS
     Mkdir HAJKHI K ANEJ IJ=JKI EB = @EHA?JHEAI MAHA IK??AIIBKO =@A JDAHMEIA EJ FHEJI = @E=C
     IJE? =@ HAJKHI "error" IJ=JKI




                                                    !$
/4                                                                                          /4




NAME
         CH MAH    K@AH=JA@ =EEC EIJI
SYNOPSIS
     upas/mlmgr −c listname
        upas/mlmgr −ar listname address
        upas/ml  −r replyto−address  addressfile listname
        upas/mlowner addressfile listname
DESCRIPTION
      Mlmgr ?HA=JAI =@ KF@=JAI K@AH=JA@ =EEC EIJI 6DA −c FJE ?HA=JAI =E @EHA?JHEAI BH
      >JD listname =@ listname−owner A=?D ?J=EEC = pipeto BEA AII=CAI =EA@ J listname
      =HA IAJ J = A>AHI B JDA =EEC EIJ )O Reply−to: =@ Precedence: BEA@I =HA
      HALA@ BH JDA AII=CAI =@ AM AI =HA =@@A@ @EHA?JEC HAFEAI J listname =@ IFA?EBOEC
      >K FHA?A@A?A 6DA ALAFA =@@HAII BH AHHH HAFEAI EI IAJ J /dev/null
        6DA =EEC EIJ A>AHIDEF EI JDA BEA /mail/box/listname/address−list 6DEI BEA EI =
        =@@HALA C -=?D EA HAFHAIAJI = IECA =@@HAII EAI >ACEEC MEJD = D=ID # =HA ?
        AJI EAI >ACEEC MEJD = AN?==JE FEJ ! =HA HAL=I ) JDAH EAI =HA =@@EJEI
        )@@EJE =@ HAL= AJHEAI ?= >A =FFA@A@ KIEC JDA −a =@ −r FJEI J mlmgr 0MALAH
        JDAO =HA H=O =FFA@A@ =I = ?IAGKA?A B KIAH HAGKAIJI
        6 >A =@@A@ H HALA@ BH JDA EIJ = KIAH =O IA@ = AII=CA J listname−owner ?J=EEC
        = AO MH@ E JDA DA=@AH H >@O 6DA AO MH@I =HA
               IK>I?HE>A  =@@ O From: =@@HAII J JDA EIJ
               HALA  HALA O From: =@@HAII BH JDA EIJ
               KIK>I?HE>A  HALA O From: =@@HAII BH JDA EIJ
        )@@EJE =@ HAL= ALAJI ?=KIA JEBE?=JE AII=CAI J >A IAJ J JDA =@@A@HALA@
        =@@HAII 1 JDA ?=IA B =@@EJE JDA AII=CA @AI?HE>AI DM J >A HALA@
        Ml =@ mlowner =HA JDA FHCH=I JD=J HA?AELA AII=CAI BH listname =@ listname−owner
        HAIFA?JELAO )FFHFHE=JA ?=I J JDA =HA EIAHJA@ E JDA pipeto BEAI ?HA=JA@ >O mlmgr
        Ml I −r FJE IAJI JDA Reply−to: BEA@ E JDA =E IAJ KJ >O ml.
FILES
        /mail/box/<listname>                            EIJ I =E>N @EHA?JHO
        /mail/box/<listname>−owner                      MAH I =E>N @EHA?JHO
        /mail/box/<listname>/address−list               C B =EEC EIJ @AAJEI =@ =@@EJEI
SOURCE
     /sys/src/cmd/upas/ml
SEE ALSO
      aliasmail& faces filter mail marshal nedmail qer& rewrite$ send&
      smtp& upasfs"




                                                  !%
2!,-+                                                                                  2!,-+




NAME
       F!@A?    @A?@A =K@E 2-/ BEAI =OAHI    =@ !
SYNOPSIS
     mp3dec  −o outfile   file  
DESCRIPTION
      Mp3dec @A?@AI A H HA 2-/ =K@E BEAI MHEJEC $>EJ IJAHA EA=H 2+ I=FA @=J= J
      outfile @AB=KJ /dev/audio 1B  BEAI =HA =A@ mp3dec HA=@I IJ=@=H@ EFKJ
       1 JDA =>IA?A B JDA −o FJE mp3dec =I FAI /dev/volume =@ IAJI JDA I=FA H=JA BH
       F=O>=? J =J?D JDA =K@E IJHA= 9DA MHEJEC J outfile mp3dec FHEJI = M=HEC J IJ=@=H@
       AHHH EB JDA IJHA= H=JA EI J "" 0
SOURCE
     /sys/src/games/mp3dec
SEE ALSO
      mp3enc juke% playlistfs%
      http://www.underbit.com/products/mad/
BUGS
       1J I =JDAH /7 >ADAJD ECDJO J=A@




                                                   !&
2!-+                                                                                       2!-+




NAME
       F!A?    ?HA=JA F! =K@E BEAI
SYNOPSIS
     games/mp3enc  −hprv   −b bitrate   −B bitrate   −m mode   −q G   −s sfreq   −V q  
           long or silly options 
DESCRIPTION
      Mp3enc ?FHAIIAI =K@E  IJ=@=H@ EFKJ H=O 2+A?@A@ =@ FH@K?AI 2!A?@A@
      =K@E  IJ=@=H@ KJFKJ *O @AB=KJ JDA 2! BEA ME KIA ?IJ=J >EJH=JA +*4 A?@EC >KJ
      JD=J ?= >A ?D=CA@ LE= −−abr =LAH=CA >EJH=JA @AIEHA@ )*4 H −v L=HE=>A >EJH=JA 8*4
  Options
      −b     IAJ EEK =MA@ bitrate E >I BH 8*4 @AB=KJ ! >I .H +*4 IAJ JDA AN=?J >EJH=JA
             E >I MDE?D @AB=KJI J  &>I
       −B    IAJ =NEK =MA@ bitrate E >I BH 8*4 @AB=KJ #$>I
       −h    I=A =I −q 2
       −m    mode =O >A IJAHA EJ BH?A H  @AB=KJ  force BH?AI E@IE@A IJAHA 
             = BH=AI
       −p    =@@ +4+ AHHH FHJA?JE =@@I = =@@EJE= $ >EJI FAH BH=A J JDA IJHA= 6DEI IAAI
             J >HA= F=O>=?
       −q    IAJI KJFKJ GK=EJO J q IAA −V
       −r    EFKJ EI H=M F?
       −s    IAJ I=FEC BHAGKA?O B EFKJ BEA E 0 J sfreq @AB=KJ EI ""
       −v    KIA L=HE=>A >EJH=JA 8*4 A?@EC
       −V    IAJ GK=EJO IAJJEC BH 8*4 J q ,AB=KJ q EI "  FH@K?AI DECDAIJGK=EJO =@ =HCAIJ BEAI
             =@ ' FH@K?AI MAIJGK=EJO =@ I=AIJ BEAI
  Long options
     −−abr bitrate      IAJI =LAH=CA bitrate @AIEHA@ E >I EIJA=@ B IAJJEC GK=EJO =@ CAAH
                        =JAI )*4 A?@EC
       −−resample sfreq IAJ I=FEC BHAGKA?O B KJFKJ BEA E 0 J sfreq @AB=KJ EI EFKJ IBHAG
       −−mp3input       input EI = 2! BEA
  Silly options
       −f            I=A =I −q 7 5K?D = @A=
       −o            =H =I HECE= EA @ J IAJ JDA HECE= >EJ
       −c            =H =I ?FOHECDJ
       −k            @EI=>A IB>  ?KJBB
       −e emp        @AAFD=IEI #? @AB=KJ 
       −d            =M ?D=AI J D=LA @EBBAHAJ >?JOFAI
       −t            @EI=>A :EC 8*4 EBH=JE= J=C
       −a            =KJ?LAHJ BH IJAHA J  BEA BH  A?@EC
       −x            BH?A >OJAIM=FFEC B EFKJ IAA dd EIJA=@
       −S            @ J FHEJ FHCHAII HAFHJ 8*4 DEIJCH=I
       −−athonly     O KIA JDA )60 BH =IEC
       −−nohist      @EI=>A 8*4 DEIJCH= @EIF=O
       −−voice       ANFAHEAJ= LE?A @A
EXAMPLES
     -?@A = .wav BEA =I DECDAIJGK=EJO 2!
              games/mp3enc −q 0 −b 320
       +HA=JA = BENA@  &>I 2! BEA BH = .wav BEA
              games/mp3enc −h <foo.wav >foo.mp3
       5JHA=EC BH IJAHA ""0 H=M 2+ @=J= A?@EC  =J $0 OK =O J AA@ dd
              dd −conv swab | games/mp3enc −a −r −m m −−resample 16 −b 24
SOURCE
     /sys/src/games/mp3enc




                                                   !'
2!-+                                                                                        2!-+



SEE ALSO
      dd mp3dec audio! cdfs" audio% juke% playlistfs%
      http://www.sulaco.org/mp3
BUGS
       3K=EJO EI K?D >AJJAH JD= A?@AHI >=IA@  JDA 15 HKJEAI >KJ IJE J =I C@ =I JDA .D/
       A?@AH
       1J I = /7 >ADAJD ECDJO HAD=>EEJ=JA@ 6DAHA =HA EEI B K@?KAJA@ FJEI




                                                    "
5 06                                                                                   5 06




NAME
       I DJ DJ I     ?LAHJ >AJMAA JHBB I I =?HI =@ DJ
SYNOPSIS
     ms2html  −q   −b basename   −d delims   −t title 
     html2ms
DESCRIPTION
      Ms2html ?LAHJI JDA ms$ IKH?A  IJ=@=H@ EFKJ EJ 06 =@ FHEJI EJ J IJ=@=H@ KJFKJ
      1B JDA IKH?A ?J=EI tbl H eqn EFKJ OK KIJ BEHIJ FEFA JDA JANJ JDHKCD JDIA FHAFH?AI
      IHI 2IJI?HEFJ E=CAI AGK=JEI =@ J=>AI ME >A ?LAHJA@ J CEB BEAI 1B JDA @?KAJ D=I =
      .TL AJHO EJI ?JAJI ME >A KIA@ =I JDA JEJA JDAHMEIA ms2html ME  BH = ._T =?H
      KM J ms$ =@ J=A EJI L=KA FJEI =HA
       G   IKFFHAIIAI M=HECI =>KJ =BHA@ EFKJ
       >   IAJI JDA 06 >=IA =A J basename
       @   IAJI JDA eqn @AEEJAHI J delim
       J   IAJI JDA 06 JEJA J title
       Html2ms HA=@I 06 BH IJ=@=H@ EFKJ =@ ?LAHJI EJ J ms$ IKH?A  IJ=@=H@ KJFKJ
SOURCE
     /sys/src/cmd/ms2html.c
     /sys/src/cmd/html2ms.c
SEE ALSO
      htmlroff ms$
BUGS
       I DJ @AI J K@AHIJ=@ = K>AH B JHBB ?=@I 1J @AI D=@A =?HI =@ @ABEA@
       IJHECI
       0J I @AI J K@AHIJ=@ DJ J=>AI




                                                   "
5/5                                                                                          5/5




NAME
       ICI =E BI  C IF =EFK> ICI )H?D 5F= 4AFO 5A@ 2IJ ,AAIC 5=LA
       BEA >=IA@ =E HA=@AH
SYNOPSIS
     mail2fs  −acDnor   −d mdir   mbox 
       msgs  −aD   −s runes   mdir   monthdir 
       M cmd  dir ... 
       Mg  −h   regexp 
       mspool
       mailplumb  −dho   mdir 
       Msgs  −a   mdir  monthdir  
       Arch  file ... 
       Spam  file ... 
       Reply
       Send
       Delmesg  file ... 
       Post
       Save file
       mlist
DESCRIPTION
      6DAIA FHCH=I ?FAH=JA J FHLE@A =E HA=@EC =@ @AELAHEC B=?EEJEAI >O KIEC BEAI BH =
      ID=HA@ BEA IAHLAH ICI =HA IJHA@ E = ?LAEAJ M=O J HA=@ H FH?AII JDA KIJ >O >HMIEC
      BEAI KIEC = 2= * =E >N BH=J
  Mail box format
      1 2= * ICI BH KIAHI =HA F=HIA@ =@ @A?@A@ BEHIJ =@ JDA IJHA@ E = BEA DEAH=H?DO MDAHA
      JDAIA =@ JDAH JI ?= >A KIA@ J FH?AII JDA ) =E>N EI = @EHA?JHO KIK=O K@AH
      /mail/box/$user/ JD=J ?J=EI A @EHA?JHO FAH JD AC 200603/ BH ICI FH
      ?AIIA@  =H?D $ 1 JDAIA @EHAJHEAI JDAHA EI A @EHA?JHO FAH AII=CA 6DA ?LAJE EI
      JD=J AII=CA @EHA?JHO =AI IJ=HJEC MEJD a. ?HHAIF@ J =H?DELA@ AII=CAI J J >A KIK
      =O IDM J JDA KIAH =AI IJ=HJEC MEJD s. ?HHAIF@ J AII=CAI JD=J IAA J >A IF= J
      KIK=O IDM AEJDAH =AI IJ=HJEC MEJD d. ?HHAIF@ J @AAJA@ AII=CAI J OAJ HALA@
      BH JDA BEA IOIJA )O JDAH HKA ?= >A KIA@ EIJA=@ B a , s H d =I = ?LAEA?A JDA
      A=EC MK@ >A KF J JDA KIAH *KJ BH JDEI FJE= FHABEN AII=CAI KIA = IAHE= AII=CA
      K>AH =I JDAEH @EHA?JHO =A
       6DA @EHA?JHO BH = AII=CA ?J=EI =J A=IJ JM BEAI text =@ raw 6DA text BEA D=I JDA
       =E DA=@AHI =@ >@O =HA=@O FH?AIIA@ BH HA=@EC =@ raw D=I JDA HECE= =E DA=@AHI MEJD
       KJ =O FH?AIIEC E?K@EC JDA 71: DA=@AH EA BH @A>KCCEC =@ =I BH >J=EEC AII=CA
       E@I MDA HAFOEC J ICI )I = FJE raw =O ?J=E JDA AJEHA HECE= =E MEJDKJ FH
       ?AIIEC =@ J KIJ JDA DA=@AHI )O =JJ=?DAJ E JDA =E EI AFJ IJHA@ E = IAF=H=JA BEA FI
       IE>O MEJD JDA BEA =A E@E?=JA@ E JDA 1- DA=@AHI HA=@O J >A KIA@ JD=J EI @A?@A@ 9DA
       JDA =JJ=?DAJ EI = =E JDA AII=CA EI IJHA@ E = IK>@EHA?JHO BMEC JDA I=A ?LAJEI
       IJ=JA@ =>LA .H ICI MEJD =JJ=?DAJI JDA text BEA ?J=EI =@@EJE= JANJ E@E?=JEC JDA HA
       =JELA F=JD =AI BH JDA =E I @EHA?JHO JD=J ?= >A KIA@ J FA JDA =JJ=?DAJI 6DEI EI ?
       LAEAJ J plumb JDA MDEA HA=@EC
       *A?=KIA = JDAIA BEAI D=LA >AA =HA=@O FH?AIIA@ BH HA=@EC JDA KIK= BEA D=@EC JI ?=
       >A KIA@ J HA=@ A@EJ ?FO H HALA JDA
       6DA =E>N KIA@ >O @AB=KJ EI /mail/box/$user/msgs =@ ?HHAIF@I J JDA E>N
       ) 2= * =E >N =I ?J=EI JM BEAI seq =@ digest AII=CAI =HA CELA IAGKA?A K
       >AHI =I =@@A@ J JDA =E >N 6DA BEA seq ?J=EI JDA IAGKA?A K>AH BH JDA =IJ AII=CA
       H AH =@ EI DMEXCL J FHLE@A ?EC BH KJEFA FHCH=I KIEC JDA =E >N 6DA BEA


                                                   "
5/5                                                                                             5/5



      digest ?J=EI @ECAIJI BH ICI =@@A@ J JDA =E>N KIEC mail2fs =@ J BH JDIA =@@A@
      >O D=@ KIEC BEA JI 9DA = AII=CA D=I = @ECAIJ JD=J M=I =HA=@O IAA E JDA F=IJ JDA AI
      I=CA EI IEAJO @EI?=H@A@ =I = @KFFE?=JA
      2HCH=I @AI?HE>A@ >AM =HA F=HIEEKI AKCD E JDA BH=J B JDA =E >N I JD=J JDAO ME
      MH ALA EB AII=CAI =HA A@EJA@ >O D=@ JDAH BEAI =HA ?HA=JA@ H IA B JDA =HA HALA@
      8EHJK= =E B@AHI =O >A ?HA=JA@ >O IJHEC JANJ BEAI MEJD =E EIJI JD=J ?J=E = =E @AI?HEF
      JE FAH EA IJ=HJEC MEJD JDA F=JD BH A=?D =E +FOEC JDA JANJ IDM BH IA AII=CAI E =
      =E EIJEC EJ =JDAH JANJ BEA MK@ I=LA IK?D AII=CAI EJ JD=J BEA 6DA FHCH= mlist
      MHEJAI J IJ=@=H@ KJFKJ = ?A= EIJEC BH AII=CAI MEJD F=JDI BK@ E JDA IJ=@=H@ EFKJ
      ) BEA = LEHJK= B@AH =A@ EA = FAHJD @EHA?JHO MEJD .l H .la =FFA@A@ EI ?IE@AHA@ =
      ?=?DA B JDA EIJEC BH JD=J @EHA?JHO *KJ O EB JDA @EHA?JHO D=I J >AA @EBEA@ =BJAH JDA BEA
      .H AN=FA = JANJ BEA =A@ 200909.l ?J=EEC = =E EIJEC E JDA BH=J IDM >O msgs
      ) ME >A KIA@ J EIJ ICI  5AFJA>AH ' EIJA=@ B JDA 200909 @EHA?JHO =@ EJI ?JAJI
      6DEI BEA ME >A ECHA@ BH =E>N EIJECI EB JDA @EHA?JHO EI @EBEA@ =BJAH JDA BEA =@ JDA ?=?DA
      EI JDAHABHA KJ B @=JA ) BEA =A@ 200909.la >AD=LAI EA >ABHA >KJ EI M J ?J=E
      O =H?DELA@ ICI 1J EI JDAHABHA ECHA@ MDA EIJEC =H?DELA@ ICI 6DA msgs FHCH=
      =KJ=JE?=O HA=AI .l BEAI J la MDA JDA BEA EIJI O =H?DELA@ =E
  Reading mail
     =E EI ?LAHJA@ BH = 2= ' =E>N EJ = 2= * =E>N KIEC mail2fs 6DEI FHCH= =O >A
     HK KIEC cron& H @EHA?JO BH JDA pipeto BEA @AI?HE>A@ E mail 1J KIAI upas/fs
     @AI?HE>A@ E upasfs" J F=HIA JDA 2= ' =E >N
      *O @AB=KJ /mail/box/$user/mbox EI JDA IKH?A 2= ' =E >N AII=CAI BK@  EJ =HA
      LA@ EJ E 2= * =E>N BH=J 6DA =HCKAJ mbox IFA?EBEAI =JDAH =E IKH?A J >A
      KIA@ EIJA=@ B JDA @AB=KJ FJE −d ?D=CAI JDA @AIJE=JE J mdir
      AII=CAI =HA @AAJA@ BH JDA 2= ' =E>N KAII B=C −n EI CELA 6DA 2= * =E>N EI ?HA
      =JA@ EB EJ @AI J ANEIJ O EB B=C −c EI CELA
      .=C −a =AI mail2fs =@@ AM AII=CAI =I =H?DELA@ J JDA 2= * =E>N 6DEI EI KIABK J =@@
      AII=CAI J = =E>N BH BKHJDAH HABAHA?A J BH EIJEC MDA =IEC JDA =E E@AN BH JDA
      =E>N .H AN=FA J =H?DELA KJCEC =E E JDA @AB=KJ =E >N
      .=C −o =II mail2fs J KIA JDA @=JA BH JDA =E J @AJAHEA MDAHA J =H?DELA EJ EIJA=@ B
      KIEC J@=O I 5AA JDA AN=FAI IA?JE
      .=C −r =II mail2fs J IJHA JDA AJEHA HECE= AII=CA E JDA raw BEA =@ J KIJ AII=CA
      DA=@AHI
      .=C −D =??AFJA@ >O mail2fs =@ JDAH FHCH=I A=>AI @A>KC @E=CIJE?I
      6DA FHCH= msgs EI = ?LAEA?A J BH HA=@EC =E 1J CAAH=JAI = =E E@AN .=C −a CAAH
      =JAI = EIJ BH = ICI E JDA =E>N =H?DELA@ H J 6DEI =O J=A IA JEA EB JDA =E>N EI EI
      >EC AKCD .=C −s ?= >A KIA@ J E?K@A E JDA EIJ ICI IJ=HJEC MEJD =O HKA E runes BH
      AN=FA s BH IF= 6DA =E>N EI JDA IJ=@=H@ msgs E>N KAII = @EBBAHAJ A EI IKFFEA@
      =I = =HCKAJ )I = FJE >JD JDA =E >N F=JD =@ JDA =A B = FAHJD @EHA?JHO ?=
      >A E@E?=JA@ J =I BH = EIJ B ICI BH KIJ A JD 6DEI EI KIABK J CAAH=JA FAHJD
      =E EIJI JD=J ?= >A KIA@ J GKE?O >HMIA ANEIJEC ICI MEJDKJ CEC JDHKCD = ICI E JDA
      >N 5AA JDA Month I?HEFJ IKFFEA@ =I = AN=FA
      )I = =E@ BH JDAH FHCH=I msgs F=?AI = EIJ B JDA @EHA?JHEAI BH JDA ICI EIJA@ =J
      /tmp/msgs.$user MDE?D ?= >A KIABK BH HAJHEALA JDA F=JDI BH JDA ICI JDA KIAH EI MHEC
      MEJD
      2HCH=I KIJ @AI?HE>A@ =HA JDA >=IE? JEJ J D=@A ICI JDAH FHCH=I @AI?HE>A@ DAHA =HA
      = ?LAEA?A BH JDA KIAH 7IAHI =HA A?KH=CA@ J ?KIJEA JDA =@H J MHEJA JDAEH M LAH
      IEI
      M EI = I?HEFJ JD=J =FFEAI JDA FAH=JE E@E?=JA@ >O cmd J A H HA ICI 1J =FFEAI cmd J =
      ICI =IJ EIJA@ >O msgs =I @AI?HE>A@ >O JDA F=JDI E /tmp/msgs.$user MDA  =E @EHA?
      JHEAI =HA CELA =I =HCKAJI )HCKAJI IAA?JEC ICI O AA@ J AJE F=JDI J JDA =E
      @EHA?JHEAI >KJ =O HABAH J F=HJE?K=H BEAI MEJDE JDA =I = ?LAEA?A J FAHEJ KIEC =AI
      BH IAMDAHA AIA MEJDKJ A@EJEC Cmd =O >A =O B JDA BMEC




                                                    "!
5/5                                                                                           5/5



      arch      6   =H?DELA JDA ICI =I HA=@
      spam      6   =H?DELA JDA ICI =I IF=
      inbox     6   =H?DELA JDA ICI =I KHA=@
      rm        6   FHEJ ?=@I J HALA JDA ICI
      print     6   FHEJ JDA JANJ B JDA ICI
      list      6   EIJ JDA @EHA?JHEAI BH JDA ICI
      mime      6   EIJ JDA =JJ=?DAJI BH JDA ICI
      reply     6   FK> = HAFO AII=CA J JDA A@EJH
      6DA IECA AJJAHI a s i d p l m =@ r ?= >A KIA@ EIJA=@ B JDA BK cmd =A E JDA I=A
      H@AH JA JD=J JDA AJJAH EI JDA EEJE= BH JDA ?=@ >KJ BH @AAJE
      Mg EI J IJHE?JO A?AII=HO >KJ EI IKFFEA@ =I = ?LAEA?A I?HEFJ J ?= grep J ?=JA ICI
      ?J=EEC JDA ANFHAIIE CELA =I = =HCKAJ .=C −h =AI EJ IA=H?D O E DA=@AHI EA JDA
      FHALEKI FHCH= Mg O ?IE@AHI ICI EIJA@ E /tmp/msgs.$user
      Mailplumb EI KIA@ J IA@ plumb AII=CAI J =EJ=E faces =@ JDAH FHCH=I =M=HA B
      ICI E JDA KIAH I 2= * =E>N H E mdir MDA IKFFEA@ .=C −h =AI JDA FHCH= JEBO
      ANEIJEC ICI =I AM AI .=C −o =AI mailplumb FIJ ALAJI BH JDA ?JFKI KIEC ports"
      EIJA=@ B plumber"
  Reading mail in Acme
     6DA FHCH= Msgs IAA /acme/msgs EI = )?A EJAHB=?A BH HA=@EC =E 1JI =HCKAJI =HA
     JDA I=A B msgs . -NA?KJEC Msgs MEJDE )?A @EIF=OI = ME@M MEJD JDA @AB=KJ H E@E?=JA@
     =E>N 1J K@AHIJ=@I >JD JDA IJ=@=H@ =E>N BH=J @AI?HE>A@ =>LA =@ JDA LEHJK= B@AH
     BH=J = JANJ BEA IAA =>LA
      6DA FHCH= EIJAI J plumber ALAJI BH =E =@ JHEAI J =EJ=E JDA =E EIJ KF J @=JA
      6 HA=@ = =E IEFO ?E? >KJJ!  JDA =E BEA =A IDM E JDA =E EIJ )H?DELEC =H
      EC = IF= HAFOEC =@ @AAJEC AII=CAI EI =?DEALA@ >O ANA?KJEC JDA I?HEFJI Arch Spam
      Reply =@ Delmesg HAIFA?JELAO IJ B JDA =O >A KIA@ AEJDAH BH = AII=CA ME@M H J
      FH?AII IJ=@=H@ EFKJ KIK=O =J JDA =E >N @EHA?JHO 5A B JDA =I =??AFJ AII=CA
      F=JDI =I =HCKAJI .H AN=FA J =H?DELA = IAHEAI B ICI IAA?J JDA E JDA =E EIJ =@ ANA
      ?KJA |Arch E JD=J ME@M
      ICI ?= >A IAJ KIEC Reply =@ Post =I @AI?HE>A@ =JAH
      Save =H?DELAI A H HA AII=CAI =@@EC JDA J JDA =A@ BEA
  Reading mail in O/live
     1 CAAH= HA=@EC =E E olive EI IEE=H J HA=@EC =E E )?A 6DA =E @EBBAHA?A EI JD=J
     JDAHA EI  AA@ BH = =E EIJEC ?=@ 6D=J EI JDAHA EI  Msgs FHCH=
      -NA?KJEC !Msgs =J /mail/box/$user/msgs FH@K?AI = EEJE= EIJ B ICI 6DEI EIJ ?= >A
      HABHAIDA@ >O ANA?KJEC ,<Msgs BH JDA F=A ?J=EEC JDA =E EIJ 6 HA=@ = =E KIJ ?E?
      >KJJ!  JDA =E F=JD
      6 IAA?J ICI =??H@EC J JANJ IDM E JDA =E E@AN KIA JDA 5= ?=@ =CK=CA .H
      AN=FA ,x/9fans/+−p FH@K?AI = =E E@AN BH ICI ?EC BH 9fans
      6 =H?DELA = IAJ B ICI IA@ JDAEH E@AN JANJ =I IJ=@=H@ EFKJ J Arch .H AN=FA ,>Arch
      =H?DELAI = ICI EIJA@ E JDA F=A 1 JDA I=A M=O Spam B=CI ICI =I IF=
      )I E )?A IJ I?HEFJI ?= >A KIA@ BH = F=A IDMEC = IECA AII=CA BH IJ=@=H@ EFKJ H
      BH AII=CAI CELA =I =HCKAJ
  Sending mail
     Mspool EI = FHCH= JD=J J=AI JANJ BEAI BH /mail/box/$user/out HAFHAIAJEC ICI J
     >A IAJ =@ IA@I JDA 1J O FAH=JAI  BEAI MDIA =AI =HA K>AHI 6 IA@ = =E JDA
     KIAH ?HA=JAI = BEA MEJD = H=@EA@ =A EA /mail/box/$user/out/Out.3452 A@EJI EJ
     =@ HA=AI JDA BEA J KIJ JDA H=@ K>AH
      6DA BEA BH=J EI IEE=H J JD=J KIA@ >O JDA acme =E ?FIEJE ME@M 1J E?K@AI A
      JANJ EA FAH DA=@AH = >= EA =@ JDA >@O )JJ=?DAJI =HA =@@A@ >O EAI IJ=HJEC MEJD
      Attach: E JDA DA=@AH 1EA =JJ=?DAJI =HA =@@A@ >O EAI IJ=HJEC MEJD Include: E JDA
      DA=@AH 4AFEAI J JDAH ICI IDK@ ?J=E = Replying: DA=@AH ?J=EEC JDA F=JD J JDA
      =E >AEC HAFEA@ J EJI raw BEA E = 2= * =E>N



                                                  ""
5/5                                                                                            5/5



       AII=CAI =HA IAJ KIEC marshal
       6DA I?HEFJ Reply EI =L=E=>A J IA@ AII=CAI BH AEJDAH olive H acme 5EE=H J Arch =@
       Spam EJ HAFEAI J JDA =E IDM MDA ANA?KJA@ E = AII=CA ME@M H F=A EJ HAFEAI J JDA
       =E EIJA@ E EJI IJ=@=H@ EFKJ JDAHMEIA .H AN=FA IAA?JEC = =E E JDA E@AN =@ ANA?KJ
       EC .>Reply E Olive H >Reply E Acme MK@ HAFO J EJ
       9DA K?AHJ=E HAC=H@EC JDA =E J HAFO J EJ ?HA=JAI = ME@M J A@EJ =@ IA@ = AM =E
       =E EI @AELAHA@ >O MHEJEC JDA F=A ?HA=JA@ >O Reply =@ JDA ANA?KJEC AEJDAH Send H Post
       6DA BHAH IFI JDA AII=CA KIEC mspool , JDA =JJAH =JJAFJI J EA@E=JAO @AELAH JDA AI
       I=CA
EXAMPLES
     7IAHI =HA ANFA?JA@ J ?KIJEA JDA I?HEFJI IKFFEA@ J JDAEH AA@I ) B JDA =HA J >A ?IE@
     AHA@ AN=FAI B DM J KIA JDA =E IOIJA
       LA = ICI BH JDA 2= ' =E>N J JDA 2= * A =@ ?HA=JAI JDA =JAH EB EJ @AI J ANEIJ
       ; mail2fs −c
       EIJ ICI
       ; msgs omsgs
       200712/4/text                 Ralph Corderoy            Re: [9fans] Hi
       200712/3/text                 Juan Manuel Se            Re: reunion
       200712/2/text                 "Raquel Martin            Re: [Diet] reunion
       200712/1/text                 "Fco. J. Balle            reunion
       .H M  /tmp/msgs.$user ?J=EI = EIJ B =E @EHA?JHEAI BH M J MH MEJD .H
       AN=FA @EIF=O JDA
       ; M p
       /mail/box/nemo/msgs/200712/4
       To: 9fans@cse.psu.edu
       From: Ralph Corderoy <ralph@inputplus.co.uk>
       Subject: Re: [9fans] Hi together | a few newbie questions
       Sender: 9fans−admin@cse.psu.edu
       ...
       
       EIJ JDAEH @EHA?JHEAI =@ FK> = 2,. =JJ=?DAJI
       ; M l
       /mail/box/nemo/msgs/200712/4
       /mail/box/nemo/msgs/200712/3
       /mail/box/nemo/msgs/200712/2
       /mail/box/nemo/msgs/200712/1
       ; plumb ‘{M l}^*.pdf
       4AFO J JDA IA?@ =H JDA BEHIJ =I IF= =@ =H?DELA JDA JDAHI
       ; M r 200712/3
       ; M s 200712/4/text
       ; M a
       ;
       2HAF=HA J KIA JDA I?HEFJ M EA =>LA >KJ O BH AII=CAI BH @A?A>AH % JD=J ?J=E
       2,. =JJ=?DAJI =@ =HA AFJ E JDA omsgs =E>N
       ; ls /mail/box/nemo/omsgs/200712/*/*.pdf >/tmp/msgs.nemo
       ;
       7IA mailplumb J IAA E B=?AI AII=CAI E JDA 2= * =E>N
       ; plumber
       ; mailplumb
       ; faces −m /mail/box/$user/msgs
       6DEI EI = CKE@A BH HA=@EC =E KIEC olive
       !Msgs          # ask for mail index
       !Arch          # archive this mail
       !Spam          # mark this mail as spam
       X/text/D # delete all panels showing msgs


                                                    "#
5/5                                                                                          5/5



        , <Msgs   # update mail index
        , >Arch   # archive all msgs listed
        , x/9fans/+−p # list all 9fans messages shown
        6DA I?HEFJ /sys/src/cmd/mail2fs/Month EI = AN=FA B = FAHJD ?A=KF I?HEFJ
        7IK=O JDA @EHA?JHO BH JDA =IJ JD EI @A?=HA@ =I DMTEMP =@ JDEI FAHEIIE EI ?A=HA@
        MDA = IF= D=I >AA @A=J MEJD 6DA I?HEFJ =I ?HA=JAI ?=?DA@ EIJECI BH = >KJ JDA ?KHHAJ
        JD
        )@@ ICI BH JDA 71:BH=J oldmbox J JDA IJ=@=H@ msgs B@AH DHEC JDAEH @=JAI =@
        EIAHJEC JDA =I =H?DELA@ =@ FH@K?A = EIJEC BH JDA AFJ =J newfolder
        ; mail2fs −aon oldmbox > /tmp/archived
        ; mlist </tmp/archived >newfolder
        +HA=JA = ?=?DA BH 5AFJA>AH ' J >A KIA@ >O JI EIJEC ICI
        ; cd /mail/box/$user/msgs
        ; msgs −a msgs 200909 > 200909.l
FILES
        /mail/box/$user/mbox                  5J=@=H@ 2= ' =E >N
        /mail/box/$user/msgs/                 5J=@=H@ 2= * =E >N
        /tmp/msgs.$user                       EIJ B ICI >AEC FH?AIIA@ >O JDA KIAH
SOURCE
     /sys/src/cmd/upas/mail2fs =@ /acme/msgs
SEE ALSO
      mail




                                                   "$
61-                                                                                       61-




NAME
       JEA   FHEJ BEA @EBE?=JE JEA
SYNOPSIS
     mtime file ...
DESCRIPTION
      Mtime FHEJI JDA @EBE?=JE JEA E IA?@I IE?A JDA AF?D =@ =A B A=?D file
SOURCE
     /sys/src/cmd/mtime.c




                                                  "%
7/                                                                                             7/




NAME
       KC  ?LAHJ = E=CA J = B=?A E?
SYNOPSIS
     mug  file 
DESCRIPTION
      Mug HA=@I = 2= ' image$ BH file H IJ=@=H@ EFKJ EB JDAHA EI  file =@ @EIF=OI = MHEC
      LAHIE B JDA E? = CH=O H=F =@ = =HCAH E=CA JDA ?HF >N  = @AHELA@ BH file 5AA?JEC
      Write BH JDA >KJJ! AK ME MHEJA JDA E? E face$ BH=J J IJ=@=H@ KJFKJ
       1=CEA = !N! CHE@  JDA ?HF >N ;K ?= LA = A@CA H ?HAH B JDA >N >O FKJJEC JDA
       KIA E JDA ?HHAIF@EC IA?JE B JDA CHE@ =@ @H=CCEC ,H=CCEC E JDA E@@A >N E JDA
       CHE@ JH=I=JAI JDA ?HF >N 6DA KIA ?KHIH ?D=CAI J JA OK MDAHA OK =HA
       6DA >=H E JDA CH=O H=F ?JHI JDA =F BH FE?JKHA CH=O ALAI J JDA KJFKJ ALAI 6DA L=
       KAI =C JDA >=H =HA =FFA@ J  JDHKCD ## E JDA KJFKJ ;K ?= LA JDA >=H LAHJE?=O >O
       CH=>>EC JDA E@IA?JE H =@KIJ JDA ME@JD >O CH=>>EC = A@FEJ
       6DA ?KHHAJ E? EI IDM E JDA >JJ ABJ ?HAH IKHHK@A@ >O AECDJ I= AFJO >NAI ;K
       ?= I=LA JDA IAJJECI =I JDAO =HA >O @H=CCEC JDA ?KHHAJ E? EJ A B JDA JDAH >NAI ;K
       ?= HAIJHA JDA IAJJECI >O @H=CCEC = E? BH A B JDA FAHEFDAHO >NAI EJ JDA E@@A
EXAMPLES
     +LAHJ = 2-/ E=CA EJ = B=?A E?
              jpg −c plus.jpg | mug >plus.1
SEE ALSO
      faces jpg face$ image$




                                                   "&
-,)1                                                                                        -,)1




NAME
       A@=E   HA=@EC =E
SYNOPSIS
     upas/nedmail  −nr   −f mailfile   −s mailfile 
       upas/nedmail −c dir
DESCRIPTION
      Nedmail A@EJI = =E>N 6DA @AB=KJ =E>N EI /mail/box/username/mbox 6DA −f ?
      =@ EA FJE IFA?EBEAI = =JAH=JA =E>N 7HJA@ F=JD =AI =HA EJAHFHAJA@ HA=JELA J
      /mail/box/username. 1B JDA mailfile =HCKAJ EI EJJA@ JDA =A @AB=KJI J stored
       6DA FJEI =HA
       −c dir              +HA=JA = =E>N 1B dir EI IFA?EBEA@ JDA AM =E>N EI ?HA=JA@ E
                           /mail/box/username/dir/mbox JDAHMEIA JDA @AB=KJ =E>N EI ?HA
                           =JA@
       −r                  4ALAHIA IDM AII=CAI E BEHIJE BEHIJKJ H@AH JDA @AB=KJ EI =IJE BEHIJ
                           KJ
       −n                  =A JDA AII=CA K>AHI JDA I=A =I JDA BEA =AI E JDA =E >N @EHA?
                           JHO 6DEI EFEAI JDA −r FJE
       −f mailfile         4A=@ AII=CAI BH JDA IFA?EBEA@ BEA IAA =>LA EIJA=@ B JDA @AB=KJ =E
                           >N
       −s mailfile         4A=@ = IECA AII=CA BEA mailfile =I FH@K?A@ >O fs =@ JHA=J EJ =I = AJEHA
                           =E>N 6DEI EI FHLE@A@ BH KIA E FK>EC HKAI IAA faces
       Nedmail IJ=HJI >O HA=@EC JDA =E >N FHEJEC KJ JDA K>AH B AII=CAI =@ JDA FHFJEC
       BH ?=@I BH IJ=@=H@ EFKJ +=@I =I E ed =HA B JDA BH range command
       arguments  6DA ?=@ EI =FFEA@ J A=?D AII=CA E JDA FJE= H=CA
       6DA =@@HAII H=CA ?= >A
       address                 J   E@E?=JA   = IECA AII=CA DA=@AH
       address,address         J   E@E?=JA   = H=CA B ?JECKKI AII=CA DA=@AHI
       g/expression/           J   E@E?=JA   = AII=CAI MDIA DA=@AHI =J?D JDA HACK=H expression
       g%expression%           J   E@E?=JA   = AII=CAI MDIA ?JAJI =J?D JDA HACK=H expression
       6DA =@@HAIIAI ?= >A
       number                  J   E@E?=JA   = F=HJE?K=H AII=CA
       address.number          J   E@E?=JA   = IK>F=HJ B = F=HJE?K=H AII=CA
       /expression/            J   E@E?=JA   JDA ANJ AII=CA MDIA DA=@AH =J?DAI expression
       %expression%            J   E@E?=JA   JDA ANJ AII=CA MDIA ?JAJI =J?D ANFHAIIE
       empty or .              J   E@E?=JA   JDA ?KHHAJ AII=CA
       −address                J   E@E?=JA   >=?M=H@I IA=H?D H LAAJ
       5E?A AII=CAI E 1- =HA DEAH=H?DE?= IJHK?JKHAI E nedmail = JDA IK>F=HJI =HA E@ELE@K=O
       =@@HAII=>A .H AN=FA EB AII=CA    ?J=EI ! =JJ=?DAJI JDA =JJ=?DAJI =HA K>AHA@
           =@ !
       6DA ?=@I =HA
       a args             4AFO J = =@@HAIIAI E JDA To: From: =@ Cc: DA=@AH EAI Marshal EI
                          KIA@ J BH=J JDA HAFO =@ =O =HCKAJI JDA KIAH IFA?EBEAI =HA =@@A@ J JDA
                          ?=@ EA J marshal >ABHA JDA HA?EFEAJ 6DA FIIE>EEJO B =EC = B
                          B OKHIAB EI LAHO DECD MEJD JDEI ?=@
       A args             EA a >KJ MEJD JDA AII=CA =FFA@A@ J JDA HAFO
       b                  2HEJ JDA DA=@AHI BH JDA ANJ JA AII=CAI
       d                  =H AII=CA J >A @AAJA@ KF ANEJEC nedmail
       f                  )FFA@ JDA AII=CA J JDA BEA /mail/box/username/sendername MDAHA
                          sendername EI JDA =??KJ =A B JDA IA@AH
       h                  2HEJ JDA @EIFIEJE IEA E ?D=H=?JAHI HA?AFJE JEA IA@AH =@ IK>A?J B
                          JDA AII=CA
       H                  2HEJ JDA 1- IJHK?JKHA B JDA AII=CA




                                                        "'
-,)1                                                                                       -,)1



        help              2HEJ = IK=HO B JDA ?=@I
        m person ...      .HM=H@ JDA AII=CA =I = EA =JJ=?DAJ J JDA =A@ persons
        M person ...      EA m >KJ =M JDA KIAH J JOFA E JANJ J >A E?K@A@ MEJD JDA BHM=H@A@ AI
                          I=CA
        p                 2HEJ AII=CA) EJAHHKFJ IJFI JDA FHEJEC
        r args            4AFO J JDA IA@AH B JDA AII=CA Marshal EI KIA@ J BH=J JDA HAFO 1B =@
                          FJE= Args =HA IFA?EBEA@ JDAO =HA =@@A@ J JDA ?=@ EA J marshal
                          >ABHA JDA HA?EFEAJ I =@@HAII
        R args            EA r >KJ MEJD JDA HECE= AII=CA E?K@A@ =I = =JJ=?DAJ
        rf                EA r >KJ =FFA@ JDA AII=CA =@ JDA HAFO J JDA BEA
                          /mail/box/username/sendername MDAHA sendername EI JDA =??KJ =A
                          B JDA IA@AH
        Rf                EA R >KJ =FFA@ JDA AII=CA =@ JDA HAFO J JDA BEA
                          /mail/box/username/sendername MDAHA sendername EI JDA =??KJ =A
                          B JDA IA@AH
        s mfile           )FFA@ JDA AII=CA J JDA IFA?EBEA@ =E>N 1B mfile @AI J IJ=HJ MEJD =   EJ
                          EI EJAHFHAJA@ HA=JELA J JDA @EHA?JHO E MDE?D JDA =E>N HAIE@AI 1B mfile EI =
                          @EHA?JHO JDA JDA @AIJE=JE EI = BEA E JD=J @EHA?JHO 1B JDA 1- DA=@AH IFA?E
                          BEAI = BEA =A JD=J A EI KIA@ JDAHMEIA A EI CAAH=JA@ KIEC mktemp 
                          =@ JDA IJHEC att.XXXXXXXXXXX
        q                 2KJ K@AAJA@ =E >=? E JDA =E>N =@ IJF
        -6 ?JH,   5=A =I q
        w file            5=A =I s MEJD JDA =E DA=@AH EAI IJHEFFA@ 6DEI ?= >A KIA@ J I=LA >E=HO
                          =E >@EAI
        u                 4ALA =H BH @AAJE
        x                 -NEJ MEJDKJ ?D=CEC JDA =E>N BEA
        y                 5O?DHEA MEJD JDA =E >N )O @AAJA@ AII=CAI =HA FKHCA@ =@ =O AM
                          AII=CAI HA=@ 6DEI EI AGKEL=AJ J GKEJEC A@=E =@ HAIJ=HJEC
        |command          4K JDA command MEJD JDA AII=CA >@O =I IJ=@=H@ EFKJ
        ||command         4K JDA command MEJD JDA MDA AII=CA =I IJ=@=H@ EFKJ
        !command          -I?=FA J JDA IDA J @ command
        =                 2HEJ JDA K>AH B JDA ?KHHAJ AII=CA
        0AHA I = AN=FA B = =E IAIIE JD=J I =J = IK=HO B JDA =E AII=CAI I=LAI =M=O =
        DJ BEA =@@A@ =I = =JJ=?DAJ J = AII=CA =@ JDA @AAJAI JDA AII=CA
        % mail
        7 messages
        : ,h
        1   H 2129     07/22 12:30 noone@madeup.net "Add Up To 2000 free miles"
        2       504    07/22 11:43 jmk
        3   H   784    07/20 09:05 presotto
        4       822    07/11 09:23 xxx@yyy.net "You don’t call, you don’t write..."
        5       193    07/06 16:55 presotto
        6       529    06/01 19:42 jmk
        7       798    09/02 2000 howard
        : 1H
        1       multipart/mixed             2129  from=noone@madeup.net
         1.1      text/plain                115
         1.2      text/html                 1705  filename=northwest.htm
        : 1.2w /tmp/northwest.html
        !saved in /tmp/northwest.html
        1.2: d
        1: q
        !1 message deleted
        %
        JE?A JD=J JDA @AAJA B AII=CA  @AAJA@ JDA AJEHA AII=CA =@ J KIJ JDA =JJ=?DAJ
FILES
        /mail/box/*                          =E @EHA?JHEAI




                                                    #
-,)1                                                                                  -,)1



       /mail/box/*/mbox                   =E>N BEAI
       /mail/box/*/forward                BHM=H@EC =@@HAIIAI
       /mail/box/*/pipeto                 =E BEJAH
       /mail/box/*/L.reading              KJK= AN?KIE ? BH KJEFA >N HA=@AHI
       /mail/box/*/L.mbox                 KJK= AN?KIE ? BH =JAHEC >N
SOURCE
     /sys/src/cmd/upas/ned
SEE ALSO
      mail aliasmail& filter marshal mlmgr nedmail upasfs" smtp& faces
      rewrite$




                                                 #
-656)6                                                                                          -656)6




NAME
        AJIJ=J    IK=HEA AJMH ?A?JEI
SYNOPSIS
     netstat  −in   −p proto   netmtpt 
DESCRIPTION
      Netstat FHEJI EBH=JE =>KJ AJMH KJA@ =J netmtpt @AB=KJ /net .H IP ?A?JEI
      netstat HAFHJI JDA FHJ? ?A?JE K>AH KIAH ?A?JE IJ=JA ?= FHJ HAJA FHJ
      =@ HAJA =@@HAII
        6DA FJEI =HA
        −i        1IJA=@ B JDA KIK= EIJEC FHEJ A EA FAH AJMH EJAHB=?A -=?D EA CELAI JDA @ALE?A
                  67 ?= =@@HAII =I HAJA =@@HAII F=?AJI E F=?AJI KJ AHHHI E =@ AHHHI
                  KJ BH JDEI EJAHB=?A
        −n        *O @AB=KJ netstat I KF FHJ K>AHI =@ =@@HAIIAI E JDA AJMH @=J=>=IAI J FHEJ
                  IO>E? =AI EB FIIE>A 6DEI FJE @EI=>AI IK?D JH=I=JE
        −p        5DM O ?A?JEI MEJD JDA CELA FHJ?
FILES
        /net/*/*
SOURCE
     /sys/src/cmd/netstat.c
SEE ALSO
      ipconfig&




                                                       #
-95                                                                                        -95




NAME
        AMI   FHEJ AMI EJAI
SYNOPSIS
     news  −a   −n   item ... 
DESCRIPTION
      9DA ELA@ MEJDKJ FJEI JDEI IEFA ?= AMI IAHLE?A FHEJI BEAI JD=J D=LA =FFA=HA@ E
      /lib/news IE?A =IJ HA=@EC IJ HA?AJ BEHIJ MEJD A=?D FHA?A@A@ >O = =FFHFHE=JA DA=@AH
      6DA JEA B HA=@EC EI HA?H@A@ 6DA FJEI =HA
        −a     2HEJ = EJAI HAC=H@AII B ?KHHA?O 6DA HA?H@A@ JEA EI J ?D=CA@
        −n     4AFHJ JDA =AI B JDA ?KHHAJ EJAI MEJDKJ FHEJEC JDAEH ?JAJI =@ MEJDKJ ?D=C
               EC JDA HA?H@A@ JEA
        JDAH =HCKAJI IAA?J F=HJE?K=H AMI EJAI
        6 FIJ = AMI EJA ?HA=JA = BEA E /lib/news
        ;K =O =HH=CA J HA?AELA AMI =KJ=JE?=O >O HACEIJAHEC OKH =E =@@HAII               E
        /sys/lib/subscribers ) @=A =EI HA?AJ AMI J = =@@HAIIAI  JDA EIJ
        -FJO AMI EJAI =@ AMI EJAI =A@ core H dead.letter =HA ECHA@
FILES
        /lib/news/*                     =HJE?AI
        $HOME/lib/newstime              @EBO JEA EI JEA AMI M=I =IJ HA=@
        /sys/lib/subscribers            MD CAJI AMI =EA@ J JDA
SOURCE
     /sys/src/cmd/news.c




                                                   #!
                                                                                                   




NAME
           =A EIJ IO> J=>A
SYNOPSIS
     nm  −aghnsTu  file ...
DESCRIPTION
      Nm FHEJI JDA =A EIJ B A=?D ANA?KJ=>A H >A?J file E JDA =HCKAJ EIJ 1B JDA file EI =
      =H?DELA IAA ar JDA =A EIJ B A=?D BEA E JDA =H?DELA EI FHEJA@ 1B HA JD= A BEA EI CELA
      E JDA =HCKAJ EIJ JDA =A B A=?D BEA EI FHEJA@ =J JDA >ACEEC B A=?D EA
        -=?D IO> =A EI FHA?A@A@ >O EJI DAN=@A?E= L=KA >=I EB K@ABEA@ =@ A B JDA AJ
        JAHI
        T      JANJ IACAJ IO>
        t      IJ=JE? JANJ IACAJ IO>
        L      A=B BK?JE JANJ IACAJ IO>
        l      IJ=JE? A=B BK?JE JANJ IACAJ IO>
        D      @=J= IACAJ IO>
        d      IJ=JE? @=J= IACAJ IO>
        B      >II IACAJ IO>
        b      IJ=JE? >II IACAJ IO>
        a      =KJ=JE? ?= L=HE=>A IO>
        p      BK?JE F=H=AJAH IO>
        z      IKH?A BEA =A
        Z      IKH?A BEA EA BBIAJ
        f      IKH?A BEA =A ?FAJI
        6DA KJFKJ EI IHJA@ =FD=>AJE?=O
        FJEI =HA
        −a     2HEJ = IO>I H=O O KIAH@ABEA@ JANJ @=J= =@ >II IACAJ IO>I =HA
               FHEJA@
        −g     2HEJ O C>= T L D B IO>I
        −h     , J FHEJ BEA =A DA=@AHI MEJD KJFKJ EAI
        −n     5HJ =??H@EC J JDA =@@HAII B JDA IO>I
        −s     , J IHJ FHEJ E IO>J=>A H@AH
        −T     2HABEN A=?D EA MEJD JDA IO> I JOFA IEC=JKHA
        −u     2HEJ O K@ABEA@ IO>I
SOURCE
     /sys/src/cmd/nm.c
SEE ALSO
      ar 2l db acid a.out$




                                                     #"
5                                                                                                  5




NAME
        I   @EIF=O =A IF=?A
SYNOPSIS
     ns  −r   pid 
DESCRIPTION
      Ns FHEJI = HAFHAIAJ=JE B JDA BEA =A IF=?A B JDA FH?AII MEJD JDA =A@ pid H >O @AB=KJ
      EJIAB 6DA KJFKJ EI E JDA BH B = rc I?HEFJ JD=J ?K@ E FHE?EFA HA?HA=JA JDA =A IF=?A
      6DA KJFKJ EI FH@K?A@ >O HA=@EC =@ HABH=JJEC JDA ?JAJI B /proc/pid/ns.
        *O @AB=KJ ns HAMHEJAI JDA =AI B AJMH @=J= BEAI J HAFHAIAJ JDA AJMH =@@HAII JD=J @=J=
        BEA EI ?A?JA@ J BH AN=FA HAF=?EC /net/tcp/82/data MEJD tcp!123.122.121.9
        6DA −r B=C IKFFHAIIAI JDEI HAMHEJEC
FILES
        /proc/*/ns
SOURCE
     /sys/src/cmd/ns.c
SEE ALSO
      ps proc! namespace" namespace$
BUGS
        6DA =AI B BEAI FHEJA@ >O ns ME >A E=??KH=JA EB = BEA H @EHA?JHO EJ E?K@AI D=I >AA
        HA=A@




                                                    ##
2                                                                                                  2




NAME
       F   F=CE=JA
SYNOPSIS
     p  −number   file ... 
DESCRIPTION
      P ?FEAI EJI IJ=@=H@ EFKJ H JDA =A@ BEAI EB CELA J EJI IJ=@=H@ KJFKJ IJFFEC =J JDA A@
      B ALAHO     @ EA =@ >AJMAA BEAI J M=EJ BH = AMEA BH JDA KIAH 6DA FJE IAJI JDA
      number B EAI  = F=CA
       9DEA M=EJEC BH = AMEA p EJAHFHAJI JDA ?=@I
       !      2=II JDA HAIJ B JDA EA J JDA IDA =I = ?=@
       q      3KEJ
SOURCE
     /sys/src/cmd/p.c




                                                   #$
2)/-                                                                                           2)/-




NAME
       F=CA   LEAM .): E=CA CH=FDE? 2IJ5?HEFJ 2,. =@ JOFAIAJJAH KJFKJ BEAI
SYNOPSIS
     page  −abirPRvVw   −p ppi   file 
DESCRIPTION
      Page EI = CAAH= FKHFIA @?KAJ LEAMAH 1J ?= >A KIA@ J @EIF=O JDA E@ELE@K= F=CAI B =
      2IJ5?HEFJ 2,. H tex H troff @ALE?A E@AFA@AJ KJFKJ BEA Tex H troff KJFKJ EI IEFO
      ?LAHJA@ J 2IJ5?HEFJ E H@AH J >A LEAMA@ 1J ?= =I >A KIA@ J LEAM =O K>AH B CH=FDE?I
      BEAI IK?D =I = .): F=CA = 2= ' image$ BEA = 1BAH >EJ=F BEA H JDAH ? BH=J
      Page @EIF=OI JDAIA E IAGKA?A 1 JDA =>IA?A B =A@ BEAI page HA=@I A BH IJ=@=H@
      EFKJ
       *O @AB=KJ page HKI E JDA ME@M E MDE?D EJ EI IJ=HJA@ =@ A=LAI JDA ME@M K?D=CA@ 6DA
       −R FJE ?=KIAI page J CHM JDA ME@M EB A?AII=HO J @EIF=O JDA F=CA >AEC LEAMA@ 6DA −w
       FJE ?=KIAI page J ?HA=JA = AM ME@M BH EJIAB 6DA AMO ?HA=JA@ ME@M ME CHM =I
       K@AH JDA −R FJE 1B >AEC KIA@ J @EIF=O KJEF=CA @?KAJI O A BEA =O >A IFA?EBEA@
        JDA ?=@ EA
       6DA −p FJE IAJI JDA HAIKJE BH 2IJ5?HEFJ =@ 2,. BEAI E FENAI FAH E?D 6DA @AB=KJ EI
        FFE 6DA −r FJE HALAHIAI JDA H@AH E MDE?D F=CAI =HA @EIF=OA@
       9DA LEAMEC = @?KAJ page ME JHO J CKAII JDA JHKA >K@EC >N KIK=O HK@EC KF BH
       JDA BEA I >K@EC >N J &    H )" IEA 6DA −b FJE ?=KIAI EJ J HAIFA?J JDA >K@EC
       >N CELA E JDA BEA )I = HA CAAH= FH>A IA 2IJ5?HEFJ BEAI ?=E J ?BH J
       )@>A I ,?KAJ 5JHK?JKHEC +LAJEI >KJ @ J 6DA −P FJE A=>AI = IECDJO IMAH
       =@ IECDJO HA IAFJE?= LAHIE B JDA 2IJ5?HEFJ FH?AIIEC ?@A 7BHJK=JAO JDAHA =HA
       2IJ5?HEFJ @?KAJI JD=J ?= O >A LEAMA@ MEJD JDA −P FJE =@ JDAHA =HA 2IJ5?HEFJ @?K
       AJI JD=J ?= O >A LEAMA@ MEJDKJ EJ
       9DA LEAMEC E=CAI MEJD page EJ EIJAI J JDA image FK>EC ?D=A IAA plumber" BH
       HA E=CAI J @EIF=O 6DA −i FJE ?=KIAI page J J =@ =O CH=FDE?I BEAI H J HA=@
       BH IJ=@=H@ EFKJ >KJ H=JDAH J EIJA BH AI J =@ BH JDA FK>EC ?D=A
       6DA −v FJE JKHI  ANJH= @A>KCCEC KJFKJ =@ JDA −V FJE JKHI  ALA HA @A>KCCEC
       KJFKJ 6DA −a FJE ?=KIAI page J ?= abort  H=JDAH JD= ANEJ ?A=O  AHHHI J B=?EEJ=JA
       @A>KCCEC
       2HAIIEC =@ D@EC >KJJ  FAHEJI F=EC =>KJ JDA F=CA
       *KJJ H=EIAI = AK B FAH=JEI  JDA ?KHHAJ E=CA H JDA AJEHA IAJ 6DA E=CA JH=IBH
       =JEI =HA @AIJHK?JELA =@ =HA L=E@ O BH JDA ?KHHAJO @EIF=OA@ E=CA 6DAO =HA IJ =I
       I =I =JDAH E=CA EI @EIF=OA@ 6DA >KJJ AK FAH=JEI =HA
       Orig size
               4AIJHAI JDA E=CA J JDA HECE= ) @EBE?=JEI =HA IJ
       Zoom    2HFJI JDA KIAH J IMAAF = HA?J=CA  JDA E=CA MDE?D EI ANF=@A@ FHFHJE=O
               J JDA HA?J=CA
       Fit window
               4AIEAI JDA E=CA I JD=J EJ BEJI E JDA ?KHHAJ ME@M
       Rotate 90
               4J=JAI JDA E=CA ' @ACHAAI ??MEIA
       Upside down
               6CCAI MDAJDAH E=CAI =HA @EIF=OA@ KFIE@A@M
       Next    ,EIF=OI JDA ANJ F=CA
       Prev    ,EIF=OI JDA FHALEKI F=CA
       Zerox   ,EIF=OI JDA ?KHHAJ E=CA E = AM F=CA ME@M 7IABK BH IAA?JEC EFHJ=J F=CAI
               BH =HCA @?KAJI
       Reverse 4ALAHIAI JDA H@AH E MDE?D F=CAI =HA @EIF=OA@
       Write   9HEJAI JDA E=CA J BEA
       *KJJ ! H=EIAI = AK B JDA F=CAI J >A IAA?JA@ BH LEAMEC E =O H@AH




                                                   #%
2)/-                                                                                             2)/-



       6OFEC = q H ?JH, ANEJI JDA FHCH= 6OFEC = u JCCAI MDAJDAH E=CAI =HA @EIF=OA@
       KFIE@A@M 6DEI EI KIABK E JDA ? ?=IA B EIJH=IEJJA@ KFIE@A@M B=NAI 6OFEC
       = r HALAHIAI JDA H@AH E MDE?D F=CAI =HA @EIF=OA@ 6OFEC = w ME MHEJA JDA ?KHHAJO LEAMA@
       F=CA J = AM BEA =I = ?FHAIIA@ image$ BEA 9DA FIIE>A JDA BEA=A EI B JDA BH
       basenamepagenumbit 6OFEC = d HALAI = E=CA BH JDA MHEC IAJ
       6 C J = IFA?EBE? F=CA A ?= JOFA EJI K>AH BMA@ >O AJAH 6OFEC ABJ =HHM >=?IF=?A
       H EKI @EIF=OI JDA FHALEKI F=CA 6OFEC HECDJ =HHM IF=?A H AJAH @EIF=OI JDA ANJ F=CA
       6DA KF =@ @M =HHM F= KF =@ @M A D=B I?HAA DAECDJ ?D=CEC F=CAI MDA F=EC
       BB JDA JF H >JJ B JDA F=CA
       Page ?=I gs J @H=M A=?D F=CA B 2IJ5?HEFJ =@ 2,. files 1J =I ?=I = L=HEAJO B ?LAHIE
       FHCH=I IK?D =I JDIA @AI?HE>A@ E jpg J ?LAHJ JDA L=HEKI H=IJAH CH=FDE?I BH=JI EJ
       1BAH >EJ=F BEAI 2=CAI =HA ?LAHJA@  JDA BO =I AA@A@
EXAMPLES
     page /sys/src/cmd/gs/examples/tiger.eps
          ,EIF=O = ?H 2IJ5?HEFJ BEA
       page /usr/inferno/icons/*.bit
            *HMIA JDA 1BAH >EJ=F E>H=HO
       man −t page | page −w
            2HALEAM JDEI =K= E = AM ME@M
SEE ALSO
      gs jpg tex troff
SOURCE
     /sys/src/cmd/page
DIAGNOSTICS
     6DA KIA ?KHIH ?D=CAI J = =HHM =@ AEFIEI MDA page EI HA=@EC H MHEJEC = BEA
BUGS
       Page IKFFHJI HA=@EC B O A @?KAJ BEA =J = JEA =@ JDA KIAH EJAHB=?A EI ?KIO MDA
       LEAMEC LAHO =HCA @?KAJI
       9DA LEAMEC KJEF=CA 2IJ5?HEFJ BEAI JD=J @ J ?J=E %%Page ?AJI JDA >KJJ !
       AK O ?J=EI JDEI F=CA =@ ANJ F=CA  ?HHA?JO @AJAHEEC F=CA >K@=HEAI E
       2IJI?HEFJ ?@A EI J ?FKJ=>A E JDA CAAH= ?=IA
       1B page D=I JHK>A LEAMEC = 2IJI?HEFJ BEA EJ ECDJ J >A AN=?JO ?BHEC JHO LEAMEC EJ MEJD
       JDA −P FJE
       6DA EJAHB=?A J JDA FK>AH EI KI=JEIB=?JHO 1 F=HJE?K=H @?KAJ HABAHA?AI ?=J >A IAJ
       LE= FK>EC AII=CAI
       6DAHA =HA J =O AO>=H@ ?=@I




                                                    #&
2)559,                                                                                    2)559,




NAME
       F=IIM@ AJAO   ?D=CA H LAHEBO KIAH F=IIMH@
SYNOPSIS
     passwd  username(domain 
       netkey
DESCRIPTION
      Passwd ?D=CAI JDA ELAH I 2= ' F=IIMH@ =@H )22 IA?HAJ 6DA 2= ' F=IIMH@ EI KIA@
      J CE J = JAHE= MDEA JDA )22 IA?HAJ EI KIA@ BH = K>AH B ANJAH= IAHLE?AI 22! 1)2
      =@ 82 =??AII 6DA FJE= =HCKAJ IFA?EBEAI JDA KIAH =A =@ =KJDAJE?=JE @=E J KIA
      EB @EBBAHAJ JD= JDA A =II?E=JA@ MEJD JDA =?DEA passwd EI HK 
       6DA FHCH= BEHIJ FHFJI BH JDA @ 2= ' F=IIMH@ E JDA IFA?EBEA@ @=E J AIJ=>EID E@A
       JEJO 1J JDA FHFJI BH ?D=CAI J JDA F=IIMH@ =@ JDA IA?HAJ AM F=IIMH@I =@ IA?HAJI
       KIJ >A JOFA@ JME?A J BHAIJ= EIJ=AI AM F=IIMH@I KIJ >A IKBBE?EAJO D=H@ J CKAII
       6DAO =O >A B =O ACJD CHA=JAH JD= IALA ?D=H=?JAHI
       Netkey FHFJI BH = F=IIMH@ J A?HOFJ AJMH ?D=ACAI 1J EI = IK>IJEJKJA BH = 5A?KHAAJ
       >N
       6DAIA ?=@I =O >A HK O  = JAHE= J =LE@ JH=IEJJEC ?A=H JANJ F=IIMH@I LAH
       JDA AJMH
SOURCE
     /sys/src/cmd/auth/passwd.c
     /sys/src/cmd/auth/netkey.c
SEE ALSO
      readnvram E authsrv  encrypt  cons! auth& securenet&
       4>AHJ HHEI =@ A 6DFI 71: 2=IIMH@ 5A?KHEJO         AT&T Bell Laboratories Technical
       Journal 8 $! '&" FF $"'$%
BUGS
       M JD=J cpu ?A?JEI =HA =M=OI A?HOFJA@ JDA O C@ HA=I J HAGKEHA JD=J JDAIA ?
       =@I >A HK O  JAHE=I EI ??AH JD=J JDA +27 IAHLAH ECDJ >A IK>LAHJA@




                                                  #'
2)6+0                                                                                               2)6+0




NAME
       F=J?D   IEFA F=J?D ?HA=JE =@ JH=?EC IOIJA
SYNOPSIS
     patch/create name email files ...  < description 
       patch/list  name ... 
       patch/diff name
       patch/apply name
       patch/undo name
       patch/note name  < note 
DESCRIPTION
      6DAIA I?HEFJI =HA = IEFA F=J?D IK>EIIE =@ JH=?EC IOIJA KIA@ J FHFIA =@@EJEI H
      ?D=CAI J 2= ' 6DAHA EI  CK=H=JAA JD=J =O F=J?D ME >A =??AFJA@ H JD=J EJ ME >A
      =??AFJA@ LAH>=JE -=?D F=J?D D=I = name MAH?=IA AJJAHI K>AHI @=ID @J =@ K@AHI?HA
      O =@ EI IJHA@ E /n/sources/patch/name.
       Patch/create ?HA=JAI = AM F=J?D ?IEIJEC B JDA ?D=CAI J JDA EIJA@ BEAI BH JDA @EIJHE>KJE
       HA=@EC = @AI?HEFJE B JDA F=J?D BH IJ=@=H@ EFKJ FA=IA FHLE@A = ANF==JE B MD=J JDA
       ?D=CA EI IKFFIA@ J @ IA ?JANJ =@ = H=JE=A BH JDA ?D=CA 6AIJ @=J= H FEJAHI J
       I=A J LAHEBO JD=J JDA BEN MHI =HA =I MA?A 9DA IA@EC = F=J?D BM JDAIA CKE@AEAI
           *ABHA FHAF=HEC JDA F=J?D HK replica/pull =@ >=IA OKH F=J?D  ?KHHAJ @EIJHE>KJE IKH?A
           ?@A
           1B JDEI EI = >KC BEN ANF=E JDA >KC ?A=HO , J =IIKA JDA >KC EI >LEKI BH JDA BEN
           1B JDEI EI = AM BA=JKHA ANF=E EJ ?A=HO , J =IIKA EJ EI >LEKI BH JDA ?D=CA
           =A JDA AM ?@A  =I K?D EA JDA @ ?@A =I FIIE>A @ J =A CH=JKEJKI ?D=CAI
           =@ @ BM JDA IJOA B JDA @ ?@A 5AA style$ BH JDA ?=E?= 2= ' ?@EC IJOA
           1B OKH F=J?D ?D=CAI ANJAH=OLEIE>A >AD=LEKH KF@=JA JDA =K= F=CA
       6DA email =@@HAII EB J − ME >A IAJ JEBE?=JE AII=CAI MDA JDA F=J?D EI =FFEA@ HAA?JA@
       H ?AJA@  1B HAA?JA@ JDA A=E ME ?J=E = JA ANF=EEC MDO =@ FH>=>O EIJEC
       IKCCAIJA@ ?D=CAI =@ A?KH=CEC OK J HAIK>EJ
       Patch/list @EIF=OI EBH=JE =>KJ JDA =A@ F=J?DAI H = ?KHHAJO FA@EC F=J?DAI EB A
       =HA IFA?EBEA@
       Patch/diff IDMI = F=J?D =I @EBBI >AJMAA JDA HECE= IKH?A BEAI =@ JDA F=J?DA@ IKH?A BEAI
       Patch/apply =FFEAI JDA F=J?D J JDA ?KHHAJ IKH?A JHAA 1J EI EJA@A@ J >A HK >O JDA 2= '
       @ALAFAHI MEJD pie =I JDAEH HJ BEA IOIJA 1B JDA IKH?A D=I ?D=CA@ IE?A JDA F=J?D M=I ?HA
       =JA@ apply ME HAFHJ JDA ?BE?J =@ J ?D=CA =O BEAI *ABHA ?D=CEC =O BEAI patch/apply
       =AI >=?KF ?FEAI B JDA ?KHHAJ IKH?A JHAA I BEAI 6DA >=?KFI =HA IJHA@ E JDA F=J?D @EHA?
       JHO
       Patch/undo ME ?FO JDA >=?KFI I=LA@ >O patch/apply >=? EJ JDA IKH?A JHAA 1J ME J
       HAIJHA = >=?KF EB JDA BEA >AEC HAF=?A@ EI J >OJAE@AJE?= J JDA A ?HA=JA@ >O patch/apply.
EXAMPLES
     2HFIA = ?D=CA J pwd MDE?D OK D=LA @EBEA@ ?=O
               % patch/create pwd−errors user@host.dom /sys/src/cmd/pwd.c
               Fix pwd to print errors to fd 2 rather than 1.
               ^D
               %
       6DA JDA @ALAFAHI =J *A =>I HK
               patch/diff pwd−errors
       J EIFA?J JDA ?D=CA FIIE>O LEAMEC /n/sources/patch/pwd−errors/pwd.c J IAA JDA
       =HCAH ?JANJ 6 =A JDA ?D=CA JDAO HK




                                                     $
2)6+0                                                                2)6+0



               patch/apply pwd−errors
        JDAHMEIA JDAO HK
               % patch/note pwd−errors
               Pwd should definitely print errors to fd 1 because ...
               ^D
               %
        J =@@ = JA J JDA /n/sources/pwd−errors/notes BEA
FILES
        /n/sources/patch
SOURCE
     /rc/bin/patch
SEE ALSO
      diff
      http://plan9.bell−labs.com/wiki/plan9/How_to_contribute




                                            $
2++                                                                                                 2++




NAME
         F??     )2- + ?FEAH @HELAH
SYNOPSIS
     pcc  option ...   name ... 
DESCRIPTION
      Pcc ?FEAI =@ =@I + FHCH=I KIEC )2- )51 +251: E?K@A BEAI =@ E>H=HEAI =A@
      BEAI A@EC MEJD .c =HA FHAFH?AIIA@ MEJD cpp JDA ?FEA@ MEJD A B JDA ?FEAHI
      @AI?HE>A@ E 2c =I IFA?EBEA@ >O JDA ALEHAJ L=HE=>A $objtype 6DA >A?J BEAI =HA JDA
      =@A@ KIEC A B JDA =@AHI @AI?HE>A@ E 2l 6DA FJEI =HA
         −+               )??AFJ + // ?AJI
         −o out           2=?A =@AH KJFKJ E BEA out EIJA=@ B JDA @AB=KJ 2.out v.out AJ?
         −P               EJ JDA ?FE=JE =@ =@EC FD=IAI A=LA JDA HAIKJ B FHAFH?AIIEC
                          name.c E name.i
         −E               EA −P >KJ IA@ JDA HAIKJ J IJ=@=H@ KJFKJ
         −c               EJ JDA =@EC FD=IA
         −p               1IAHJ FHBEEC ?@A EJ JDA ANA?KJ=>A KJFKJ
         −w               2HEJ ?FEAH M=HEC AII=CAI
         −llib            1?K@A /$objtype/lib/ape/liblib.a =I = E>H=HO @KHEC JDA EEC FD=IA
         −B               , J ?F=E =>KJ BK?JEI KIA@ MEJDKJ )51 BK?JE FHJJOFAI
         −V               -=>A void* ?LAHIE M=HECI =I E 2c
         −v               -?D JDA FHAFH?AIIEC ?FEEC =@ =@EC ?=@I >ABHA JDAO =HA ANA
                          ?KJA@
         −Dname=def
         −Dname     ,ABEA JDA name J JDA FHAFH?AIIH =I EB >O #define 1B  @ABEEJE EI CELA
                    JDA =A EI @ABEA@ =I 1
         −Uname           7@ABEA JDA name J JDA FHAFH?AIIH =I EB >O #undef
         −Idir            #include BEAI MDIA =AI @ J >ACE MEJD / =HA =M=OI IKCDJ BEHIJ E JDA
                          @EHA?JHO B JDA file =HCKAJ JDA E @EHA?JHEAI =A@ E −I FJEI JDA E
                          /$objtype/include/ape
         −N               , J FJEEA ?FEA@ ?@A
         −S               2HEJ = =IIA>O =CK=CA LAHIE B JDA >A?J ?@A  IJ=@=H@ KJFKJ
         −a               1IJA=@ B ?FEEC FHEJ  IJ=@=H@ KJFKJ =?E@ BK?JEI IAA acid BH
                          AN=EEC IJHK?JKHAI @A?=HA@ E JDA IKH?A BEAI
         −aa              EA −a AN?AFJ JD=J BK?JEI BH IJHK?JKHAI @A?=HA@ E E?K@A@ DA=@AH BEAI =HA
                          EJJA@
         −F               -=>A L=H=HC JOFA ?DA?EC =I @AI?HE>A@ E 2c 6DEI EI B EEJA@ KIA MEJDKJ JDA
                          =FFHFHE=JA #pragma @ABEEJEI
         6DA )2- ALEHAJ ?J=EI = B JDA E?K@A BEAI =@ E>H=HO HKJEAI IFA?EBEA@ E JDA )51 +
         IJ=@=H@ :!#''&' =I MA =I JDIA IFA?EBEA@ E JDA 1--- 2HJ=>A FAH=JEC 5OIJA 1JAHB=?A
         IJ=@=H@ 251: !'' 15 ''"# 1 H@AH J =??AII JDA 251: HKJEAI IKH?A FH
         CH=I IDK@ @ABEA JDA FHAFH?AIIH ?IJ=J _POSIX_SOURCE
FILES
         /sys/include/ape                           @EHA?JHO BH =?DEAE@AFA@AJ #include BEAI
         /$objtype/include/ape                      @EHA?JHO BH =?DEA@AFA@AJ #include BEAI
         /$objtype/lib/ape/libap.a                  )51 +251: E>H=HO
SEE ALSO
      cpp 2c 2a 2l mk nm acid db prof




                                                       $
2++                                                                                               2++



         0M=H@ 6HE?AO )2-      6DA )51251: -LEHAJ
SOURCE
     /sys/src/cmd/pcc.c
BUGS
         6DA ?=A =EFK=JE BK?JEI =HA EE= 5EC= BK?JEI =@ JAHE= ?D=H=?JAHEIJE? D=
         @AHI =HA O EE=O EFAAJA@ Link =M=OI B=EI >A?=KIA 2= ' @AI J IKFFHJ KJEFA
         EI J = BEA 6DA BK?JEI HA=JA@ J IAJJEC ABBA?JELA KIAH =@ CHKF E@I ?=J >A EFAAJA@
         >A?=KIA JDA ??AFJ @AI J ANEIJ E 2= '




                                                     $!
21+                                                                                                 21+




NAME
         FE? JFE?   JHBB =@ JAN FHAFH?AIIHI BH @H=MEC FE?JKHAI
SYNOPSIS
     pic  files 
         tpic  files 
DESCRIPTION
      Pic EI = troff FHAFH?AIIH BH @H=MEC BECKHAI  = JOFAIAJJAH Pic ?@A EI ?J=EA@ >AJMAA
      .PS =@ .PE EAI
                 .PS optional−width optional−height
                 element−list
                 .PE
         H E = BEA AJEA@ E = .PS EA
                 .PS <file
         1B optional−width EI FHAIAJ JDA FE?JKHA EI =@A JD=J =O E?DAI ME@A HAC=H@AII B =O @EA
         IEI KIA@ EJAH=O 6DA DAECDJ EI I?=A@ E JDA I=A FHFHJE KAII optional−height EI FHA
         IAJ 1B .PF EI KIA@ EIJA=@ B .PE JDA JOFAIAJJEC FIEJE =BJAH FHEJEC EI HAIJHA@ J MD=J EJ
         M=I KF AJHO
         ) element−list EI = EIJ B AAAJI
                primitive attribute−list
                placename : element
                placename : position
                var = expr
                direction
                { element−list }
                [ element−list ]
                for var = expr to expr by expr do { anything }
                if expr then { anything } else { anything }
                copy file, copy thru macro, copy file thru macro
                sh { commandline }
                print expr
                reset optional var−list
                troff−command
         -AAJI =HA IAF=H=JA@ >O AMEAI H IAE?I = C AAAJ =O >A ?JEKA@ >O A@EC JDA
         EA MEJD = >=?I=ID +AJI =HA EJH@K?A@ >O = # =@ JAHE=JA@ >O = AMEA 8=HE=>A
         =AI >ACE MEJD = MAH ?=IA AJJAH F=?A =AI >ACE MEJD KFFAH ?=IA 2=?A =@ L=HE=>A
         =AI HAJ=E JDAEH L=KAI BH A FE?JKHA J JDA ANJ
         )BJAH A=?D FHEEJELA JDA ?KHHAJ FIEJE LAI E JDA ?KHHAJ @EHA?JE updown leftright
         @AB=KJ >O JDA IEA B JDA FHEEJELA 6DA ?KHHAJ FIEJE =@ @EHA?JE =HA I=LA@ KF AJHO J =
         {} >? =@ HAIJHA@ KF ANEJ -AAJI MEJDE = >? A?IA@ E [] =HA JHA=JA@ =I =
         KEJ JDA @EAIEI =HA @AJAHEA@ >O JDA ANJHAA FEJI B JDA ?J=EA@ >A?JI =AI L=HE
         =>AI =@ @EHA?JE B JE MEJDE = >? =HA ?= J JD=J >?
         Troff−command EI =O EA JD=J >ACEI MEJD = FAHE@ 5K?D = EA EI =IIKA@ J =A IAIA E JDA
         ?JANJ MDAHA EJ =FFA=HI CAAH=O JDEI A=I O IEA =@ BJ ?D=CAI
         6DA primitive >A?JI =HA
                box circle ellipse                arc    line     arrow     spline      move     text−list
         arrow EI = IOO BH line −>
         ) attribute−list EI = IAGKA?A B AH H HA =JJHE>KJAI A=?D =JJHE>KJA ?IEIJI B = AOMH@
         FAHD=FI BMA@ >O = L=KA
                 h(eigh)t expr                   wid(th) expr
                 rad(ius) expr                   diam(eter) expr
                 up opt−expr                     down opt−expr
                 right opt−expr                  left opt−expr
                 from position                   to position



                                                      $"
21+                                                                                                 21+



                   at position                      with corner
                   by expr, expr                    then
                   dotted opt−expr                  dashed opt−expr
                   chop opt−expr                    −> <− <−>
                   invis                            same
                   fill opt−expr
                   text−list                        expr
         EIIEC =JJHE>KJAI =@ L=KAI =HA BEA@ E BH @AB=KJI J = =JJHE>KJAI =A IAIA BH = FHE
         EJELAI EHHAAL=J AI =HA IEAJO ECHA@ 6DA =JJHE>KJA at ?=KIAI JDA CAAJHE?= ?AJAH J >A
         FKJ =J JDA IFA?EBEA@ F=?A with ?=KIAI JDA FIEJE  JDA >A?J J >A FKJ =J JDA IFA?EBEA@ F=?A
         .H EAI IFEAI =@ =H?I height =@ width HABAH J =HHMDA=@ IEA ) >=HA expr EFEAI
         JE E JDA ?KHHAJ @EHA?JE
         6ANJ EI H=O = =JJHE>KJA B IA FHEEJELA >O @AB=KJ EJ EI F=?A@ =J JDA CAAJHE?= ?AJAH B
         JDA >A?J 5J=@=A JANJ EI =I FAHEJJA@ ) JANJ EIJ EI = EIJ B JANJ EJAI
           text−item:
                  "..." positioning ...
                  sprintf("format", expr, ...) positioning ...
           positioning:
                  center ljust rjust above below
         1B JDAHA =HA KJEFA JANJ EJAI BH IA FHEEJELA JDAO =HA =HH=CA@ LAHJE?=O =@ ?AJAHA@ AN?AFJ
         =I GK=EBEA@ 2IEJEEC HAGKAIJI =FFO J A=?D EJA E@AFA@AJO 6ANJ EJAI =O ?J=E troff
         ?=@I BH IEA =@ BJ ?D=CAI ?= JEI AJ? >KJ =A IKHA JD=J JDAIA =HA >==?A@ I
         JD=J JDA AJAHEC IJ=JA EI HAIJHA@ >ABHA ANEJEC
         ) FIEJE EI KJE=JAO = x,y ?H@E=JA F=EH >KJ EJ =O >A IFA?EBEA@ E JDAH M=OI
          position:
                 expr, expr
                 place ± expr, expr
                 place ± ( expr, expr )
                 ( position, position )            x BH A y JDA JDAH
                 expr of the way >AJMAA position =@ position
                 expr  position  position 
                  position 
          place:
                  placename optional−corner
                  corner of placename
                  nth primitive optional−corner
                  corner of nth primitive
                  Here
         ) optional−corner EI A B JDA AECDJ ?F=II FEJI H JDA ?AJAH H JDA IJ=HJ H A@ B = FHEE
         JELA
           optional−corner:
                  .n .e .w .s .ne .se .nw .sw .c .start .end
           corner:
                  top bot left right start end
         -=?D >A?J E = FE?JKHA D=I = H@E= K>AH nth HABAHI J JDEI
           nth:
                  nth,    nth last
         6DA >KEJE L=HE=>AI =@ JDAEH @AB=KJ L=KAI =HA
                 boxwid 0.75                        boxht 0.5
                 circlerad 0.25                     arcrad 0.25
                 ellipsewid 0.75                    ellipseht 0.5
                 linewid 0.5                        lineht 0.5
                 movewid 0.5                        moveht 0.5
                 textwid 0                          textht 0
                 arrowwid 0.05                      arrowht 0.1
                 dashwid 0.1                        arrowhead 2
                 scale 1
         6DAIA =O >A ?D=CA@ =J =O JEA =@ JDA AM L=KAI HA=E E BH?A BH FE?JKHA J FE?JKHA



                                                      $#
21+                                                                                               21+



         KJE ?D=CA@ =C=E H HAIAJ >O = reset IJ=JAAJ 8=HE=>AI ?D=CA@ MEJDE [ =@ ] HALAHJ J
         JDAEH FHALEKI L=KA KF ANEJ BH JDA >? ,EAIEI =HA @ELE@A@ >O scale @KHEC KJFKJ
         -NFHAIIEI E pic =HA AL=K=JA@ E B=JEC FEJ ) K>AHI HAFHAIAJEC @EAIEI =HA J=A
         J >A E E?DAI
          expr:
                  expr op expr
                  − expr
                  ! expr
                  ( expr )
                  variable
                  number
                  place .x place .y place .ht place .wid place .rad
                  sin(expr) cos(expr) atan2(expr,expr) log(expr) exp(expr)
                  sqrt(expr) max(expr,expr) min(expr,expr) int(expr) rand()
          op:
                  + − * / % < <= > >= == != && ||
         6DA define =@ undef IJ=JAAJI =HA J F=HJ B JDA CH==H
                 define name { replacement text }
                 undef name
         ??KHHA?AI B $1 $2 AJ? E JDA HAF=?AAJ JANJ ME >A HAF=?A@ >O JDA ?HHAIF@EC =HCK
         AJI EB name EI ELA@ =I
                 name(arg1, arg2, ...)
         ANEIJAJ =HCKAJI =HA HAF=?A@ >O K IJHECI 4AF=?AAJ JANJ =O ?J=E AMEAI
         6DA undef IJ=JAAJ HALAI JDA @ABEEJE B = =?H
         Tpic EI = tex FHAFH?AIIH JD=J =??AFJI pic =CK=CA 1J FH@K?AI 6AN ?=@I JD=J @ABEA =
         >N ?=A@ \graph MDE?D ?J=EI JDA FE?JKHA 6DA >N =O >A KJFKJ JDEI M=O
                \centerline{\box\graph}
EXAMPLES
     arrow "input" above; box "process"; arrow "output" above
     move
     A: ellipse
         circle rad .1 with .w at A.e
         circle rad .05 at 0.5 <A.c, A.ne>
         circle rad .065 at 0.5 <A.c, A.ne>
         spline from last circle.nw left .25 then left .05 down .05
         arc from A.c to A.se rad 0.5
         for i = 1 to 10 do { line from A.s+.025*i,.01*i down i/50 }


                             EFKJ               KJFKJ
                                      FH?AII




SOURCE
     /sys/src/cmd/pic
SEE ALSO
      grap doctype troff
      * 9 AHECD=       21+ = /H=FDE?I =CK=CA         BH   6OFAIAJJEC    Unix   Research   System
      Programmer’s Manual, 6AJD -@EJE 8KA




                                                   $$
212-.1-                                                                                         212-.1-




NAME
       FEFABEA   =JJ=?D BEJAH J BEA E =A IF=?A
SYNOPSIS
     pipefile  −d   −r command   −w command  file
DESCRIPTION
      Pipefile KIAI bind  J =JJ=?D = F=EH B FEFAI J file KIEC JDA J EJAHFIA BEJAH commands
      >AJMAA JDA JHKA BEA =@ JDA IEK=JA@ BEA JD=J IK>IAGKAJO =FFA=HI E JDA =A IF=?A FJE
      −r EJAHFIAI = BEJAH JD=J ME =BBA?J JDA @=J= @AELAHA@ J FHCH=I JD=J HA=@ BH file −w EJAH
      FIAI = BEJAH JD=J ME =BBA?J JDA @=J= MHEJJA >O FHCH=I J file )J A=IJ A command KIJ >A
      IFA?EBEA@ pipefile ME EIAHJ = cat FH?AII E JDA JDAH @EHA?JE
       )BJAH pipefile D=I >AA HK JDA BEJAHI =HA AIJ=>EIDA@ BH FHCH=I JD=J IK>IAGKAJO FA JDA
       file FHCH=I =HA=@O KIEC JDA file =HA K=BBA?JA@
       Pipefile FAI JDA file JME?A ?A BH A=?D @EHA?JE 1B JDA file EI = IECAKIA @ALE?A IK?D =I
       /dev/mouse KIA JDA −d B=C J IFA?EBO JD=J JDA BEA EI J >A FAA@ ?A E ORDWR @A
EXAMPLES
     5EK=JA = @ JAHE=
               FEFABEA M JH = ) @AL?I
               H? E @AL?I @AL?I  
               A?D DA
              0-
              
       4A=O IEK=JA = @ JAHE=
               FEFABEA H JH ) = M JH = ) @AL?I
               H? E @AL?I @AL?I  
               ,)6-
              607 +6  !"# -,6 
              
SOURCE
     /sys/src/cmd/pipefile.c
SEE ALSO
      mouse&
BUGS
       6DA 1 @A B pipefile EI FA?KE=H EJ @AI J MH MA  F=E BEAI 1J EI HA=O EJA@A@ BH KIA
       MEJD ?JEKKI @ALE?AI IK?D =I /dev/cons =@ /dev/mouse Pipefile IDK@ >A HAMHEJJA J >A =
       KIAHALA BEA IOIJA
       1B JDA FHCH= KIEC JDA BEA ==CA@ >O pipefile ANEJI JDA BEJAH ME IAA -. =@ ANEJ =@ JDA BEA
       ME >A KKI=>A KJE JDA =A IF=?A EI HAF=EHA@




                                                        $%
26                                                                                          26




NAME
       FJ   CH=FDE?I BEJAH
SYNOPSIS
     plot  file ... 
DESCRIPTION
      Plot EJAHFHAJI FJJEC EIJHK?JEI IAA plot$ BH JDA files H IJ=@=H@ EFKJ @H=MEC JDA
      HAIKJI E = AMO ?HA=JA@ rio ME@M 2J FAHIEIJI KJE = AMEA EI JOFA@ E JDA ME@M 8=HE
      KI FJEI =O >A EJAHIFAHIA@ MEJD JDA file =HCKAJI JDAO J=A ABBA?J =J JDA CELA FEJ E FH
      ?AIIEC FJEI =HA
       −d            ,K>A >KBBAH =??KK=JA JDA FJ BBI?HAA =@ MHEJA J JDA I?HAA = =J ?A
                     MDA = AH=IA ?=@ EI A?KJAHA@ H =J A@ B BEA
       −e            -H=IA JDA I?HAA
       −c col        5AJ JDA BHACHK@ ?H IAA plot$ BH ?H =AI
       −f fill       5AJ JDA >=?CHK@ ?H
       −g grade      5AJ JDA GK=EJO B=?JH BH =H?I 0ECDAH CH=@AI CELA >AJJAH GK=EJO
       −p col        5AJ JDA FA ?H
       −w            2=KIA KJE = AMEA EI JOFA@  IJ=@=H@ EFKJ
       −C            +IA JDA ?KHHAJ FJ
       −W     x0,y0,x1,y1
                   5FA?EBO JDA >K@EC HA?J=CA B FJ I ME@M *O @AB=KJ EJ KIAI = #      #   ME
                   @M E JDA E@@A B JDA I?HAA
SOURCE
     /sys/src/cmd/plot
SEE ALSO
      rio plot$




                                                     $&
27*                                                                                          27*




NAME
        FK>    IA@ AII=CA J FK>AH
SYNOPSIS
     plumb  −p plumbfile   −a attributes   −s source   −d destination   −t type   −w directory 
     −i  data...
DESCRIPTION
      6DA plumb ?=@ BH=JI =@ IA@I = FK>EC AII=CA MDIA @=J= EI >O @AB=KJ JDA ?
      ?=JA=JE B JDA =HCKAJ IJHECI IAF=H=JA@ >O >=I 6DA FJEI =HA
        −p      MHEJA JDA AII=CA J plumbfile @AB=KJ /mnt/plumb/send
        −a      IAJ JDA attr BEA@ B JDA AII=CA @AB=KJ EI AFJO
        −s      IAJ JDA src BEA@ B JDA AII=CA @AB=KJ EI plumb
        −d      IAJ JDA dst BEA@ B JDA AII=CA @AB=KJ EI AFJO
        −t      IAJ JDA type BEA@ B JDA AII=CA @AB=KJ EI text
        −w      IAJ JDA wdir BEA@ B JDA AII=CA @AB=KJ EI JDA ?KHHAJ MHEC @EHA?JHO B plumb
        −i      J=A JDA @=J= BH IJ=@=H@ EFKJ H=JDAH JD= JDA =HCKAJ IJHECI 1B = action=
                =JJHE>KJA EI J JDAHMEIA IFA?EBEA@ plumb ME =@@ = action=showdata =JJHE>KJA J
                JDA AII=CA
FILES
        /usr/$user/lib/plumbing              @AB=KJ HKAI BEA
        /mnt/plumb                           KJ FEJ BH plumber"
SOURCE
     /sys/src/cmd/plumb
SEE ALSO
      plumb  plumber" plumb$




                                                    $'
23                                                                                                23




NAME
        FG FGCA FGIHL    GKAHO 256 @=J=>=IA
SYNOPSIS
     pq  −lf   −d debug   −m modules   −o format  query 
        pqgen  directory 
        pqsrv  modules 
DESCRIPTION
      Pq ?A?JI J = 1FE?EJ 4A=JE= ,=J=>=IA 14,* @EHA?JHO = HA=@O JANJ>=IA@ HA=JE=
      @=J=>=IA =@ KJFKJI JDA HA?H@I JD=J =J?D JDA GKAHO =HCKAJI 6DA @EHA?JHO ?J=?JA@ =O
      >A IFA?EBEA@ >O = modules =HCKAJ IAA dispatch% *O @AB=KJ EJ EI JDA ?HFH=JA 7+1, @EHA?
      JHO MDE?D EI = IKFAHIAJ B JDA ?HFH=JA 256 @EHA?JHO
        -=?D query =HCKAJ HAIKJI E = E@AFA@AJ GKAHO B JDA @EHA?JHO ?IEIJEC B = IAJ B EFKJ
        =JJHE>KJAI >J=EA@ BH JDA query =HCKAJ =@ = IAJ B KJFKJ =JJHE>KJAI >J=EA@ BH JDA
        KJFKJ BH=J IAA JDA −o FJE 6DA KJFKJ B = JDA GKAHEAI =HA BH=JJA@ =??H@EC J JDA
        KJFKJ BH=J =@ ??=JA=JA@  IJ=@=H@ KJFKJ
        -=?D query =HCKAJ EI = EIJ B IJHECI B JDA BH attribute=value IAF=H=JA@ >O =O K
        >AH B IAF=H=JH ?D=H=?JAHI | 1J EI = AHHH EB JDAHA EI  ?HHAIF@EC =JJHE>KJA =A 6DA
        query =HCKAJ =O >A JDA AFJO IJHEC E JDEI ?=IA = HA?H@I JD=J ?J=E JDA KJFKJ
        =JJHE>KJAI =HA HAJKHA@ 6DA FJEI =HA
        −d debug
              2HEJ EBH=JE HAC=H@EC EJAH= FAH=JEI 8=KAI BH debug H=CA BH  J ! MEJD !
              OEA@EC JDA IJ @AJ=E
        −f     +D=CAI JDA @AB=KJ KJFKJ BH=J J = HA LAH>IA  BK  A
        −l     EI IEE=H >KJ EJI JDA htel =JJHE>KJA =@ ?IKJI O 256 J 7+1, 6DEI IAAI J
               >A A?AII=HO J BE@ AN)?=JA AFOAAI
        −m modules
             +J=?J JDA @EHA?JHO IFA?EBEA@ >O JDA modules IJHEC JDA BH=J EI @AI?HE>A@ E
             dispatch% 6DA @AB=KJ L=KA BH modules EI JDA AFJO IJHEC
        −o format
              7IA JDA KJFKJ BH=J IFA?EBEA@ 5AA >AM BH = BK @AI?HEFJE
   Output Formatting
      6DA format =HCKAJ IFA?EBEA@ MEJD JDA o FJE EI KIA@ EA = print  IJHEC BH BH=JJEC
      JDA KJFKJ B @EHA?JHO GKAHEAI ) ?D=H=?JAHI =HA ?FEA@ EJAH=O AN?AFJ BH =JJHE>KJA IK>IJEJK
      JEI =@ >=?I=ID AI?=FAI 3KJEC =O >A A?AII=HO J FHALAJ IDA EJAHFHAJ=JE 6DA IO
      J=N BH =JJHE>KJA IK>IJEJKJEI EI JDEI
               % flags minimum . maximum {attribute}
        O % =@ attribute =HA HAGKEHA@ +KHO >H=?AI {} =HA HAGKEHA@ O MDA JDA attribute EI EA@E
        =JAO BMA@ >O = =FD=KAHE? Flags =O >A A H HA B JDA BMEC
          −        4ECDJ KIJEBO ABJ KIJEBE?=JE EI JDA @AB=KJ
          ^        +=FEJ=EA JDA BEHIJ AJJAH B A=?D MH@
          +        +=FEJ=EA = AJJAHI E JDA L=KA
          <        1B JDA L=KA EI AFJO @AAJA >=? J JDA =IJ \< H >ACEEC B KJFKJ
          >        1B JDA L=KA EI AFJO IEF J JDA ANJ \> H A@ B BH=J IJHEC
        Minimum EI = EJACAH CELEC JDA EEK BEA@ ME@JD 1B JDA L=KA D=I BAMAH JD= JDA EEK
        K>AH B ?D=H=?JAHI JDA BEA@ ME >A F=@@A@ MEJD >=I 6DA @AB=KJ minimum EI AH
        Maximum EI = EJACAH JD=J IFA?EBEAI JDA =NEK K>AH B ?D=H=?JAHI J >A KJFKJ BH JDA
        L=KA 1B JDA L=KA D=I HA ?D=H=?JAHI JD= JDEI K>AH JDA L=KA ME >A JHK?=JA@ ) =NEK
        B AH JDA @AB=KJ ?=KIAI = ?D=H=?JAHI J >A KJFKJ ) FAHE@ EI KIA@ J IAF=H=JA minimum =@
        maximum =@ EI O HAGKEHA@ EB maximum EI IFA?EBEA@




                                                    %
23                                                                                                 23



        6DA BMEC J=>A EIJI >=?I=ID AI?=FAI JD=J =HA HA?CEA@ >O pq
        ?AJAHJ=> ?  Escape;Meaning

        b*=?IF=?A c5KFFHAII JAHE=JEC AMEA f.HBAA@ nAMEA ooo)5+11 ?D=H=?JAH
        @ABEA@ >O = ?J= K>AH r+=HHE=CA HAJKH t6=> v8AHJE?= J=> <=HAH BH  B=C
        >=HAH BH  B=C
        Pqgen EI KIA@ J ?HA=JA E@AN BEAI BH = ANEIJEC 14,* ev% @EHA?JHO ?A E@ANA@ JDA IFAA@
        B KFI EI CHA=JO EFHLA@ 0MALAH EJ EI JDA A?AII=HO J HAHK pqgen =BJAH =O ?D=CAI =HA
        =@A J JDA ev @=J=>=IA 6DA directory EI JDA ?=JE B JDA ev @=J=>=IA 1B J = =>IKJA F=JD
        =A EJ EI EJAHFHAJA@ HA=JELA J /lib/pq
        Pqsrv EI JDA IAHLAH JD=J D=@AI E?EC 23 HAGKAIJI 1J EI A=J J >A HK >O listen& JOFE?=O
        BH 6+2 FHJ " 6DA FJE= modules =HCKAJ EI JDA I=A =I JD=J J pq =>LA
EXAMPLES
     .E@ JDA JAAFDA K>AH B AFOAA MEJD CE B liz
               pq −o %telephone ’login=liz’
        EIJ =@@HAIIAI B AFOAAI E AM AHIAO =@ 6AN=I MD =HA BKJEA
               pq −o ’%20name %25addr %state %zip’ ’status=FT|state=NJ|state=TX’
        +IKJ /sys/src/cmd/pq/example BH = HA @AJ=EA@ AN=FA
FILES
        /lib/pq/dispatch                     @AB=KJ @EIF=J?D BEA
        /rc/bin/service/tcp411               JOFE?= ?=JE BH pqsrv
SOURCE
     /sys/src/cmd/pq
     /sys/src/libpq
SEE ALSO
      listen&
DIAGNOSTICS
     Pq FHEJI = @E=CIJE? J JDA IJ=@=H@ AHHH =@ ANEJI MEJD IJ=JKI no records EB JDAHA =HA 
     =J?DAI JDAHMEIA EJ HAJKHI = IK??AIIBK IJ=JKI




                                                     %
24                                                                                                    24




NAME
        FH    FHEJ BEA
SYNOPSIS
     pr  option ...   file ... 
DESCRIPTION
      Pr FH@K?AI = FHEJA@ EIJEC B A H HA files  EJI IJ=@=H@ KJFKJ 6DA KJFKJ EI IAF=H=JA@
      EJ F=CAI DA=@A@ >O = @=JA JDA =A B JDA BEA H = IFA?EBEA@ DA=@AH =@ JDA F=CA K>AH
      9EJD  BEA =HCKAJI pr FHEJI EJI IJ=@=H@ EFKJ
        FJEI =FFO J = BMEC BEAI >KJ =O >A HAIAJ >AJMAA BEAI
        −n       2H@K?A n?K KJFKJ
        +n       *ACE FHEJEC MEJD F=CA n
        −b       *==?A ?KI  =IJ F=CA E ?=IA B KJE?K KJFKJ
        −d       ,K>A IF=?A
        −en      5AJ JDA J=> IJFI BH EFKJ JANJ ALAHO n IF=?AI
        −h       6=A JDA ANJ =HCKAJ =I = F=CA DA=@AH file >O @AB=KJ
        −in      4AF=?A IAGKA?AI B >=I E JDA KJFKJ >O J=>I KIEC J=> IJFI IAJ ALAHO n IF=?AI
        −f       7IA BH BAA@I J IAF=H=JA F=CAI
        −ln      6=A JDA ACJD B JDA F=CA J >A n EAI EIJA=@ B JDA @AB=KJ $$
        −m       2HEJ = files IEKJ=AKIO A=?D E A ?K
        −nm      K>AH JDA EAI B A=?D file 6DA KAHE? =HCKAJ m @AB=KJ # IAJI JDA ME@JD B JDA
                 EAK>AH BEA@
        −on      BBIAJ JDA ABJ =HCE n ?D=H=?JAH FIEJEI
        −p       2=@ A=?D BEA FHEJA@ J = ALA K>AH B F=CAI EB A?AII=HO .H JMIE@A@ FHEJAHI JDEI
                 ME AIKHA A=?D BEA ME IJ=HJ = AM F=CA
        −sc      5AF=H=JA ?KI >O JDA IECA ?D=H=?JAH c EIJA=@ B =ECEC JDA MEJD MDEJA IF=?A )
                 EIIEC c EI J=A J >A = J=>
        −t       , J FHEJ JDA #EA DA=@AH H JDA #EA JH=EAH H=O IKFFEA@ BH A=?D F=CA
        −wn      .H KJE?K KJFKJ J=A JDA ME@JD B JDA F=CA J >A n ?D=H=?JAHI EIJA=@ B JDA
                 @AB=KJ % 
SOURCE
     /sys/src/cmd/pr.c
SEE ALSO
      cat lp




                                                      %
24.                                                                                                24.




NAME
       FHB JFHB FHB   @EIF=O FHBEEC @=J=
SYNOPSIS
     prof  −dr   program   profile 
       tprof pid
       kprof kernel kpdata
DESCRIPTION
      Prof EJAHFHAJI BEAI FH@K?A@ =KJ=JE?=O >O FHCH=I =@A@ KIEC JDA −p FJE B 2l H
      JDAH =@AH 6DA IO> J=>A E JDA =A@ FHCH= BEA 2.out AJ? =??H@EC J $objtype
      >O @AB=KJ EI HA=@ =@ ?HHA=JA@ MEJD JDA FHBEA BEA prof.out >O @AB=KJ .H A=?D IO>
      JDA FAH?AJ=CA B JEA E IA?@I IFAJ ANA?KJEC >AJMAA JD=J IO> =@ JDA ANJ EI FHEJA@
      E @A?HA=IEC H@AH JCAJDAH MEJD JDA JEA IFAJ JDAHA =@ JDA K>AH B JEAI JD=J HKJEA M=I
      ?=A@
       7@AH FJE −d prof FHEJI JDA @O=E? ?= CH=FD B JDA J=HCAJ FHCH= =J=JEC JDA ?=I
       MEJD JDA JEA IFAJ E A=?D HKJEA =@ JDIA EJ ?=I HA?KHIELAO 6DA KJFKJ EI E@AJA@ JM
       IF=?AI BH A=?D ?= =@ EI BH=JJA@ =I
              symbol:time/ncall
       MDAHA symbol EI JDA AJHO FEJ B JDA ?= time EI E EEIA?@I =@ ncall EI JDA K>AH B JEAI
       JD=J AJHO FEJ M=I ?=A@ =J JD=J FEJ E JDA ?= CH=FD 1B ncall EI A JDA /ncall EI AE@A@
       H=O HA?KHIELA ?=I =HA ?FHAIIA@ J AAF JDA KJFKJ >HEAB FJE −r FHEJI JDA BK ?=
       CH=FD
       6DA IEA B JDA >KBBAH E program KIA@ J D@ JDA FHBEEC @=J= >O @AB=KJ  AJHEAI =O >A
       ?JHA@ >O IAJJEC JDA ALEHAJ L=HE=>A profsize >ABHA HKEC program 1B JDA >KBBAH
       BEI IK>IAGKAJ BK?JE ?=I =O J >A HA?H@A@
       6DA FHBEEC ?@A FHLE@A@ >O JDA EAH EEJE=EAI EJIAB J FHBEA JDA ?KHHAJ FE@ FH@K?EC = BEA
       ?=A@ prof.pid. 1B = FH?AII BHI O JDA F=HAJ ME ?JEKA J >A FHBEA@ .HA@ ?DE@HA
       ?= ?=KIA JDAIALAI J >A FHBEA >O ?=EC
              prof(fn, arg, entries, what)
       MDE?D ?=KIAI JDA BK?JE fnarg J >A FHBEA@ 9DA fn HAJKHI prof.pid EI FH@K?A@ BH JDA
       ?KHHAJ FH?AII FE@
       6DA ALEHAJ L=HE=>A proftype ?= >A IAJ J A B user kernel elapsed H
       sample J FHBEA JEA A=IKHA@ IFAJ E KIAH @A JEA IFAJ E KIAHAHA @A H
       A=FIA@ JEA KIEC JDA ?O?A ?KJAH H JDA JEA E KIAH @A KIEC JDA AHA I 0 ?? 6DA
       ?O?A ?KJAH EI ?KHHAJO O =L=E=>A  @AH 2+I =@  JDA 2MAH2+ ,AB=KJ FHBEEC
       A=IKHAI KIAH JEA KIEC JDA ?O?A ?KJAH EB EJ EI =L=E=>A
       Tprof EI IEE=H J prof >KJ EI EJA@A@ BH FHBEEC KJEFH?AII FHCH=I 1J KIAI JDA
       /proc/pid/profile BEA J ?A?J EIJHK?JE BHAGKA?O ?KJI BH JDA JANJ E=CA =II?E=JA@
       MEJD JDA FH?AII BH = FH?AIIAI JD=J ID=HA JD=J JANJ 1J KIJ >A HK MDEA JDA FHCH= EI IJE
       =?JELA IE?A JDA @=J= EI IJHA@ MEJD JDA HKEC FHCH= 6 A=>A tprof FHBEEC BH = CELA FH
       ?AII
              echo profile > /proc/pid?J
       =@ JDA =BJAH JDA FHCH= D=I HK BH = MDEA ANA?KJA
              tprof pid
       5E?A JDA @=J= ?A?JA@ BH tprof EI >=IA@  EJAHHKFJJEA I=FEC B JDA FHCH= ?KJAH
       tprof D=I  −d H −r FJEI
       Kprof EI IEE=H J prof >KJ FHAIAJI JDA @=J= =??KK=JA@ >O JDA AHA FHBEEC @ALE?A kprof!.
       6DA IO> J=>A BEA JD=J B JDA FAH=JEC IOIJA AHA =@ JDA @=J= BEA JOFE?=O
       /dev/kpdata KIJ >A FHLE@A@ Kprof D=I  FJEI =@ ?=J FHAIAJ @O=E? @=J=
SOURCE
     /sys/src/cmd/prof.c



                                                     %!
24.                                24.



       /sys/src/cmd/kprof.c
SEE ALSO
      2l exec  kprof!




                                 %"
24.                                                                                        24.




NAME
        FHB    JHBB KJFKJ EJAHFHAJAH
SYNOPSIS
     proof  −mmag   −/nview   −F dir   −d   file 
DESCRIPTION
      Proof HA=@I troff EJAHA@E=JA =CK=CA BH file H IJ=@=H@ EFKJ =@ IEK=JAI JDA HAIKJEC
      F=CAI  JDA I?HAA
        )BJAH = F=CA B JANJ EI @EIF=OA@ proof F=KIAI BH = ?=@ BH JDA AO>=H@ 6DA JOFA@ ?
        =@I =HA
        AMEA /  J ANJ F=CA B JANJ
        −         / >=? J JDA FHALEKI F=CA
        q         3KEJ
        pn        2HEJ F=CA n ) KJB>K@I F=CA K>AH A=I JDA A@ A=HAH J JD=J K>AH =
                  EIIEC K>AH A=I JDA ?KHHAJ F=CA = IECA@ K>AH A=I = BBIAJ J JDA ?KHHAJ
                  F=CA
        n         5=A =I pn
        c         +A=H JDA I?HAA JDA M=EJ BH =JDAH ?=@
        mmag      +D=CA JDA =CEBE?=JE =J MDE?D JDA KJFKJ EI FHEJA@ H=O EJ EI FHEJA@ MEJD =C
                  EBE?=JE ' mag# IDHEI EJ J D=B IEA mag @K>AI JDA IEA
        xval      LA ALAHOJDEC val I?HAA FENAI J JDA HECDJ ABJ EB val EI AC=JELA
        yval      LA ALAHOJDEC val I?HAA FENAI @M KF EB val EI AC=JELA
        /nview    5FEJ JDA ME@M EJ nview FEA?AI 6DA ?KHHAJ F=CA CAI EJ JDA HECDJIJ >JJ
                  IJ FEA?A =@ FHALEKI F=CAI =HA IDM E JDA JDAH FEA?AI
        −F dir    7IA dir BH BJI EIJA=@ B /lib/font/bit
        d         6CCA JDA @A>KC B=C
        6DAIA ?=@I =HA =I =L=E=>A K@AH IECDJO @EBBAHAJ BH BH = AK  >KJJ ! 6DA
        pan AK EJA =MI =H>EJH=HO FIEJEEC B JDA F=CA =BJAH IAA?JEC pan FHAII JDA KIA >KJ
        J =C=E =@ D@ EJ @M MDEA LEC JDA F=CA J JDA @AIEHA@ ?=JE 6DA F=CA ME >A HA@EI
        F=OA@ E EJI AJEHAJO MDA JDA >KJJ EI HAA=IA@ KIA >KJJ  =I F=I MEJDKJ JDA AA@ BH
        IAA?JEC BH = AK
        6DA m x y F / =@ d ?=@I =HA =I =L=E=>A =I ?=@ EA FJEI
FILES
        /lib/font/bit/*               BJI
        /lib/font/bit/MAP             DM J ?LAHJ JHBB KJFKJ BJI =@ ?D=H=?JAH =AI EJ I?HAA
                                      BJI =@ ?D=H=?JAH K>AHI
SOURCE
     /sys/src/cmd/proof
SEE ALSO
      lp gs page
       . II== =@ * 9 AHECD= 6HBB 7IAH I =K=




                                                      %#
25                                                                                                  25




NAME
        FI FIK   FH?AII IJ=JKI
SYNOPSIS
     ps  −apr 
        psu  −apr   user 
DESCRIPTION
      Ps FHEJI EBH=JE =>KJ FH?AIIAI Psu FHEJI O EBH=JE =>KJ FH?AIIAI IJ=HJA@ >O
      user @AB=KJ $user
        .H A=?D FH?AII HAFHJA@ JDA KIAH FH?AII E@ KIAH JEA IOIJA JEA IEA IJ=JA =@ ?=@
        =A =HA FHEJA@ 5J=JA EI A B JDA BMEC
        Moribund       2H?AII D=I ANEJA@ =@ EI =>KJ J D=LA EJI HAIKH?AI HA?=EA@
        Ready           JDA GKAKA B FH?AIIAI HA=@O J >A HK
        Scheding       =>KJ J >A HK
        Running        HKEC
        Queueing       M=EJEC  = GKAKA BH = HAIKH?A
        Wakeme         M=EJEC BH 1 H IA JDAH AHA ALAJ J M=A EJ KF
        Broken         @A=@ B K=JKH= ?=KIAI ECAHEC I JD=J EJ ?= >A AN=EA@
        Stopped        IJFFA@
        Stopwait       M=EJEC BH =JDAH FH?AII J IJF
        Fault          IAHLE?EC = F=CA B=KJ
        Idle           M=EJEC BH IAJDEC J @ AHA FH?AIIAI O
        New            >AEC ?HA=JA@
        Pageout        F=CEC KJ IA JDAH FH?AII
        Syscall        FAHBHEC JDA =A@ IOIJA ?=
        no resource    M=EJEC BH HA B = ?HEJE?= resource
        6DA −r B=C ?=KIAI ps J FHEJ >ABHA JDA KIAH JEA JDA A=FIA@ HA= JEA BH JDA FH?AII
        6DA −p B=C ?=KIAI ps J FHEJ =BJAH JDA IOIJA JEA JDA >=IAEA =@ ?KHHAJ FHEHEJEAI B A=?D
        FH?AII
        6DA −a B=C ?=KIAI ps J FHEJ JDA =HCKAJI BH JDA FH?AII AMEAI E =HCKAJI ME >A JH=I
        =JA@ J IF=?AI BH @EIF=O
FILES
        /proc/*/status
SOURCE
     /sys/src/cmd/ps.c
     /rc/bin/psu
SEE ALSO
      acid db kill ns proc!




                                                     %$
25 2,.                                                                                           25 2,. 




NAME
       FI F@B F@B FI    ?LAHJ >AJMAA 2IJ5?HEFJ =@ 2,.
SYNOPSIS
     ps2pdf  gs−options   input−file  output−file  
       pdf2ps  gs−options   input−file  output−file  
DESCRIPTION
      Ps2pdf =@ pdf2ps ?LAHJ BH 2IJ5?HEFJ J 2,. =@ >=? >O ELEC gs 1B output−file EI J
      IFA?EBEA@ JDAO MHEJA J IJ=@=H@ KJFKJ 1B AEJDAH input−file H output−file EI J IFA?EBEA@ JDAO
      HA=@ BH IJ=@=H@ EFKJ =@ MHEJA J IJ=@=H@ KJFKJ
       6DA gs−options =HA F=IIA@ J /DIJI?HEFJ K=JAHA@ 6DA IJ KIABK FJE J ps2pdf EI
       −dCompatibilityLevel=level MDE?D IAJI JDA LAHIE B 2,. J >A MHEJJA 6DA @AB=KJ EI
       1.2 1.3 =@ 1.4 =HA =I FIIE>A 5EE=HO JDA IJ KIABK FJE J pdf2ps EI
       −dLanguageLevel=level MDE?D IAJI JDA LAHIE B 2IJ5?HEFJ J >A MHEJJA 6DA @AB=KJ EI 2 1
       =@ 3 =HA =I FIIE>A
       Ps2pdf FH@K?AI KJFKJ ?FAJEJELA MEJD )@>A ,EIJEAH E IJ ?=IAI =@ EJ =??AFJI = JDA
       A>A@@A@ 2,.CAAH=JE DEJI JD=J )@>A ,EIJEAH @AI
       Pdf2ps FH@K?AI = 2IJ5?HEFJ BEA ?J=EEC A =HCA >EJ=F FAH F=CA .H = HA @EHA?J =@
       I=AH JH=I=JE KIA )@>A )?H>=J I −toPostScript ?=@EA FJE
SOURCE
     /rc/bin/ps2pdf
     /rc/bin/pdf2ps
SEE ALSO
      gs
BUGS
       Gs I pdfwrite IAJEAI AEJI >=@   2,.    =J                JDA   @AB=KJ    ALA          )@@EC
       ’−dCompatibilityLevel=1.4’ IDK@ ?KHA EJ




                                                    %%
272                                                                                            272




NAME
       FKF     ?FO =IO?DHKIO LE= = =HCA ?EH?K=H >KBBAH
SYNOPSIS
     pump  −b iando   −d sleepms   −f ofile   −i ireadsize   −k KB−buf   −o owritesize   −s
     start−KB   file  
DESCRIPTION
      Pump ?FEAI files H IJ=@=H@ EFKJ EB A J IJ=@=H@ KJFKJ >O KIEC JM FH?AIIAI A HA=@
      EC =@ A MHEJEC ID=HEC = =HCA ?EH?K=H >KBBAH JDKI FAHEJJEC JDA HA=@EC FH?AII J CAJ
      =DA=@ B JDA MHEJEC FH?AII EB JDA KJFKJ @ALE?A EI IM AC = FJE?= @EI? 6DEI E JKH ?=
      AAF JDA KJFKJ @ALE?A >KIO 6DA FEFAEA dd | dd ?= =FFHNE=JA JDEI >KJ FEFA >KBBAHEC EI
      EEJA@ J $" >OJAI MDE?D EI B=EHO @AIJ
       FJEI =HA
       −b     IAJI JDA IEA B read =@ write FAH=JEI J iando >OJAI 6DA @AB=KJ IEA EI & E>OJAI
       −d     ?=KIAI JDA KJFKJ FH?AII J IAAF BH sleepms EEIA?@I EEJE=O CELEC JDA HA=@EC FH
              ?AII JEA J =??KK=JA @=J= E JDA >KBBAH
       −f     MHEJAI ofile H=JDAH JD= IJ=@=H@ KJFKJ
       −i     IAJI JDA IEA B read FAH=JEI J ireadsize >OJAI
       −k     =?=JAI = ?EH?K=H >KBBAH B KB−buf E>OJAI H=JDAH JD= JDA @AB=KJ # E>OJAI
       −o     IAJI JDA IEA B write FAH=JEI J owritesize >OJAI
       −s     FHALAJI KJFKJ KJE start−KB E>OJAI D=LA >AA HA=@
EXAMPLES
     )FFA@ = venti& =HA= J = ,8, H *, GKE?O
           cdfs
           venti/rdarena arena0 arena.3 |
                  pump −b 65536 −k 51200 >/mnt/cd/wd/arena.3
SOURCE
     /sys/src/cmd/pump.c
SEE ALSO
      cp dd ecp cdfs"
BUGS
       Pump FH?AIIAI IFE MDEA M=EJEC BH JDA ?EH?K=H >KBBAH J BE H @H=E




                                                    %&
29,                                                                                         29,




NAME
       FM@ F>@    MHEC @EHA?JHO
SYNOPSIS
     pwd
     pbd
DESCRIPTION
      Pwd FHEJI JDA F=JD =A B JDA MHEC ?KHHAJ @EHA?JHO Pwd EI CK=H=JAA@ J HAJKH JDA I=A
      F=JD JD=J M=I KIA@ J AJAH JDA @EHA?JHO 1B DMALAH JDA =A IF=?A D=I ?D=CA@ H @EHA?JHO
      =AI D=LA >AA ?D=CA@ JDEI F=JD =A =O  CAH >A L=E@ 5AA fd2path  BH = @AI?HEF
      JE B pwd I A?D=EI
       Pbd FHEJI JDA >=IA =A B JDA MHEC ?KHHAJ @EHA?JHO 1J FHEJI  BE= AMEA =@ EI
       EJA@A@ BH =FFE?=JEI IK?D =I ?IJHK?JEC IDA FHFJI
SOURCE
     /sys/src/cmd/pwd.c
     /sys/src/cmd/pbd.c
SEE ALSO
      cd E rc bind intro  getwd  fd2path 




                                                    %'
4)64)+-                                                                                      4)64)+-




NAME
        H=JH=?A   JH=?A FH?AII IOIJA ?=I
SYNOPSIS
     ratrace  pid    −c command 
DESCRIPTION
      Ratrace IDMI JDA IOIJA ?=I ANA?KJA@ >O = FH?AII AEJDAH JDA A MEJD pid H = BHAID EL?=JE
      B command
        6H=?A KJFKJ EI @AJAHEA@ >O JDA AHA J ratrace +AHJ=E BENA@ HKAI =FFO 6DA BEHIJ BKH
        BEA@I B JDA KJFKJ =HA FE@ JANJ =A IOIJA ?= =A =@ JDA 2+ B JDA KIAH FHCH= ,=J= EI
        =M=OI FHEJA@ =I pointer/string MDAHA JDA string EI JDA BEHIJ ! >OJAI B JDA @=J= MEJD . HAF=?
        EC FHEJEC )5+11 ?D=H=?JAHI FHEJEC ?D=H=?JAHI =HA JDIA >AJMAA )5+11 IF=?A 52 =@
        @AAJA ,- AN?KIELA 4AJKH L=KAI BM = = =@ E?K@A JDA EJACAH HAJKH L=KA JDA errstr
        MEJD  EB JDAHA EI  errstr =@ JDA IJ=HJ =@ IJF JEAI BH JDA IOIJA ?= E =IA?@I 6DA
        JEAI =HA AN?KIELA B JDA LAHDA=@ BH JH=?EC
FILES
        /proc/pid/syscalltrace
        /proc/pid/ctl
SOURCE
     /sys/src/cmd/ratrace.c
SEE ALSO
      acid db proc!
BUGS
        6DA FHEJEC B JDA @=J= EI J EEJA@ E ACJD FHEJEC . EIJA=@ B IAJDEC HA IAIE>A EI
        EEJEC




                                                    &
4+                                                                                                  4+




NAME
        H? ?@ AL= ANA? ANEJ B=C HBH IDEBJ M=EJ MD=JEI     ?=@ =CK=CA
SYNOPSIS
     rc  −srdiIlxepvV   −c command   −m initial   file  arg ... 
DESCRIPTION
      Rc EI JDA 2= ' IDA 1J ANA?KJAI ?=@ EAI HA=@ BH = JAHE= H = BEA H MEJD JDA −c
      B=C BH rc’s =HCKAJ EIJ
  Command Lines
     ) ?=@ EA EI = IAGKA?A B ?=@I IAF=H=JA@ >O =FAHI=@I H IAE?I & H ; JAH
     E=JA@ >O = AMEA 6DA ?=@I =HA ANA?KJA@ E IAGKA?A BH ABJ J HECDJ Rc @AI J
     M=EJ BH = ?=@ BMA@ >O & J BEEID ANA?KJEC >ABHA IJ=HJEC JDA BMEC ?=@
     9DAALAH = ?=@ BMA@ >O & EI ANA?KJA@ EJI FH?AII E@ EI =IIECA@ J JDA rc L=HE=>A
     $apid 9DAALAH = ?=@ not BMA@ >O & ANEJI H EI JAHE=JA@ JDA rc L=HE=>A $status
     CAJI JDA FH?AII I M=EJ AII=CA IAA wait  EJ ME >A JDA K IJHEC EB JDA ?=@ M=I IK?
     ?AIIBK
        ) C ?=@ EA =O >A ?JEKA@  IK>IAGKAJ EAI >O JOFEC = >=?I=ID \ BMA@ >O
        = AMEA 6DEI IAGKA?A EI JHA=JA@ =I JDKCD EJ MAHA = >= *=?I=ID EI J JDAHMEIA = IFA?E=
        ?D=H=?JAH
        ) K>AHIEC # =@ =O BMEC ?D=H=?JAHI KF J >KJ J E?K@EC JDA ANJ AMEA =HA
        ECHA@ AN?AFJ E GKJ=JE =HI
  Simple Commands
     ) IEFA ?=@ EI = IAGKA?A B =HCKAJI EJAHIFAHIA@ MEJD 1 HA@EHA?JEI 1B JDA BEHIJ
     =HCKAJ EI JDA =A B = rc BK?JE H B A B rc’s >KEJE ?=@I EJ EI ANA?KJA@ >O rc
     JDAHMEIA EB JDA =A IJ=HJI MEJD = I=ID / EJ KIJ >A JDA F=JD =A B JDA FHCH= J >A ANA
     ?KJA@ =AI ?J=EEC  EEJE= I=ID =HA IA=H?DA@ BH E = EIJ B @EHA?JHO =AI IJHA@ E
     $path 6DA BEHIJ ANA?KJ=>A BEA B JDA CELA =A BK@ E = @EHA?JHO E $path EI JDA FHCH=
     J >A ANA?KJA@ 6 >A ANA?KJ=>A JDA KIAH KIJ D=LA ANA?KJA FAHEIIE IAA stat  =@ JDA BEA
     KIJ >A AEJDAH = ANA?KJ=>A >E=HO BH JDA ?KHHAJ =?DEA I +27 JOFA H = IDA I?HEFJ 5DA
     I?HEFJI >ACE MEJD = EA ?J=EEC JDA BK F=JD =A B = IDA KIK=O /bin/rc FHABENA@ >O
     #!
        6DA BEHIJ MH@ B = IEFA ?=@ ?=J >A = AOMH@ KAII EJ EI GKJA@ H JDAHMEIA @EI
        CKEIA@ 6DA AOMH@I =HA
                for in while if not switch fn ~ ! @
  Arguments and Variables
     ) K>AH B ?IJHK?JEI =O >A KIA@ MDAHA rc’s IOJ=N HAGKEHAI = =HCKAJ J =FFA=H 1
     =O ?=IAI = ?IJHK?JE I L=KA ME >A = EIJ B =HCKAJI H=JDAH JD= = IECA IJHEC
        6DA IEFAIJ E@ B =HCKAJ EI JDA KGKJA@ MH@ = IAGKA?A B A H HA ?D=H=?JAHI A
        B MDE?D EI = >= J=> AMEA H =O B JDA BMEC
                # ; & | ^ $ = ‘ ’ { } ( ) < >
        ) KGKJA@ MH@ JD=J ?J=EI =O B JDA ?D=H=?JAHI * ? [ EI = F=JJAH BH =J?DEC =C=EIJ BEA
        =AI 6DA ?D=H=?JAH * =J?DAI =O IAGKA?A B ?D=H=?JAHI ? =J?DAI =O IECA ?D=H=?JAH =@
        [class] =J?DAI =O ?D=H=?JAH E JDA class 1B JDA BEHIJ ?D=H=?JAH B class EI ~ JDA ?=II EI ?FA
        AJA@ 6DA class =O =I ?J=E F=EHI B ?D=H=?JAHI IAF=H=JA@ >O − IJ=@EC BH = ?D=H=?JAHI
        ANE?=O >AJMAA JDA JM 6DA ?D=H=?JAH / KIJ =FFA=H ANFE?EJO E = F=JJAH =I KIJ JDA BEHIJ
        ?D=H=?JAH B JDA F=JD =A ?FAJI . =@ .. ) F=JJAH EI HAF=?A@ >O = EIJ B =HCKAJI
        A BH A=?D F=JD =A =J?DA@ AN?AFJ JD=J = F=JJAH =J?DEC  =AI EI J HAF=?A@ >O JDA
        AFJO EIJ >KJ H=JDAH IJ=@I BH EJIAB 2=JJAH =J?DEC EI @A =BJAH = JDAH FAH=JEI 6DKI
                x=/tmp echo $x^/*.c
        =J?DAI /tmp/*.c H=JDAH JD= =J?DEC /*.c =@ JDA FHABENEC /tmp
        ) GKJA@ MH@ EI = IAGKA?A B ?D=H=?JAHI IKHHK@A@ >O IECA GKJAI ’ ) IECA GKJA EI HAF
        HAIAJA@ E = GKJA@ MH@ >O = F=EH B GKJAI ’’
        -=?D B JDA BMEC EI = =HCKAJ
        (arguments)
               6DA L=KA B = IAGKA?A B =HCKAJI A?IA@ E F=HAJDAIAI EI = EIJ ?FHEIEC JDA


                                                         &
4+                                                                                               4+



              A>AHI B A=?D AAAJ B JDA IAGKA?A )HCKAJ EIJI D=LA  HA?KHIELA IJHK?JKHA
              =JDKCD JDAEH IOJ=N =O IKCCAIJ EJ 6DA BMEC =HA AJEHAO AGKEL=AJ
                      echo hi there everybody
                      ((echo) (hi there) everybody)
        $argument
        $argument(subscript)
              6DA argument =BJAH JDA $ EI JDA =A B = L=HE=>A MDIA L=KA EI IK>IJEJKJA@ KJEFA AL
              AI B E@EHA?JE =HA FIIE>A >KJ B GKAIJE=>A KJEEJO 8=HE=>A L=KAI =HA EIJI B
              IJHECI 1B argument EI = K>AH n JDA L=KA EI JDA nJD AAAJ B $* KAII $* @AI J
              D=LA n AAAJI E MDE?D ?=IA JDA L=KA EI AFJO 1B argument EI BMA@ >O = F=HAJDA
              IEA@ EIJ B IK>I?HEFJI JDA L=KA IK>IJEJKJA@ EI = EIJ ?FIA@ B JDA HAGKAIJA@ AAAJI
              HECE  6DA F=HAJDAIEI KIJ BM JDA L=HE=>A =A MEJD  IF=?AI 5K>I?HEFJI ?=
              =I J=A JDA BH m−n H m− J E@E?=JA = IAGKA?A B AAAJI )IIECAJI J L=HE
              =>AI =HA @AI?HE>A@ >AM
        $#argument
              6DA L=KA EI JDA K>AH B AAAJI E JDA =A@ L=HE=>A ) L=HE=>A ALAH =IIECA@ =
              L=KA D=I AH AAAJI
        argument
              6DA L=KA EI = IECA IJHEC ?J=EEC JDA ?FAJI B JDA =A@ L=HE=>A IAF=H=JA@ >O
              IF=?AI ) L=HE=>A MEJD AH AAAJI OEA@I JDA AFJO IJHEC
        ‘{command}
              rc ANA?KJAI JDA command =@ HA=@I EJI IJ=@=H@ KJFKJ IFEJJEC EJ EJ = EIJ B =HCK
              AJI KIEC ?D=H=?JAHI E $ifs =I IAF=H=JHI 1B $ifs EI J JDAHMEIA IAJ EJI L=KA EI
              ’ \t\n’
        <{command}
        >{command}
              6DA command EI ANA?KJA@ =IO?DHKIO MEJD EJI IJ=@=H@ KJFKJ H IJ=@=H@ EFKJ ?
              A?JA@ J = FEFA 6DA L=KA B JDA =HCKAJ EI JDA =A B = BEA HABAHHEC J JDA JDAH A@
              B JDA FEFA 6DEI =MI JDA ?IJHK?JE B EA=H FEFAEAI .H AN=FA JDA BM
              EC HKI JM ?=@I old =@ new =@ KIAI cmp J ?F=HA JDAEH KJFKJI
                      cmp <{old} <{new}
        argument^argument
              6DA ^ FAH=JH ??=JA=JAI EJI JM FAH=@I 1B JDA JM FAH=@I D=LA JDA I=A K>AH
              B ?FAJI JDAO =HA ??=JA=JA@ F=EHMEIA 1B J JDA A FAH=@ KIJ D=LA A
              ?FAJ =@ JDA JDAH KIJ >A AFJO =@ ??=JA=JE EI @EIJHE>KJELA
  Free Carets
      1 IJ ?EH?KIJ=?AI rc ME EIAHJ JDA ^ FAH=JH =KJ=JE?=O >AJMAA MH@I JD=J =HA J IAF=
      H=JA@ >O MDEJA IF=?A 9DAALAH A B $ ’ ‘ BMI = GKJA@ H KGKJA@ MH@ H = KGKJA@
      MH@ BMI = GKJA@ MH@ MEJD  EJAHLAEC >=I H J=>I = ^ EI EIAHJA@ >AJMAA JDA JM 1B
      = KGKJA@ MH@ EA@E=JAO BMI = $ =@ ?J=EI = ?D=H=?JAH JDAH JD= = =FD=KAHE?
      K@AHI?HA H * = ^ EI EIAHJA@ >ABHA JDA BEHIJ IK?D ?D=H=?JAH 6DKI
               cc −$flags $stem.c
        EI AGKEL=AJ J
               cc −^$flags $stem^.c
  I/O Redirections
      6DA IAGKA?A >file HA@EHA?JI JDA IJ=@=H@ KJFKJ BEA BEA @AI?HEFJH  H=O JDA JAHE= J
      JDA =A@ file >>file =FFA@I IJ=@=H@ KJFKJ J JDA BEA 6DA IJ=@=H@ EFKJ BEA BEA @AI?HEFJH
       =I H=O JDA JAHE= =O >A HA@EHA?JA@ BH = BEA >O JDA IAGKA?A <file H BH =
      EEA DAHA @?KAJ >O JDA IAGKA?A <<eof−marker 6DA ?JAJI B = DAHA @?KAJ =HA EAI
      B JANJ J=A BH JDA ?=@ EFKJ IJHA= KF J = EA ?J=EEC JDEC >KJ JDA eof−marker
      MDE?D =O >A AEJDAH = GKJA@ H KGKJA@ MH@ 1B eof−marker EI KGKJA@ L=HE=>A =AI B JDA
      BH $word D=LA JDAEH L=KAI IK>IJEJKJA@ BH rc’s ALEHAJ 1B $word EI BMA@ >O = ?=HAJ
      ^ JDA ?=HAJ EI @AAJA@ 1B eof−marker EI GKJA@  IK>IJEJKJE ??KHI 6DA IJ=@=H@ EFKJ BEA
      =O =I >A HA@EHA?JA@ BH = BEA >O JDA IAGKA?A <>file MDE?D FAI file AN=?JO ?A BH HA=@
      EC =@ MHEJEC
        4A@EHA?JEI =O >A =FFEA@ J = BEA@AI?HEFJH JDAH JD= IJ=@=H@ EFKJ H KJFKJ >O GK=EBOEC
        JDA HA@EHA?JE FAH=JH MEJD = K>AH E IGK=HA >H=?AJI .H AN=FA JDA @E=CIJE? KJFKJ



                                                   &
4+                                                                                                   4+



        BEA @AI?HEFJH  =O >A HA@EHA?JA@ >O MHEJEC cc junk.c >[2]junk
        ) BEA @AI?HEFJH =O >A HA@EHA?JA@ J = =HA=@O FA @AI?HEFJH >O MHEJEC >[fd0=fd1],
        <>[fd0=fd1], H <[fd0=fd1] Fd1 EI = FHALEKIO FAA@ BEA @AI?HEFJH =@ fd0 >A?AI =
        AM ?FO E JDA IAIA B dup  B EJ ) BEA @AI?HEFJH =O >A ?IA@ >O MHEJEC >[fd0=] H
        <[fd0=]
        4A@EHA?JEI =HA ANA?KJA@ BH ABJ J HECDJ 6DAHABHA cc junk.c >/dev/null >[2=1]
        =@ cc junk.c >[2=1] >/dev/null D=LA @EBBAHAJ ABBA?JI JDA BEHIJ FKJI IJ=@=H@ KJFKJ
        E /dev/null =@ JDA FKJI @E=CIJE? KJFKJ E JDA I=A F=?A MDAHA JDA IA?@ @EHA?JI @E=C
        IJE? KJFKJ J JDA JAHE= =@ IA@I IJ=@=H@ KJFKJ J /dev/null
        newconn <>/net/tcp/clone >[1=0] FAI /net/tcp/clone AN=?JO ?A BH HA=@EC
        =@ MHEJEC =@ FKJI EJ  IJ=@=H@ EFKJ =@ KJFKJ lpd <>[3]/net/tcp/42/data FAI
        /net/tcp/42/data AN=?JO ?A BH HA=@EC =@ MHEJEC =@ FKJI EJ  BEA @AI?HEFJH !
  Compound Commands
     ) F=EH B ?=@I IAF=H=JA@ >O = FEFA FAH=JH | EI = ?=@ 6DA IJ=@=H@ KJFKJ B JDA
     ABJ ?=@ EI IAJ JDHKCD = FEFA J JDA IJ=@=H@ EFKJ B JDA HECDJ ?=@ 6DA FEFA FAH=
     JH =O >A @A?H=JA@ J KIA @EBBAHAJ BEA @AI?HEFJHI |[fd] ?A?JI JDA KJFKJ A@ B JDA FEFA
     J BEA @AI?HEFJH fd H=JDAH JD=  |[fd0=fd1] ?A?JI KJFKJ J fd1 B JDA ABJ ?=@ =@
     EFKJ J fd0 B JDA HECDJ ?=@
        ) F=EH B ?=@I IAF=H=JA@ >O && H || EI = ?=@ 1 AEJDAH ?=IA JDA ABJ ?=@ EI
        ANA?KJA@ =@ EJI ANEJ IJ=JKI AN=EA@ 1B JDA FAH=JH EI && JDA HECDJ ?=@ EI ANA?KJA@ EB JDA
        ABJ ?=@ I IJ=JKI EI K || ?=KIAI JDA HECDJ ?=@ J >A ANA?KJA@ EB JDA ABJ ?=@ I
        IJ=JKI EI K
        6DA ANEJ IJ=JKI B = ?=@ =O >A ELAHJA@ K EI ?D=CA@ J K K EI ?D=CA@ J
        K >O FHA?A@EC EJ MEJD = !
        6DA | FAH=JH D=I DECDAIJ FHA?A@A?A =@ EI ABJ=II?E=JELA EA >E@I JECDJAH J JDA ABJ JD=
        JDA HECDJ ! D=I EJAHA@E=JA FHA?A@A?A =@ && =@ || D=LA JDA MAIJ FHA?A@A?A
        6DA K=HO @ FAH=JH MEJD FHA?A@A?A AGK= J ! ?=KIAI EJI FAH=@ J >A ANA?KJA@ E = IK>IDA
        -=?D B JDA BMEC EI = ?=@
        if ( list ) command
               ) list EI = IAGKA?A B ?=@I IAF=H=JA@ >O & ; H AMEA 1J EI ANA?KJA@ =@ EB EJI
               ANEJ IJ=JKI EI K JDA command EI ANA?KJA@
        if not command
               6DA EA@E=JAO FHA?A@EC ?=@ KIJ D=LA >AA if(list) command 1B EJI ?@EJE
               M=I AH JDA command EI ANA?KJA@
        for(name in arguments) command
        for(name) command
               6DA command EI ANA?KJA@ ?A BH A=?D argument MEJD JD=J =HCKAJ =IIECA@ J name 1B
               JDA =HCKAJ EIJ EI EJJA@ $* EI KIA@
        while(list) command
               6DA list EI ANA?KJA@ HAFA=JA@O KJE EJI ANEJ IJ=JKI EI K -=?D JEA EJ HAJKHI K IJ=
               JKI JDA command EI ANA?KJA@ ) AFJO list EI J=A J CELA K IJ=JKI
        switch(argument){list}
               6DA list EI IA=H?DA@ BH IEFA ?=@I >ACEEC MEJD JDA MH@ case 6DA IA=H?D EI
               O =J JDA JF ALA B JDA list 6D=J EI cases E AIJA@ ?IJHK?JI =HA J BK@
               Argument EI =J?DA@ =C=EIJ A=?D MH@ BMEC case KIEC JDA F=JJAH=J?DEC =C
               HEJD @AI?HE>A@ =>LA AN?AFJ JD=J / =@ JDA BEHIJ ?D=H=?JAHI B . =@ .. AA@ J >A
               =J?DA@ ANFE?EJO 9DA = =J?D EI BK@ ?=@I E JDA EIJ =HA ANA?KJA@ KF J JDA
               ANJ BMEC case ?=@ =J JDA JF ALA H JDA ?IEC >H=?A
        {list}
               *H=?AI IAHLA J =JAH JDA CHKFEC B ?=@I EFEA@ >O FAH=JH FHEHEJEAI 6DA body EI
               = IAGKA?A B ?=@I IAF=H=JA@ >O & ; H AMEA
        fn name{list}
        fn name
               6DA BEHIJ BH @ABEAI = BK?JE MEJD JDA CELA name 5K>IAGKAJO MDAALAH = ?=@
               MDIA BEHIJ =HCKAJ EI name EI A?KJAHA@ JDA ?KHHAJ L=KA B JDA HA=E@AH B JDA
               ?=@ I =HCKAJ EIJ ME >A =IIECA@ J $* =BJAH I=LEC EJI ?KHHAJ L=KA =@ rc ME



                                                     &!
4+                                                                                                      4+



             ANA?KJA JDA list 6DA IA?@ BH HALAI name I BK?JE @ABEEJE
        fn note{list}
        fn note
             ) BK?JE MEJD = IFA?E= =A ME >A ?=A@ MDA rc HA?AELAI = ?HHAIF@EC JA IAA
             notify  6DA L=E@ JA =AI =@ ?HHAIF@EC JAI =HA sighup hangup
             sigint interrupt sigalrm alarm =@ sigfpe B=JEC FEJ JH=F *O
             @AB=KJ rc ANEJI  HA?AELEC =O IEC= AN?AFJ MDA HK EJAH=?JELAO E MDE?D ?=IA EJAH
             HKFJI =@ GKEJI H=O ?=KIA rc J IJF MD=JALAH EJ I @EC =@ IJ=HJ HA=@EC = AM ?
             =@ 6DA IA?@ BH ?=KIAI rc J D=@A = IEC= E JDA @AB=KJ =AH Rc HA?CEAI
             = =HJEBE?E= JA sigexit MDE?D ??KHI MDA rc EI =>KJ J BEEID ANA?KJEC
        name=argument command
             )O ?=@ =O >A FHA?A@A@ >O = IAGKA?A B =IIECAJI EJAHIFAHIA@ MEJD HA@EHA?
             JEI 6DA =IIECAJI HA=E E ABBA?J KJE JDA A@ B JDA ?=@ KAII JDA ?
             =@ EI AFJO EA JDA =IIECAJI IJ=@ =A E MDE?D ?=IA JDAO =HA ABBA?JELA KJE
             HAI?E@A@ >O =JAH =IIECAJI
  Built−in Commands
      6DAIA ?=@I =HA ANA?KJA@ EJAH=O >O rc KIK=O >A?=KIA JDAEH ANA?KJE ?D=CAI H
      @AFA@I  rc I EJAH= IJ=JA
      . file ...
               -NA?KJA ?=@I BH file $* EI IAJ BH JDA @KH=JE J JDA HA=E@AH B JDA =HCKAJ
               EIJ BMEC file File EI IA=H?DA@ BH KIEC $path
      builtin command ...
               -NA?KJA command =I KIK= AN?AFJ JD=J =O BK?JE =A@ command EI ECHA@ E B=LH B
               JDA >KEJE A=EC
      cd [dir]
               +D=CA JDA ?KHHAJ @EHA?JHO J dir 6DA @AB=KJ =HCKAJ EI $home dir EI IA=H?DA@ BH E
               A=?D B JDA @EHA?JHEAI AJEA@ E $cdpath
      eval [arg ...]
               6DA =HCKAJI =HA ??=JA=JA@ IAF=H=JA@ >O IF=?AI EJ = IECA IJHEC HA=@ =I EFKJ J
               rc =@ ANA?KJA@
      exec [command ...]
               6DEI EIJ=?A B rc HAF=?AI EJIAB MEJD JDA CELA >KEJE command
      flag f [+−]
               -EJDAH IAJ + ?A=H − H JAIJ AEJDAH + H − JDA B=C f MDAHA f EI = IECA ?D=H=?JAH A
               B JDA ?=@ EA B=CI IAA 1L?=JE >AM
      exit [status]
               -NEJ MEJD JDA CELA ANEJ IJ=JKI 1B A EI CELA JDA ?KHHAJ L=KA B $status EI KIA@
      rfork nNeEsfFm
               *A?A = AM FH?AII CHKF KIEC rfork(flags) MDAHA flags EI ?FIA@ B JDA >EJMEIA
               4 B JDA rfork B=CI IFA?EBEA@ >O JDA FJE AJJAHI IAA fork  1B  flags =HA CELA
               JDAO @AB=KJ J ens 6DA flags =@ JDAEH A=ECI =HA n EI RFNAMEG N EI RFCNAMEG e
               EI RFENVG E EI RFCENVG s EI RFNOTEG f EI RFFDG F EI RFCFDG =@ m EI
               RFNOMNT
      shift [n]
               ,AAJA JDA BEHIJ n @AB=KJ  AAAJI B $*
      wait [pid]
               9=EJ BH JDA FH?AII MEJD JDA CELA pid J ANEJ 1B  pid EI CELA = KJIJ=@EC FH?AIIAI
               =HA M=EJA@ BH
      whatis name ...
               2HEJ JDA L=KA B A=?D name E = BH IKEJ=>A BH EFKJ J rc 6DA KJFKJ EI = =IIECAJ
               J =O L=HE=>A JDA @ABEEJE B =O BK?JE = ?= J builtin BH =O >KEJE ?
               =@ H JDA ?FAJA@ F=JD=A B =O ANA?KJ=>A BEA
      ~ subject pattern ...
               6DA subject EI =J?DA@ =C=EIJ A=?D pattern E IAGKA?A 1B EJ =J?DAI =O F=JJAH
               $status EI IAJ J AH JDAHMEIA $status EI IAJ J A 2=JJAHI =HA JDA I=A =I BH
               BEA =A =J?DEC AN?AFJ JD=J / =@ JDA BEHIJ ?D=H=?JAH B . =@ .. AA@ J >A =J?DA@
               ANFE?EJO 6DA patterns =HA J IK>A?JA@ J BEA =A =J?DEC >ABHA JDA ~ ?=@ EI
               ANA?KJA@ I JDAO AA@ J >A A?IA@ E GKJ=JE =HI




                                                      &"
4+                                                                                                  4+



  Environment
      6DA environment EI = EIJ B IJHECI =@A =L=E=>A J ANA?KJEC >E=HEAI >O JDA env @ALE?A IAA
      env! Rc ?HA=JAI = ALEHAJ AJHO BH A=?D L=HE=>A MDIA L=KA EI AFJO =@ BH A=?D
      BK?JE 6DA IJHEC BH = L=HE=>A AJHO D=I JDA L=HE=>A I =A BMA@ >O = =@ EJI L=KA 1B JDA
      L=KA D=I HA JD= A ?FAJ JDAIA =HA IAF=H=JA@ >O ?JH= ’\001’ ?D=H=?JAHI 6DA
      IJHEC BH = BK?JE EI KIJ JDA rc EFKJ JD=J @ABEAI JDA BK?JE 6DA =A B = BK?JE E JDA
      ALEHAJ EI JDA BK?JE =A FHA?A@A@ >O fn#
        9DA rc IJ=HJI ANA?KJEC EJ HA=@I L=HE=>A =@ BK?JE @ABEEJEI BH EJI ALEHAJ
  Special Variables
      6DA BMEC L=HE=>AI =HA IAJ H KIA@ >O rc
      $*           5AJ J rc I =HCKAJ EIJ @KHEC EEJE=E=JE 9DAALAH = . ?=@ H = BK?JE
                   EI ANA?KJA@ JDA ?KHHAJ L=KA EI I=LA@ =@ $* HA?AELAI JDA AM =HCKAJ EIJ 6DA
                   I=LA@ L=KA EI HAIJHA@  ?FAJE B JDA . H BK?JE
      $apid        9DAALAH = FH?AII EI IJ=HJA@ =IO?DHKIO MEJD & $apid EI IAJ J EJI FH?AII E@
      $home        6DA @AB=KJ @EHA?JHO BH cd
      $ifs         6DA EFKJ BEA@ IAF=H=JHI KIA@ E >=?GKJA IK>IJEJKJEI 1B $ifs EI J IAJ E rc I
                   ALEHAJ EJ EI EEJE=EA@ J >= J=> =@ AMEA
      $path        6DA IA=H?D F=JD KIA@ J BE@ ?=@I =@ EFKJ BEAI BH JDA . ?=@ 1B J
                   IAJ E JDA ALEHAJ EJ EI EEJE=EA@ >O path=(. /bin) 1JI KIA EI @EI?KH=CA@
                   EIJA=@ KIA bind J >KE@ = /bin ?J=EEC MD=J I AA@A@
      $pid         5AJ @KHEC EEJE=E=JE J rc I FH?AII E@
      $prompt 9DA rc EI HK EJAH=?JELAO JDA BEHIJ ?FAJ B $prompt EI FHEJA@ >ABHA HA=@
                   EC A=?D ?=@ 6DA IA?@ ?FAJ EI FHEJA@ MDAALAH = AMEA EI JOFA@
                   =@ HA EAI =HA HAGKEHA@ J ?FAJA JDA ?=@ 1B J IAJ E JDA ALEHAJ
                   EJ EI EEJE=EA@ >O prompt=(’% ’ ’ ’)
      $status 5AJ J JDA M=EJ AII=CA B JDA =IJANA?KJA@ FHCH= KAII IJ=HJA@ MEJD &). !
                   =@ ~ =I ?D=CA $status 1JI L=KA EI KIA@ J ?JH ANA?KJE E && || if
                   =@ while ?=@I 9DA rc ANEJI =J A@BBEA B EJI EFKJ H  ANA?KJEC =
                   exit ?=@ MEJD  =HCKAJ $status EI EJI ANEJ IJ=JKI
  Invocation
      1B rc EI IJ=HJA@ MEJD  =HCKAJI EJ HA=@I ?=@I BH IJ=@=H@ EFKJ JDAHMEIA EJI BEHIJ
      B=C =HCKAJ EI JDA =A B = BEA BH MDE?D J HA=@ ?=@I >KJ IAA −c >AM 5K>IA
      GKAJ =HCKAJI >A?A JDA EEJE= L=KA B $* Rc =??AFJI JDA BMEC ?=@EA B=CI
      −c string      +=@I =HA HA=@ BH string
      −s             2HEJ KJ ANEJ IJ=JKI =BJAH =O ?=@ MDAHA JDA IJ=JKI EI K
      −e             -NEJ EB $status EI K =BJAH ANA?KJEC = IEFA ?=@
      −i             1B −i EI FHAIAJ H rc EI CELA  =HCKAJI =@ EJI IJ=@=H@ EFKJ EI = JAHE= EJ
                     HKI EJAH=?JELAO +=@I =HA FHFJA@ BH KIEC $prompt
      −I             =AI IKHA rc EI J HK EJAH=?JELAO
      −l             1B −l EI CELA H JDA BEHIJ ?D=H=?JAH B =HCKAJ AH EI − rc HA=@I ?=@I BH
                     $home/lib/profile EB EJ ANEIJI >ABHA HA=@EC EJI H= EFKJ
      −m             4A=@ ?=@I J EEJE=EA rc BH initial EIJA=@ B BH /rc/lib/rcmain
      −p             ) F
      −d             ) F
      −v             -?D EFKJ  BEA @AI?HEFJH =I EJ EI HA=@
      −x             2HEJ A=?D IEFA ?=@ >ABHA ANA?KJEC EJ
      −r             2HEJ @A>KCCEC EBH=JE EJAH= BH B ?=@I =I JDAO =HA ANA?KJA@
SOURCE
     /sys/src/cmd/rc
SEE ALSO
      6 ,KBB 4?       6DA 2= ' 5DA 
BUGS
        6DAHA IDK@ >A = M=O J =J?D F=JJAHI =C=EIJ MDA EIJI H=JDAH JD= KIJ IECA IJHECI
        7IEC ~ J ?DA? JDA L=KA B $status ?D=CAI $status
        .K?JEI ?J=EEC DAHA @?KAJI @ J MH




                                                    &#
4+                                                      4+



        .HAA ?=HAJI @ J CAJ EIAHJA@ ANJ J AOMH@I




                                                    &$
4-21+)                                                                                        4-21+)




NAME
       ?D=CAI FK FKID I?=   ?EAJIAHLAH HAFE?= ==CAAJ
SYNOPSIS
     replica/pull  −nv   −c name   −s name  name  path 
     replica/push  −nv  name  path 
     replica/changes name  path 
     replica/scan name  path 
DESCRIPTION
      6DAIA IDA I?HEFJI FHLE@A = IEFA C>=IA@ ?EAJIAHLAH HAFE?= ==CAAJ 6DA IAHLAH
      AAFI = C B ?D=CAI =@A J EJI BEA IOIJA =@ ?EAJI IO?DHEA >O HA=@EC JDA C =@
      =FFOEC JDAIA ?D=CAI ?=O
       6DAIA I?HEFJI =HA = FEIDA@ EJAHB=?A J JDA MALA JI @AI?HE>A@ E replica& 5AA replica&
       BH @AJ=EI  JDA EAH MHECI B HAFE?= ==CAAJ 6DAIA JI MAHA MHEJJA FHE=HEO =I JDA
       BKHJD A@EJE 2= ' @EIJHE>KJE A?D=EI >KJ JDAO D=LA ME@AH =FFE?=>EEJO .H AN=FA JDAO
       ?K@ >A KIA@ J IO?DHEA A I DA @EHA?JHO >AJMAA = =FJF =@ = ?AJH= BEA IAHLAH
       4AFE?=I =HA @AI?HE>A@ >O ?BECKH=JE BEAI 6DA name E = JDA HAFE?= ?=@I EI = ?BECKH=
       JE BEA 2=JDI JD=J @ J >ACE MEJD / ./ H ../ =HA =IIKA@ J >A HA=JELA J
       $home/lib/replica +BECKH=JE BEAI =HA @AI?HE>A@ >AM
       Replica/scan EI JDA O A B JDAIA FHCH=I JD=J @AI J AA@ J >A HK  JDA ?EAJ 1J I?=I
       JDA IAHLAH BEA IOIJA BH ?D=CAI =@ =FFA@I AJHEAI BH JDIA ?D=CAI EJ JDA IAHLAH C 6OFE
       ?=O EJ EI HK  = =?DEA MEJD = B=IJ AJMH ?A?JE J JDA IAHLAH BEA IOIJA
       Replica/pull ?FEAI ?D=CAI BH JDA IAHLAH J JDA ?EAJ MDEA replica/push ?FEAI ?D=CAI BH
       JDA ?EAJ J JDA IAHLAH *JD HK  JDA ?EAJ 1B = EIJ B paths EI CELA O ?D=CAI J JDIA
       F=JDI H JDAEH ?DE@HA =HA ?FEA@ 6DA −v B=C ?=KIAI pull H push J FHEJ = IK=HO B MD=J EJ EI
       @EC -=?D IJ=JKI EA EI B JDA BH
             verb path serverpath mode uid gid mtime length
       Verb @AI?HE>AI JDA ALAJ =@@EJE B = BEA a @AAJE B = BEA d = ?D=CA J = BEA I ?JAJI
       c H = ?D=CA J = BEA I AJ=@=J= m Path EI JDA BEA F=JD  JDA ?EAJ serverpath EI JDA BEA
       F=JD  JDA IAHLAH Mode uid gid =@ mtime =HA JDA BEA I AJ=@=J= =I E JDA Dir IJHK?JKHA IAA
       stat# .H @AAJE ALAJI JDA AJ=@=J= EI JD=J B JDA @AAJA@ BEA .H JDAH ALAJI JDA AJ=
       @=J= EI JD=J =BJAH JDA ALAJ 6DA −n B=C ?=KIAI pull H push J FHEJ JDA IK=HO >KJ J =?JK=O
       ?=HHO KJ JDA =?JEI
       Push =@ pull =HA ?=HABK J JE?A IEKJ=AKI ?D=CAI J = BEA H EJI AJ=@=J=  >JD ?EAJ
       =@ IAHLAH 5K?D IEKJ=AKI ?D=CAI =HA ?=A@ conflicts 0AHA IEKJ=AKI @AI J A= =J
       JDA I=A EIJ=J >KJ AHAO JD=J >JD ?D=CAI MAHA ?=HHEA@ KJ MEJDKJ MA@CA B JDA JDAH
       .H AN=FA EB = ?EAJ =@ IAHLAH >JD =A ?D=CAI J = BEA MEJDKJ = EJAHLAEC push H pull
       JDA ANJ push H pull ME HAFHJ = KF@=JAKF@=JA ?BE?J 1B = ?BE?J EI @AJA?JA@ >JD BEAI =HA
       ABJ JDA I=A 6DA −c B=C J pull IFA?EBEAI JD=J ?BE?JI BH F=JDI >ACEEC MEJD name IDK@ >A
       HAILA@ KIEC JDA ?EAJ I ?FO MDEA −s IFA?EBEAI JDA IAHLAH I ?FO 6DA −c =@ −s FJEI =O
       >A HAFA=JA@
       Replica/changes FHEJI = EIJ B ?= ?D=CAI =@A  JDA ?EAJ JD=J D=LA J OAJ >AA FKIDA@ J
       JDA IAHLAH 1J EI EA push MEJD JDA −n B=C AN?AFJ JD=J EJ @AI J ?DA? BH ?BE?JI =@ JDKI
       @AI J HAGKEHA JDA IAHLAH J >A =L=E=>A
       6DA HAFE?= ?BECKH=JE BEA EI = rc I?HEFJ JD=J KIJ @ABEA JDA BMEC BK?JEI =@ L=HE
       =>AI
       servermount
            ) BK?JE JD=J KJI JDA IAHLAH HK  >JD ?EAJ =@ IAHLAH
       serverupdate
            ) BK?JE JD=J HAI?=I JDA IAHLAH BH ?D=CAI 6OFE?=O JDEI ?=@ @E=I = +27 IAHLAH
            M J >A ?IA J JDA BEA IAHLAH =@ HKI replica/scan  JD=J MA?A?JA@ =?DEA
       serverroot
            6DA F=JD J JDA HJ B JDA HAFE?=JA@ BEA IOIJA  JDA IAHLAH =I EJ ME >A E JDA =A



                                                    &%
4-21+)                                                                                     4-21+)



             IF=?A =BJAH HKEC servermount
      serverlog
           6DA F=JD J JDA IAHLAH I ?D=CA C =BJAH HKEC servermount
      serverproto
           6DA F=JD J JDA FHJ BEA @AI?HE>EC JDA IAHLAH I BEAI =BJAH HKEC servermount O
           KIA@ >O scan
      serverdb
           6DA F=JD J JDA IAHLAH I BEA @=J=>=IA =BJAH HKEC servermount O KIA@ >O scan
      clientmount
           ) BK?JE J KJ JDA ?EAJ BEA IOIJA HK O  JDA ?EAJ
      clientroot
           6DA F=JD J JDA HJ B JDA HAFE?=JA@ BEA IOIJA  JDA ?EAJ =BJAH HKEC
           clientmount
      clientlog
           6DA F=JD J JDA ?EAJ I ?FO B JDA IAHLAH C BEA 6DA ?EAJ C EI =EJ=EA@ >O pull
      clientproto
           6DA F=JD J JDA FHJ BEA @AI?HE>EC JDA ?EAJ I BEAI O KIA@ >O changes BJA KIJ =
           ?FO B $serverproto
      clientdb
           6DA F=JD J JDA ?EAJ I BEA @=J=>=IA =BJAH HKEC clientmount
      clientexclude
           ) FJAJE=O AFJO EIJ B F=JDI J AN?K@A BH IO?DHE=JE ) JOFE?= KIA B JDEI EI
           J AN?K@A JDA ?EAJ @=J=>=IA =@ C BEAI 6DAIA F=JDI =HA HA=JELA J JDA HJ B JDA
           HAFE?=JA@ BEA IOIJA
      )I = AN=FA JDA 2= ' @EIJHE>KJE HAFE?= ?BECKH=JE I EA
            fn servermount { 9fs sources; bind /n/sources/plan9 /n/dist }
            fn serverupdate { status=’’ }
            serverroot=/n/dist
            s=/n/dist/dist/replica
            serverlog=$s/plan9.log
            serverproto=$s/plan9.proto

             fn clientmount { 9fs kfs }
             clientroot=/n/kfs
             c=/n/kfs/dist/replica
             clientlog=$c/client/plan9.log
             clientproto=$c/plan9.proto
             clientdb=$c/client/plan9.db
             clientexclude=(dist/replica/client)
      5E?A JDA 2= ' @ALAFAHI HK scan =K=O J KF@=JA JDA C JDA ?EAJI AA@ J @ =OJDEC
      J HAI?= JDA BEA IOIJA 6DKI serverupdate IEFO HAJKHI IK??AIIBKO
      6DA BKHJD A@EJE 2= ' @EIJHE>KJE KIAI JDAIA JI J IO?DHEA EIJ==JEI MEJD JDA ?AJH=
      IAHLAH =J *A =>I 6DA HAFE?= ?BECKH=JE BEAI =@ AJ=@=J= =HA AFJ E /dist/replica
      6 KF@=JA OKH IOIJA =A IKHA OK =HA ?A?JA@ J JDA EJAHAJ =@ HK
            replica/pull /dist/replica/network
      1B ?BE?JI =HA HAFHJA@ I=O OK D=LA =@A ?= ?D=CAI J /rc/bin/cpurc =@
      /rc/bin/termrc >KJ O M=J J AAF JDA cpurc ?D=CAI KIA
            replica/pull −c rc/bin/cpurc −s rc/bin/termrc /dist/replica/network
      J EIJHK?J pull J ECHA JDA IAHLAH I ?D=CA J cpurc
      6DA I?HEFJ /usr/glenda/bin/rc/pull HKI pull MEJD JDA −v B=C =@ MEJD
      /dist/replica/network EIAHJA@ =J JDA HECDJ FEJ  JDA ?=@ EA CCA@ E =I
      CA@= A ?= HAFA=J JDA =>LA AN=FA MEJD
           pull −c rc/bin/cpurc −s rc/bin/termrc




                                                  &&
4-21+)                                                                                  4-21+)



      6 IAA = EIJ B ?D=CAI =@A J JDA ?= BEA IOIJA IE?A EIJ==JE HK
            replica/changes /dist/replica/network
      )JDKCD JDA I?HEFJ EI ?=A@ network IE?A changes EI = ?=O FAH=JE JDA AJMH AA@
      J >A ?BECKHA@
SOURCE
     /rc/bin/replica
SEE ALSO
      replica&




                                                &'
4-5)2-                                                                                 4-5)2-




NAME
       HAI=FA   HAI=FA = FE?JKHA
SYNOPSIS
     resample  −x size   −y size   file 
DESCRIPTION
      Resample HAI=FAI EJI EFKJ E=CA @AB=KJ IJ=@=H@ EFKJ J = AM IEA 6DA E=CA EI @A?E
      =JA@ H EJAHF=JA@ KIEC = =EIAH ME@M
       6DA IEA B JDA HAI=FA@ E=CA ?= >A IFA?EBEA@ MEJD JDA −x =@ −y FJEI ) K=@HA@
       L=KA IAJI JDA K>AH B FENAI B JD=J @EAIE = IKBBENA@ FAH?AJ IEC IFA?EBEAI = FAH?AJ=CA
       1B O A B −x H −y EI CELA JDA JDAH @EAIE EI I?=A@ J FHAIAHLA JDA =IFA?J H=JE B JDA
       HECE= E=CA 6DKI −x50% ME HA@K?A JDA E=CA J D=B EJI HECE= @EAIE E >JD x =@ y
       6DA EFKJ IDK@ >A = 2= ' E=CA =I @AI?HE>A@ E image$ =@ JDA KJFKJ ME >A = ?FHAIIA@
        ">EJ r8g8b8 E=CA 6 K?FHAII JDA E=CA H ?D=CA JDA FENA BH=J KIA iconv IAA
       crop
SOURCE
     /sys/src/cmd/resample.c
SEE ALSO
      crop image$
BUGS
       .=IJAH =CHEJDI ANEIJ >KJ JDEI EFAAJ=JE FH@K?AI ?HHA?J FE?JKHAI




                                                   '
41                                                                                               41




NAME
         HE =>A ME@M M?   ME@M IOIJA
SYNOPSIS
     rio  −i ’cmd’   −k ’kbdcmd’   −s   −f font 
         label name
         window  −m   −r minx miny maxx maxy   −dx n   −dy n   −minx n   −miny n   −maxx
         n   −maxy n   −cd dir   −hide   −scroll   −noscroll   cmd arg ... 
         wloc
DESCRIPTION
      Rio ==CAI =IO?DHKI =OAHI B JANJ H ME@MI  = H=IJAH @EIF=O 1J =I IAHLAI = L=HEAJO
      B BEAI BH ?KE?=JEC MEJD =@ ?JHEC ME@MI JDAIA =HA @EI?KIIA@ E IA?JE rio"
   Commands
      6DA rio ?=@ IJ=HJI = AM EIJ=?A B JDA ME@M IOIJA 1JI −i FJE =AI = IJ=HJKF
      I?HEFJ MDE?D JOFE?=O ?J=EI IALAH= window ?=@I CAAH=JA@ >O wloc 6DA −k FJE
      ?=KIAI rio J HK JDA ?=@ kbdcmd =J IJ=HJKF =@ =M EJ J FHLE@A ?D=H=?JAHI =I AO>=H@
      EFKJ JDA keyboard FHCH= @AI?HE>A@ E bitsyload EI JDA KIK= ?DE?A
         6DA −s FJE EEJE=EAI ME@MI I JD=J JANJ I?HI JDA @AB=KJ EI J J I?H 6DA font =HCK
         AJ =AI = BJ KIA@ J @EIF=O JANJ >JD E rio I AKI =@ =I = @AB=KJ BH =O FHCH=I
         HKEC E EJI ME@MI EJ =I AIJ=>EIDAI JDA ALEHAJ L=HE=>A $font 1B −f EI J CELA rio
         KIAI JDA EFHJA@ L=KA B $font EB IAJ JDAHMEIA EJ EFHJI JDA @AB=KJ BJ BH JDA K@AHOEC
         CH=FDE?I IAHLAH KIK=O JDA JAHE= I FAH=JEC IOIJA
         6DA label ?=@ ?D=CAI = ME@M I E@AJEBOEC =A
         6DA window ?=@ ?HA=JAI = ME@M *O @AB=KJ EJ ?HA=JAI = IDA ME@M =@ IEAI =@ F=?AI
         EJ =KJ=JE?=O 6DA CAAJHO =HCKAJI ?JH JDA IEA (dx, dy =@ F=?AAJ minx miny
         maxx maxy JDA KEJI =HA FENAI MEJD JDA KFFAH ABJ ?HAH B JDA I?HAA =J   6DA hide
         FJE ?=KIAI JDA ME@M J >A ?HA=JA@ BBI?HAA 6DA scroll =@ noscroll FJEI IAJ JDA
         I?H @A 6DA cd FJE IAJI JDA MHEC @EHA?JHO 6DA FJE= ?=@ =@ =HCKAJI
         @ABEA MDE?D FHCH= J HK E JDA ME@M
         *O @AB=KJ window KIAI /dev/wctl IAA rio" J ?HA=JA JDA ME@M =@ HK JDA ?=@
         6DAHABHA JDA ME@M =@ ?=@ ME >A ?HA=JA@ >O rio =@ HK E = AM BEA =A IF=?A KIJ
         =I EB JDA ME@M D=@ >AA ?HA=JA@ KIEC JDA EJAH=?JELA AK 0MALAH JDA −m FJE KIAI JDA
         BEA IAHLAH FHFAHJEAI B rio J mount IAA bind JDA AM ME@M I =A IF=?A MEJDE JDA =A
         IF=?A B JDA FHCH= ?=EC window 6DEI A=I BH AN=FA JD=J HKEC window E = +27
         ME@M ME ?HA=JA =JDAH ME@M MDIA ?=@ HKI  JDA JAHE= MDAHA rio EI HKEC
         MDEA window −m ME ?HA=JA =JDAH ME@M MDIA ?=@ HKI  JDA +27 IAHLAH
         6DA wloc ?=@ FHEJI JDA ?H@E=JAI =@ =>A B A=?D ME@M E EJI EIJ=?A B rio =@ EI
         KIA@ J ?IJHK?J =HCKAJI BH window
   Window control
      -=?D ME@M >AD=LAI =I = IAF=H=JA JAHE= MEJD =J A=IJ A FH?AII =II?E=JA@ MEJD EJ 9DA =
      ME@M EI ?HA=JA@ = AM FH?AII KIK=O = IDA IAA rc EI AIJ=>EIDA@ =@ >K@ J JDA ME
      @M =I = AM FH?AII CHKF 1EJE=O A=?D ME@M =?JI =I = IEFA JAHE= JD=J @EIF=OI ?D=H=?
      JAH JANJ JDA IJ=@=H@ EFKJ =@ KJFKJ B EJI FH?AIIAI =HA =JJ=?DA@ J /dev/cons JDAH IFA
      ?E= BEAI =??AIIE>A J JDA FH?AIIAI HKEC E = ME@M =O >A KIA@ J =A JDA ME@M =
      HA CAAH= @EIF=O 5A B JDAIA =HA AJEA@ DAHA JDA ?FAJA IAJ EI @EI?KIIA@ E rio"
         A ME@M EI current =@ EI E@E?=JA@ MEJD = @=H >H@AH =@ JANJ ?D=H=?JAHI JOFA@  JDA AO
         >=H@ =HA =L=E=>A E JDA /dev/cons BEA B JDA FH?AII E JDA ?KHHAJ ME@M +D=H=?JAHI MHEJ
         JA  /dev/cons =FFA=H =IO?DHKIO E JDA =II?E=JA@ ME@M MDAJDAH H J JDA ME@M
         EI ?KHHAJ
         9E@MI =HA ?HA=JA@ @AAJA@ =@ HA=HH=CA@ KIEC JDA KIA +E?EC FHAIIEC =@ HAA=IEC
         KIA >KJJ  E = ?KHHAJ ME@M =AI JD=J ME@M ?KHHAJ =@ >HECI EJ E BHJ B =O
         ME@MI JD=J D=FFA J >A LAH=FFEC EJ 9DA JDA KIA ?KHIH FEJI J JDA >=?CHK@ =HA=
         H EI E = ME@M JD=J D=I J ?=EA@ JDA KIA BH EJI M KIA FHAIIEC KIA >KJJ !



                                                    '
41                                                                                                  41



         =?JEL=JAI = AK B ME@M FAH=JEI FHLE@A@ >O rio 4AA=IEC >KJJ ! JDA IAA?JI = FAH=
         JE )J JDEI FEJ = CKIECDJ H ?HII ?KHIH E@E?=JAI JD=J = FAH=JE EI FA@EC 6DA >KJJ !
         AK FAH=JEI =HA
         New         +HA=JA = ME@M 2HAII >KJJ ! MDAHA A ?HAH B JDA AM HA?J=CA IDK@ =FFA=H
                     ?HII ?KHIH =@ LA JDA KIA MDEA D@EC @M >KJJ ! J JDA @E=C=O
                     FFIEJA ?HAH 4AA=IEC >KJJ ! ?HA=JAI JDA ME@M =@ =AI EJ ?KHHAJ 8AHO
                     I= ME@MI =O J >A ?HA=JA@
         Resize      +D=CA JDA IEA =@ ?=JE B = ME@M .EHIJ ?E? >KJJ ! E JDA ME@M J >A
                     ?D=CA@ CKIECDJ ?KHIH 6DA IMAAF KJ = ME@M =I BH JDA New FAH=JE 6DA
                     ME@M EI =@A ?KHHAJ
         Move        LA = ME@M J =JDAH ?=JE )BJAH FHAIIEC =@ D@EC >KJJ ! LAH JDA ME
                     @M J >A LA@ CKIECDJ ?KHIH E@E?=JA JDA AM FIEJE >O @H=CCEC JDA HA?J=
                     CA J JDA AM ?=JE 6DA ME@M EI =@A ?KHHAJ 9E@MI =O >A LA@ F=H
                     JE=O BBI?HAA
         Delete      ,AAJA = ME@M +E? E JDA ME@M J >A @AAJA@ CKIECDJ ?KHIH ,AAJEC = ME
                     @M ?=KIAI = hangup JA J >A IAJ J = FH?AIIAI E JDA ME@M I FH?AII CHKF
                     IAA notify 
         Hide        0E@A = ME@M +E? E JDA ME@M J >A DE@@A CKIECDJ ?KHIH EJ ME >A LA@
                     BBI?HAA -=?D DE@@A ME@M EI CELA = AK AJHO E JDA >KJJ ! AK =??H@EC
                     J JDA L=KA B JDA BEA /dev/label MDE?D rio =EJ=EI IAA rio"
         label       4AIJHA = DE@@A ME@M
         9E@MI =O =I >A =HH=CA@ >O @H=CCEC JDAEH >H@AHI 2HAIIEC >KJJ  H LAH = ME@M I
         >H@AH =MI A J LA JDA ?HHAIF@EC A@CA H ?HAH MDEA >KJJ ! LAI JDA MDA ME
         @M
  Text windows
      +D=H=?JAHI JOFA@  JDA AO>=H@ H MHEJJA J /dev/cons ?A?J E JDA ME@M J BH = C
      ?JEKKI @?KAJ
         6DAHA EI =M=OI IA selected text = ?JECKKI IJHEC =HA@  JDA I?HAA >O HALAHIEC EJI
         ?H 1B JDA IAA?JA@ JANJ EI = K IJHEC EJ EI E@E?=JA@ >O = D=EHEA ?KHIH >AJMAA JM ?D=H=?
         JAHI 6DA IAA?JA@ JANJ =O >A A@EJA@ >O KIEC =@ JOFEC 6ANJ EI IAA?JA@ >O FEJEC =@
         ?E?EC >KJJ  J =A = KIJHEC IAA?JE H >O FEJEC JDA IMAAFEC MEJD >KJJ 
         FHAIIA@ 6ANJ =O =I >A IAA?JA@ >O @K>A?E?EC KIJ EIE@A = =J?DA@ @AEEJAHF=EH MEJD
         A B {[(<«‘’"  JDA ABJ =@ }])>»‘’"  JDA HECDJ EJ IAA?JI = JANJ MEJDE JDA F=EH =J JDA
         >ACEEC H A@ B = EA EJ IAA?JI JDA EA MEJDE H =J JDA A@CA B = =FD=KAHE? MH@ EJ
         IAA?JI JDA MH@
         +D=H=?JAHI JOFA@  JDA AO>=H@ HAF=?A JDA IAA?JA@ JANJ EB JDEI JANJ EI J AFJO EJ EI F=?A@ E
         = snarf buffer ? J = ME@MI >KJ @EIJE?J BH JD=J B sam
         2HCH=I =??AII JDA JANJ E JDA ME@M =J = IECA FEJ =EJ=EA@ =KJ=JE?=O >O rio 6DA
         output point EI JDA ?=JE E JDA JANJ MDAHA JDA ANJ ?D=H=?JAH MHEJJA >O = FHCH= J
         /dev/cons ME =FFA=H =BJAHM=H@I JDA KJFKJ FEJ EI JDA K IJHEC >AO@ JDA AM ?D=H=?JAH
         6DA KJFKJ FEJ EI =I JDA ?=JE E JDA JANJ B JDA ANJ ?D=H=?JAH JD=J ME >A HA=@ @EHA?JO
         BH JDA JANJ E JDA ME@M J BH = EJAHLAEC >KBBAH >O = FHCH= BH /dev/cons
         9DA IK?D = HA=@ ME ??KH EI DMALAH K@AH ?JH B rio =@ JDA KIAH
         1 CAAH= JDAHA EI JANJ E JDA ME@M =BJAH JDA KJFKJ FEJ KIK=O F=?A@ JDAHA >O JOFEC >KJ
         ??=IE=O >O JDA A@EJEC FAH=JEI @AI?HE>A@ >AM ) FA@EC HA=@ B /dev/cons ME >?
         KJE JDA JANJ =BJAH JDA KJFKJ FEJ ?J=EI = AMEA MDAHAKF JDA HA=@ =O =?GKEHA JDA JANJ
         KF J =@ E?K@EC JDA AMEA )BJAH JDA HA=@ =I @AI?HE>A@ =>LA JDA KJFKJ FEJ ME >A =J JDA
         >ACEEC B JDA ANJ EA B JANJ 1 H= ?EH?KIJ=?AI JDAHABHA JOFA@ JANJ EI @AELAHA@ J
         FHCH=I = EA =J = JEA +D=CAI =@A >O JOFEC H A@EJEC >ABHA JDA JANJ EI HA=@ ME J >A
         IAA >O JDA FHCH= HA=@EC EJ 1B JDA FHCH= E JDA ME@M @AI J HA=@ JDA JAHE= BH
         AN=FA EB EJ EI = CHKEC ?FKJ=JE JDAHA =O =??KK=JA KJEFA EAI B JANJ =BJAH JDA
         KJFKJ FEJ ?D=CAI =@A J = JDEI JANJ ME >A IAA MDA JDA JANJ EI ALAJK=O HA=@ 6DEI
         A=I BH AN=FA JD=J A =O A@EJ KJ AMEAI E KHA=@ JANJ J BHAIJ= JDA =II?E=JA@ JANJ
         >AEC HA=@ MDA JDA FHCH= BEEIDAI ?FKJEC 6DEI >AD=LEH EI LAHO @EBBAHAJ BH IJ IOI
         JAI




                                                      '
41                                                                                                   41



         -LA MDA JDAHA =HA AMEAI E JDA KJFKJ JANJ rio ME J DH HA=@I EB JDA ME@M EI E hold
         mode MDE?D EI E@E?=JA@ >O = MDEJA ?KHIH =@ >KA JANJ =@ >H@AH 6DA -5+ ?D=H=?JAH JCCAI
         D@ @A 5A FHCH=I IK?D =I mail =KJ=JE?=O JKH  D@ @A J IEFEBO JDA A@EJ
         EC B KJEEA JANJ JOFA -5+ MDA @A J =M mail J HA=@ JDA JANJ
         ) -6 ?D=H=?JAH ?JH, >AD=LAI AN=?JO EA AMEA AN?AFJ JD=J EJ EI J @AELAHA@ J = FH
         CH= MDA HA=@ 6DKI  = AFJO EA = -6 IAHLAI J @AELAH = A@BBEA E@E?=JE JDA
         HA=@ ME HAJKH AH ?D=H=?JAHI EA AMEAI KHA=@ -6I =O >A IK??AIIBKO A@EJA@ KJ B JDA
         JANJ 6DA *5 ?D=H=?JAH ?JH0 AH=IAI JDA ?D=H=?JAH >ABHA JDA IAA?JA@ JANJ 6DA -6* ?D=H=?JAH
         ?JH9 AH=IAI =O =FD=KAHE? ?D=H=?JAHI JDA JDA =FD=KAHE? MH@ KIJ >ABHA JDA
         IAA?JA@ JANJ )FD=KAHE? DAHA A=I >=I =@ FK?JK=JE 6DA ) ?D=H=?JAH
         ?JH7 AH=IAI JDA JANJ =BJAH JDA KJFKJ FEJ =@ J OAJ HA=@ >O = FHCH= >KJ J HA
         JD= A EA ) JDAIA ?D=H=?JAHI =HA JOFA@  JDA AO>=H@ =@ DA?A HAF=?A JDA IAA?JA@ JANJ
         BH AN=FA JOFEC = *5 MEJD = MH@ IAA?JA@ F=?AI JDA MH@ E JDA I=HB >KBBAH HALAI EJ BH
         JDA I?HAA =@ AH=IAI JDA ?D=H=?JAH >ABHA JDA MH@
         ) )+ ?D=H=?JAH ?JH. H 1IAHJ ?D=H=?JAH JHECCAHI BEA =A ?FAJE BH JDA FHA?A@EC
         IJHEC IAA complete 
         6OFEC = ABJ H HECDJ =HHM LAI JDA ?KHIH A ?D=H=?JAH E JD=J @EHA?JE 6OFEC = 50 ?D=H
         =?JAH ?JH) LAI JDA ?KHIH J JDA >ACEEC B JDA ?KHHAJ EA = -3 ?D=H=?JAH ?JH
         - LAI J JDA A@
         6ANJ =O >A LA@ LAHJE?=O MEJDE JDA ME@M ) I?H >=H  JDA ABJ B JDA ME@M IDMI E
         EJI ?A=H FHJE MD=J BH=CAJ B JDA JJ= KJFKJ JANJ EI LEIE>A  JDA I?HAA =@ E EJI CH=O F=HJ
         MD=J EI =>LA H >AM LEAM EJ A=IKHAI ?D=H=?JAHI J EAI KIEC EIE@A JDA I?H >=H
         LAI JANJ ?E?EC >KJJ  MEJD JDA KIA FEJEC EIE@A JDA I?H >=H >HECI JDA EA =J JDA
         JF B JDA ME@M J JDA ?KHIH I LAHJE?= ?=JE >KJJ ! J=AI JDA EA =J JDA ?KHIH J JDA JF
         B JDA ME@M >KJJ  JHA=JEC JDA I?H >=H =I = HKAH KFI J JDA E@E?=JA@ FHJE B JDA
         IJHA@ JANJ 0@EC = >KJJ FHAIIA@ E JDA I?H >=H ME ?=KIA JDA JANJ J I?H ?JEKKIO
         KJE JDA >KJJ EI HAA=IA@ )I = F=CA @M H @M=HHM I?HI BHM=H@ D=B = ME@M =@
         F=CA KF H KF=HHM I?HI >=? 6OFEC JDA DA AO I?HI J JDA JF B JDA ME@M JOFEC
         JDA A@ AO I?HI J JDA >JJ
         6DA ,- ?D=H=?JAH IA@I = interrupt JA J = FH?AIIAI E JDA ME@M I FH?AII CHKF
         7EA JDA JDAH ?D=H=?JAHI JDA ,- 81-9 =@ KF =@ @M=HHM AOI @ J =BBA?J JDA
         IAA?JA@ JANJ 6DA ABJ HECDJ =HHM AO LAI JDA IAA?JE J A ?D=H=?JAH >ABHA =BJAH JDA ?KH
         HAJ IAA?JE
         H=O MHEJJA KJFKJ J = ME@M >?I MDA JDA JANJ HA=?DAI JDA A@ B JDA I?HAA = >KJJ
          AK EJA JCCAI I?HEC
         JDAH A@EJEC FAH=JEI =HA IAA?JA@ BH = AK  >KJJ  6DA cut FAH=JE @AAJAI JDA
         IAA?JA@ JANJ BH JDA I?HAA =@ FKJI EJ E JDA I=HB >KBBAH snarf ?FEAI JDA IAA?JA@ JANJ J JDA
         >KBBAH MEJDKJ @AAJEC EJ paste HAF=?AI JDA IAA?JA@ JANJ MEJD JDA ?JAJI B JDA >KBBAH =@
         send ?FEAI JDA I=HB >KBBAH J KIJ =BJAH JDA KJFKJ FEJ =@@EC = BE= AMEA EB EIIEC
         Paste ME IAJEAI =@ send ME =M=OI F=?A JANJ =BJAH JDA KJFKJ FEJ JDA JANJ I F=?A@
         ME >AD=LA AN=?JO =I @AI?HE>A@ =>LA 6DAHABHA MDA F=IJEC JANJ ?J=EEC AMEAI =BJAH JDA
         KJFKJ FEJ EJ =O >A FHK@AJ J JKH  D@ @A BEHIJ
         6DA plumb AK EJA IA@I JDA ?JAJI B JDA IAA?JE J JDA I=HB >KBBAH J JDA plumber"
         1B JDA IAA?JE EI AFJO EJ IA@I JDA MDEJAIF=?A@AEEJA@ JANJ ?J=EEC JDA IAA?JE JOFEC
         ?KHIH ) JOFE?= KIA B JDEI BA=JKHA EI J JA JDA A@EJH J BE@ JDA IKH?A B = AHHH >O FK>EC
         JDA BEA =@ EA EBH=JE E = ?FEAH I @E=CIJE?
  Raw text windows
     FAEC H =EFK=JEC ?AHJ=E BEAI IAHLA@ >O rio IKFFHAIIAI IA B JDA IAHLE?AI IKFFEA@ J
     H@E=HO JANJ ME@MI 9DEA JDA BEA /dev/mouse EI FA =O KIA FAH=JEI =HA JDA
     HAIFIE>EEJO B =JDAH FHCH= HKEC E JDA ME@M 6DKI rio HABH=EI BH =EJ=EEC JDA
     I?H >=H IKFFOEC JANJ A@EJEC H AKI EJAHFHAJEC JDA 81-9 AO =I = HAGKAIJ J I?H =@
     =I JKHI I?HEC 
         6DA BEA /dev/consctl ?JHI EJAHFHAJ=JE B AO>=H@ EFKJ 1 F=HJE?K=H = H=M @A =O
         >A IAJ E = H=MEFKJ ME@M  JOFA@ AO>=H@ ?D=H=?JAHI =HA IFA?E= JDAO =HA J A?DA@ J
         JDA I?HAA =@ = =HA F=IIA@ J = FHCH= EA@E=JAO KF HA=@EC EIJA=@ B >AEC C=JDAHA@



                                                      '!
41                                                                                              41



         EJ EAI
  Graphics windows
     ) FHCH= JD=J D@I /dev/mouse =@ /dev/consctl FA =BJAH FKJJEC JDA ?IA E H=M
     @A D=I ?FAJA ?JH B JDA ME@M EJ EJAHFHAJI = KIA ALAJI CAJI = AO>=H@ ?D=H=?
     JAHI =@ @AJAHEAI MD=J =FFA=HI  JDA I?HAA
FILES
         /lib/font/bit/*               BJ @EHA?JHEAI
         /mnt/wsys                     .EAI IAHLA@ >O rio =I KEA@ E /dev E = ME@M I =A
                                       IF=?A >ABHA JDA JAHE= I HA= /dev BEAI
         /srv/rio.user.pid             5AHLAH A@ B rio
         /srv/riowctl.user.pid         =A@ FEFA BH wctl AII=CAI
SOURCE
     /sys/src/cmd/rio
     /rc/bin/label
     /rc/bin/window
     /rc/bin/wloc
SEE ALSO
      rio" rc cpu sam mail proof graphics  frame  window  notify 
      cons! draw! mouse! keyboard $
BUGS
         6DA IJ=@=H@ EFKJ B window EI HA@EHA?JA@ J JDA AMO ?HA=JA@ ME@M I JDAHA EI  M=O J FEFA
         JDA KJFKJ B = FHCH= J JDA IJ=@=H@ EFKJ B JDA AM ME@M 1 IA ?=IAI plumb ?= >A
         KIA@ J MH =HK@ JDEI EEJ=JE




                                                    '"
4                                                                                               4




NAME
        H   HALA BEAI
SYNOPSIS
     rm  −fr  file ...
DESCRIPTION
      Rm HALAI BEAI H @EHA?JHEAI ) @EHA?JHO EI HALA@ O EB EJ EI AFJO 4AL= B = BEA
      HAGKEHAI MHEJA FAHEIIE E EJI @EHA?JHO >KJ AEJDAH HA=@ H MHEJA FAHEIIE  JDA BEA EJIAB
      6DA FJEI =HA
        −f     , J HAFHJ BEAI JD=J ?= J >A HALA@
        −r     4A?KHIELAO @AAJA JDA AJEHA ?JAJI B = @EHA?JHO =@ JDA @EHA?JHO EJIAB
SOURCE
     /sys/src/cmd/rm.c
SEE ALSO
      remove 




                                                     '#
49,                                                                                          49,




NAME
       HM@ ?IM@EH   =EJ=E HAJA MHEC @EHA?JHO
SYNOPSIS
     rwd path
       conswdir  prog 
DESCRIPTION
      Rwd =@ conswdir ?IFEHA J AAF rio" =@ acme" EBHA@ =>KJ JDA ?KHHAJ @EHA?JHO 
      HAJA IOIJAI @KHEC CE IAIIEI Rio =@ acme E?K@A JDEI EBH=JE E FK> AII=CAI
      IAJ J plumber" 1B JDA HAJA IOIJA I =A IF=?A EI KJA@ E JDA FK>AH I =A IF=?A
      JDA A@ HAIKJ EI JD=J BEA F=JDI FHEJA@ @KHEC JDA IAIIE =HA FK>=>A
       Rwd EBHI rio =@ acme B @EHA?JHO ?D=CAI 6DA =A B JDA HAJA =?DEA EI J=A BH
       JDA ALEHAJ L=HE=>A $remotesys Rwd MHEJAI JDA BK F=JD J /dev/wdir MHEJAI JDA =IJ
       AAAJ B JDA F=JD IKBBENA@ >O @remotesys J /dev/label =@ MDA HK EIE@A = win IAA
       acme ME@M ?D=CAI JDA ME@M JEJA J path/−remotesys KIEC /dev/acme/ctl
       Conswdir ?FEAI IJ=@=H@ EFKJ J IJ=@=H@ KJFKJ EC BH E>=@ AII=CAI =>KJ @EHA?JHO
       ?D=CAI 6DA AII=CAI =HA B JDA BH
              \033];path\007
       MDAHA \033 =@ \007 =HA )5+11 AI?=FA =@ >A ?D=H=?JAHI 5K?D AII=CAI =HA HALA@ BH
       JDA IJHA= =@ J FHEJA@ J IJ=@=H@ KJFKJ BH A=?D IK?D AII=CA conswdir HKI prog @AB=KJ
       /bin/rwd MEJD path =I EJI O =HCKAJ
EXAMPLES
     )@@ JDEI FK>EC HKA IAA plumb$ E H@AH J HK ?=@I E JDA FK>AH I =A IF=?A
              # have plumber run command
              kind is text
              data matches ’Local (.*)’
              plumb to none
              plumb start rc −c $1
       KJ = 7EN IOIJA E OKH =A IF=?A =@ JDA FK>AH I
              % 9fs unix
              % plumb ’Local 9fs unix’
       1B OK HA KIEC =?A ANA?KJA Local 9fs unix MEJD JDA E@@A >KJJ J KJ JDA 7EN IOI
       JA E =?A I =A IF=?A
       +A?J J JDA 7EN IOIJA FH?AIIEC E>=@ @EHA?JHO ?D=CA AII=CAI
              % ssh unix | aux/conswdir
       )@@ JDEI IDA BK?JE J OKH .profile  JDA 7EN IOIJA J CAAH=JA @EHA?JHO ?D=CA AI
       I=CAI ALAHO JEA = cd ?=@ EI ANA?KJA@
              H=‘hostname | sed ’s/\..*//’‘
              _cd () {
                   \cd $* &&
                   case $− in
                   *i*)
                        _dir=‘pwd‘
                        echo /n/$H$_dir | awk ’{printf("\033];%s\007", $1);}’
                   esac
              }
              alias cd=_cd
       6DA AN=FAI @AI?HE>A@ I B=H O DAF BH HA=JELA F=JD =AI )@@ JDEI FK>EC HKA J D=@A
       HJA@ =AI EA /usr/include/stdio.h
              # remote rooted path names
              type is text
              wdir matches ’/n/unix(/.*)?’



                                                 '$
49,                                                                                  49,



              data matches ’/([.a−zA−Z¡− 0−9_/\−]*[a−zA−Z¡− 0−9_/\−])(’$addr’)?’
              arg isfile /n/unix/$1
              data set $file
              attr add addr=$3
              plumb to edit
              plumb client window $editor
SOURCE
     /rc/bin/rwd
     /sys/src/cmd/aux/conswdir.c
SEE ALSO
      plumber" plumb$ srv"
BUGS
       6DEI A?D=EI EI ?KO >KJ 7EN =@ 550 =A EJ D=H@ J >KE@ = >AJJAH A
       6DA AI?=FA IAGKA?A M=I ?DIA >A?=KIA EJ ?D=CAI JDA JEJA  NJAH ME@MI




                                                  '%
5)                                                                                             5)




NAME
       I= * I=I=LA I=JAH      I?HAA A@EJH MEJD IJHK?JKH= HACK=H ANFHAIIEI
SYNOPSIS
     sam  option ...   files 
       sam −r machine
       sam.save
       B  −nnnn  file ...
DESCRIPTION
      Sam EI = KJEBEA A@EJH 1J @EBEAI = ?= ?FO B = ANJAH= BEA 6DA ?FO EI DAHA ?=A@ =
      file 6DA BEAI =HA EIJA@ E = AK =L=E=>A JDHKCD KIA >KJJ ! H JDA n ?=@ -=?D BEA
      D=I = =II?E=JA@ =A KIK=O JDA =A B JDA ANJAH= BEA BH MDE?D EJ M=I HA=@ =@ = @E
      BEA@ >EJ JD=J E@E?=JAI MDAJDAH JDA A@EJH I BEA =CHAAI MEJD JDA ANJAH= BEA 6DA ANJAH= BEA EI
      J HA=@ EJ JDA A@EJH I BEA KJE EJ BEHIJ >A?AI JDA ?KHHAJ BEA JD=J J MDE?D A@EJEC ?
      =@I =FFO MDAHAKF EJI AK AJHO EI FHEJA@ 6DA FJEI =HA
       −a               )KJE@AJ 1 JDEI @A MDA = AMEA ?D=H=?JAH EI JOFA@ E JDA JAHE= EJAH
                        B=?A samterm ?FEAI A=@EC MDEJA IF=?A  JDA ?KHHAJ EA J JDA AM EA
       −d               , J @M=@ JDA JAHE= F=HJ B sam -@EJEC ME >A @A MEJD JDA ?
                        =@ =CK=CA O =I E ed
       −r machine       4K JDA DIJ F=HJ HAJAO  JDA IFA?EBEA@ =?DEA JDA JAHE= F=HJ ?=O
       −s path          5J=HJ JDA DIJ F=HJ BH JDA IFA?EBEA@ BEA  JDA HAJA DIJ O A=ECBK
                        MEJD JDA −r FJE
       −t path          5J=HJ JDA JAHE= F=HJ BH JDA IFA?EBEA@ BEA 7IABK BH @A>KCCEC
   Regular expressions
      4ACK=H ANFHAIIEI =HA =I E regexp$ MEJD JDA =@@EJE B \n J HAFHAIAJ AMEAI ) HACK=H
      ANFHAIIE =O ALAH ?J=E = EJAH= AMEA ?D=H=?JAH 6DA AFJO HACK=H ANFHAIIE IJ=@I BH
      JDA =IJ ?FAJA ANFHAIIE A?KJAHA@ ) HACK=H ANFHAIIE E sam =J?DAI JDA CAIJ ABJ
      IJ IK>IJHEC BH=O =J?DA@ >O JDA ANFHAIIE 5A=H?DEC E JDA HALAHIA @EHA?JE EI AGKEL=
      AJ J IA=H?DEC >=?M=H@I MEJD JDA ?=JA=JE FAH=JEI HALAHIA@ E JDA ANFHAIIE
   Addresses
      ) =@@HAII E@AJEBEAI = IK>IJHEC E = BEA 1 JDA BMEC ?D=H=?JAH n A=I JDA K IJHEC
      =BJAH JDA nJD ?D=H=?JAH E JDA BEA MEJD  JDA BEHIJ ?D=H=?JAH E JDA BEA EA n A=I JDA nJD
      =J?D IJ=HJEC =J JDA >ACEEC B JDA BEA B JDA HACK=H ANFHAIIE .*\n? ) BEAI =M=OI D=LA
      = ?KHHAJ IK>IJHEC ?=A@ @J JD=J EI JDA @AB=KJ =@@HAII
   Simple Addresses
      #n     6DA AFJO IJHEC =BJAH ?D=H=?JAH n #0 EI JDA >ACEEC B JDA BEA
      n      EA n 0 EI JDA >ACEEC B JDA BEA
      /regexp/
      ?regexp?
             6DA IK>IJHEC JD=J =J?DAI JDA HACK=H ANFHAIIE BK@ >O EC JM=H@ JDA A@ / H
             >ACEEC ? B JDA BEA =@ EB A?AII=HO ?JEKEC JDA IA=H?D BH JDA JDAH A@ J JDA
             IJ=HJEC FEJ B JDA IA=H?D 6DA =J?DA@ IK>IJHEC =O IJH=@@A JDA IJ=HJEC FEJ 9DA
             AJAHEC = F=JJAH ?J=EEC = EJAH= GKAIJE =H BH = >=?M=H@ IA=H?D JDA GKAIJE
             =H IDK@ >A IFA?EBEA@ =I = A>AH B = ?=II
       0       6DA IJHEC >ABHA JDA BEHIJ BK EA 6DEI EI J A?AII=HEO JDA K IJHEC IAA + =@ −
               >AM
       $       6DA K IJHEC =J JDA A@ B JDA BEA
       .       ,J
       ’       6DA =H E JDA BEA IAA JDA k ?=@ >AM
       "regexp"
              2HA?A@EC = IEFA =@@HAII @AB=KJ . HABAHI J JDA =@@HAII AL=K=JA@ E JDA KEGKA BEA
              MDIA AK EA =J?DAI JDA HACK=H ANFHAIIE




                                                         '&
5)                                                                                                 5)



  Compound Addresses
     1 JDA BMEC a1 =@ a2 =HA =@@HAIIAI
      a1+a2      6DA =@@HAII a2 AL=K=JA@ IJ=HJEC =J JDA A@ B a1
      a1−a2      6DA =@@HAII a2 AL=K=JA@ EC E JDA HALAHIA @EHA?JE IJ=HJEC =J JDA >ACEEC B
                 a1
      a1,a2      6DA IK>IJHEC BH JDA >ACEEC B a1 J JDA A@ B a2 1B a1 EI EIIEC 0 EI IK>IJE
                 JKJA@ 1B a2 EI EIIEC $ EI IK>IJEJKJA@
      a1;a2      EA a1,a2 >KJ MEJD a2 AL=K=JA@ =J JDA A@ B =@ @J IAJ J a1
      6DA FAH=JHI + =@ − =HA DECD FHA?A@A?A MDEA , =@ ; =HA M FHA?A@A?A
      1 >JD + =@ − BHI EB a2 EI = EA H ?D=H=?JAH =@@HAII MEJD = EIIEC K>AH JDA K>AH
      @AB=KJI J  1B a1 EI EIIEC . EI IK>IJEJKJA@ 1B >JD a1 =@ a2 =HA FHAIAJ =@ @EIJECKEID=>A
      + =O >A AE@A@ a2 =O >A = HACK=H ANFHAIIE EB EJ EI @AEEJA@ >O ? I JDA ABBA?J B JDA + H −
      EI HALAHIA@
      1J EI = AHHH BH = ?FK@ =@@HAII J HAFHAIAJ = =BHA@ IK>IJHEC 5A KIABK E@EI
      a1+− a1−+ IAA?JI JDA EA ?J=EEC JDA A@ >ACEEC B = 0/regexp/ ?=JAI JDA BEHIJ
      =J?D B JDA ANFHAIIE E JDA BEA 6DA BH 0;// IAJI @J KA?AII=HEO ./regexp/// BE@I
      JDA IA?@ BMEC ??KHHA?A B JDA ANFHAIIE =@ .,/regexp/ ANJA@I @J
  Commands
     1 JDA BMEC JANJ @A=H?=JA@ >O I=IDAI HAFHAIAJI JANJ @AEEJA@ >O =O FHEJ=>A ?D=H=?JAH
     AN?AFJ =FD=KAHE?I )O K>AH B JH=EEC @AEEJAHI =O >A AE@A@ MEJD KJEFA AEIEI JDA
     HAFHAIAJEC K IJHECI >KJ JDA BEHIJ @AEEJAH KIJ =M=OI >A FHAIAJ 1 =O @AEEJA@ JANJ
     AMEA =O J =FFA=H EJAH=O \n =O >A JOFA@ BH AMEA =@ \/ GKJAI JDA @AEEJAH DAHA
     / *=?I=ID EI JDAHMEIA EJAHFHAJA@ EJAH=O AN?AFJ E s ?=@I
      IJ ?=@I =O >A FHABENA@ >O = =@@HAII J E@E?=JA JDAEH H=CA B FAH=JE 6DIA JD=J
      =O J =HA =HA@ MEJD = * >AM 1B = ?=@ J=AI = =@@HAII =@ A EI IKFFEA@ @J EI
      KIA@ 6DA IA AN?AFJE EI JDA w ?=@ MDE?D @AB=KJI J 0,$ 1 JDA @AI?HEFJE H=CA EI
      KIA@ J HAFHAIAJ MD=JALAH =@@HAII EI IKFFEA@ =O ?=@I IAJ JDA L=KA B @J =I = IE@A
      ABBA?J 1B I EJ EI =M=OI IAJ J JDA HAIKJ B JDA ?D=CA JDA AFJO IJHEC BH = @AAJE JDA AM
      JANJ BH = EIAHJE AJ? >KJ IAA JDA s =@ e ?=@I
  Text commands
      a/text/
      H
      a
      lines of text
      .       1IAHJ JDA JANJ EJ JDA BEA =BJAH JDA H=CA 5AJ @J
      c
      i       5=A =I a >KJ c HAF=?AI JDA JANJ MDEA i EIAHJI before JDA H=CA
      d       ,AAJA JDA JANJ E JDA H=CA 5AJ @J
      s/regexp/text/
            5K>IJEJKJA text BH JDA BEHIJ =J?D J JDA HACK=H ANFHAIIE E JDA H=CA 5AJ @J J JDA
            @EBEA@ H=CA 1 text JDA ?D=H=?JAH & IJ=@I BH JDA IJHEC JD=J =J?DA@ JDA ANFHAIIE
            *=?I=ID >AD=LAI =I KIK= KAII BMA@ >O = @ECEJ \d IJ=@I BH JDA IJHEC JD=J
            =J?DA@ JDA IK>ANFHAIIE >ACK >O JDA dJD ABJ F=HAJDAIEI 1B s EI BMA@ EA@E
            =JAO >O = K>AH n =I E s2/x/y/ JDA nJD =J?D E JDA H=CA EI IK>IJEJKJA@ 1B JDA
            ?=@ EI BMA@ >O = g =I E s/x/y/g = =J?DAI E JDA H=CA =HA IK>IJEJKJA@
      m a1
      t a1    LA m H ?FO t JDA H=CA J =BJAH a1 5AJ @J
  Display commands
      p     2HEJ JDA JANJ E JDA H=CA 5AJ @J
      =     2HEJ JDA EA =@@HAII =@ ?D=H=?JAH =@@HAII B JDA H=CA
      =#    2HEJ KIJ JDA ?D=H=?JAH =@@HAII B JDA H=CA
  File commands
        b file−list
               5AJ JDA ?KHHAJ BEA J JDA BEHIJ BEA =A@ E JDA EIJ JD=J sam =I D=I E EJI AK 6DA EIJ



                                                     ''
5)                                                                                             5)



              =O >A ANFHAIIA@ <Plan 9 command E MDE?D ?=IA JDA BEA =AI =HA J=A =I MH@I E
              JDA IDA IAIA CAAH=JA@ >O JDA 2= ' ?=@
       B file−list
              5=A =I b AN?AFJ JD=J BEA =AI J E JDA AK =HA AJAHA@ JDAHA =@ = BEA =AI E
              JDA EIJ =HA AN=EA@
      n      2HEJ = AK B BEAI 6DA BH=J EI
              ’ H >= E@E?=JEC JDA BEA EI @EBEA@ H ?A=
              − H +       E@E?=JEC JDA BEA EI KHA=@ H D=I >AA HA=@ E JDA JAHE= * A=I HA
                           JD= A ME@M EI FA
              . H >= E@E?=JEC JDA ?KHHAJ BEA
              = >=
              =@ JDA BEA =A
       D file−list
              ,AAJA JDA =A@ BEAI BH JDA AK 1B  BEAI =HA =A@ JDA ?KHHAJ BEA EI @AAJA@ 1J
              EI = AHHH J D = @EBEA@ BEA >KJ = IK>IAGKAJ D ME @AAJA IK?D = BEA
  I/O Commands
       e filename
               4AF=?A JDA BEA >O JDA ?JAJI B JDA =A@ ANJAH= BEA 5AJ @J J JDA >ACEEC B JDA
               BEA
      r filename
               4AF=?A JDA JANJ E JDA H=CA >O JDA ?JAJI B JDA =A@ ANJAH= BEA 5AJ @J
      w filename
               9HEJA JDA H=CA @AB=KJ 0,$ J JDA =A@ ANJAH= BEA
       f filename
               5AJ JDA BEA =A =@ FHEJ JDA HAIKJEC AK AJHO
      1B JDA BEA =A EI =>IAJ BH =O B JDAIA JDA ?KHHAJ BEA =A EI KIA@ e =M=OI IAJI JDA BEA
      =A r =@ w @ I EB JDA BEA D=I  =A
      < Plan 9−command
               4AF=?A JDA H=CA >O JDA IJ=@=H@ KJFKJ B JDA 2= ' ?=@
      > Plan 9−command
               5A@ JDA H=CA J JDA IJ=@=H@ EFKJ B JDA 2= ' ?=@
      | Plan 9−command
               5A@ JDA H=CA J JDA IJ=@=H@ EFKJ =@ HAF=?A EJ >O JDA IJ=@=H@ KJFKJ B JDA 2= '
               ?=@
       ! Plan 9−command
               4K JDA 2= ' ?=@
       cd directory
               +D=CA MHEC @EHA?JHO 1B  @EHA?JHO EI IFA?EBEA@ $home EI KIA@
      1 =O B < > | H ! EB JDA Plan 9 command EI EJJA@ JDA =IJ Plan 9 command B =O JOFA EI
      IK>IJEJKJA@ 1B sam EI downloaded KIEC JDA KIA =@ H=IJAH @EIF=O EA J KIEC FJE −d
      ! IAJI IJ=@=H@ EFKJ J /dev/null =@ JDAHMEIA K=IIECA@ KJFKJ stdout BH ! =@ >
      stderr BH = EI F=?A@ E /tmp/sam.err =@ JDA BEHIJ BAM EAI =HA FHEJA@
  Loops and Conditionals
     x/regexp/ command
           .H A=?D =J?D B JDA HACK=H ANFHAIIE E JDA H=CA HK JDA ?=@ MEJD @J IAJ J JDA
           =J?D 5AJ @J J JDA =IJ =J?D 1B JDA HACK=H ANFHAIIE =@ EJI I=IDAI =HA EJJA@
           /.*\n/ EI =IIKA@ K IJHEC =J?DAI FJAJE=O ??KH >ABHA ALAHO ?D=H=?JAH B JDA
           H=CA =@ =J JDA A@ B JDA H=CA
     y/regexp/ command
           EA x >KJ HK JDA ?=@ BH A=?D IK>IJHEC JD=J EAI >ABHA >AJMAA H =BJAH JDA
           =J?DAI JD=J MK@ >A CAAH=JA@ >O x 6DAHA EI  @AB=KJ HACK=H ANFHAIIE K IK>
           IJHECI FJAJE=O ??KH >ABHA ALAHO ?D=H=?JAH E JDA H=CA
      X/regexp/ command
           .H A=?D BEA MDIA AK AJHO =J?DAI JDA HACK=H ANFHAIIE =A JD=J JDA ?KHHAJ BEA
           =@ HK JDA ?=@ 1B JDA ANFHAIIE EI EJJA@ JDA ?=@ EI HK E ALAHO BEA
      Y/regexp/ command
           5=A =I X >KJ BH BEAI JD=J @ J =J?D JDA HACK=H ANFHAIIE =@ JDA ANFHAIIE EI
           HAGKEHA@



                                                    
5)                                                                                             5)



      g/regexp/ command
      v/regexp/ command
              1B JDA H=CA ?J=EI g H @AI J ?J=E v = =J?D BH JDA ANFHAIIE IAJ @J J JDA
              H=CA =@ HK JDA ?=@
      6DAIA =O >A AIJA@ =H>EJH=HEO @AAFO >KJ O A EIJ=?A B AEJDAH X H Y =O =FFA=H E =
      IECA ?=@ ) AFJO ?=@ E = x H y @AB=KJI J p = AFJO ?=@ E X H Y
      @AB=KJI J f g =@ v @ J D=LA @AB=KJI
  Miscellany
      k            5AJ JDA ?KHHAJ BEA I =H J JDA H=CA ,AI J IAJ @J
      q           3KEJ 1J EI = AHHH J GKEJ MEJD @EBEA@ BEAI >KJ = IA?@ q ME IK??AA@
      un          7@ JDA =IJ n @AB=KJ  JFALA ?=@I JD=J ?D=CA@ JDA ?JAJI H =A B
                   JDA ?KHHAJ BEA =@ =O JDAH BEA MDIA IJ HA?AJ ?D=CA M=I IEKJ=AKI MEJD
                   JDA ?KHHAJ BEA I ?D=CA 5K??AIIELA u I LA BKHJDAH >=? E JEA 6DA O ?
                   =@I BH MDE?D K EI EABBA?JELA =HA cd u q w =@ D 1B n EI AC=JELA u HA@AI
                   K@EC JDA K@ CEC BHM=H@I E JEA =C=E
      AFJO      1B JDA H=CA EI ANFE?EJ IAJ @J J JDA H=CA 1B sam EI @M=@A@ JDA HAIKJEC @J
                   EI IAA?JA@  JDA I?HAA JDAHMEIA EJ EI FHEJA@ 1B  =@@HAII EI IFA?EBEA@ JDA ?
                   =@ EI = AMEA @J EI ANJA@A@ E AEJDAH @EHA?JE J EA >K@=HEAI =@ FHEJA@
                   1B @J EI JDAHA>O K?D=CA@ EJ EI IAJ J .+1 =@ FHEJA@
  Grouping and multiple changes
     +=@I =O >A CHKFA@ >O A?IEC JDA E >H=?AI {} +=@I MEJDE JDA >H=?AI KIJ
     =FFA=H  IAF=H=JA EAI  >=?I=IDAI =HA HAGKEHA@ >AJMAA ?=@I 5A=JE?=O =
     FAEC >H=?A EI EA = ?=@ EJ J=AI = FJE= =@@HAII =@ IAJI @J BH A=?D IK>
     ?=@ +=@I MEJDE JDA >H=?AI =HA ANA?KJA@ IAGKAJE=O >KJ ?D=CAI =@A >O A
     ?=@ =HA J LEIE>A J JDAH ?=@I IAA JDA ANJ F=H=CH=FD *H=?AI =O >A AIJA@ =H>E
     JH=HEO
      9DA = ?=@ =AI = K>AH B ?D=CAI J = BEA =I E x/re/c/text/ JDA =@@HAIIAI B
      = ?D=CAI J JDA BEA =HA ?FKJA@ E JDA HECE= BEA 1B JDA ?D=CAI =HA E IAGKA?A JDAO =HA
      =FFEA@ J JDA BEA 5K??AIIELA EIAHJEI =J JDA I=A =@@HAII =HA ?=JA=JA@ EJ = IECA EIAHJE
      ?FIA@ B JDA IALAH= EIAHJEI E JDA H@AH =FFEA@
  The terminal
     9D=J BMI HABAHI J >AD=LEH B sam MDA @M=@A@ JD=J EI MDA FAH=JEC =I = @EIF=O A@E
     JH  = H=IJAH @EIF=O 6DEI EI JDA @AB=KJ >AD=LEH ELEC sam MEJD JDA −d  @M=@
     FJE FHLE@AI =??AII J JDA ?=@ =CK=CA O
      -=?D BEA =O D=LA AH H HA ME@MI FA -=?D ME@M EI AGKEL=AJ =@ EI KF@=JA@ IEKJ=
      AKIO MEJD ?D=CAI E JDAH ME@MI  JDA I=A BEA -=?D ME@M D=I = E@AFA@AJ L=KA
      B @J E@E?=JA@ >O = DECDECDJA@ IK>IJHEC  JDA @EIF=O ,J =O >A E = HACE J MEJDE JDA
      ME@M 6DAHA EI KIK=O = ?KHHAJ ME@M  =HA@ MEJD = @=H >H@AH J MDE?D JOFA@ JANJ =@
      A@EJEC ?=@I =FFO 6ANJ =O >A JOFA@ =@ A@EJA@ =I E rio =I JDA AI?=FA AO -5+
      IAA?JI IAJI @J J JANJ JOFA@ IE?A JDA =IJ KIA >KJJ DEJ
      6DA >KJJ ! AK ?JHI ME@M FAH=JEI 6DA JF B JDA AK FHLE@AI JDA BMEC FAH
      =JHI A=?D B MDE?D KIAI A H HA rioEA ?KHIHI J FHFJ BH IAA?JE B = ME@M H
      IMAAFEC B = HA?J=CA 5MAAFEC = K HA?J=CA CAJI = =HCA ME@M @EIEJ BH JDA ?
      =@ ME@M H JDA MDA I?HAA @AFA@EC  MDAHA JDA K HA?J=CA EI
      new         +HA=JA = AM AFJO BEA
      zerox       +HA=JA = ?FO B = ANEIJEC ME@M
      resize      )I E rio
      close       ,AAJA JDA ME@M 1 JDA =IJ ME@M B = BEA close EI AGKEL=AJ J = D BH JDA BEA
      write       -GKEL=AJ J = w BH JDA BEA
      *AM JDAIA FAH=JHI EI = EIJ B =L=E=>A BEAI IJ=HJEC MEJD ~~sam~~ JDA ?=@ ME@M
      5AA?JEC = BEA BH JDA EIJ =AI JDA IJ HA?AJO KIA@ ME@M  JD=J BEA ?KHHAJ KAII EJ EI
      =HA=@O ?KHHAJ E MDE?D ?=IA IAA?JEI ?O?A JDHKCD JDA FA ME@MI 1B  ME@MI =HA FA
       JDA BEA JDA KIAH EI FHFJA@ J FA A .EAI JDAH JD= ~~sam~~ =HA =HA@ MEJD A B
      JDA ?D=H=?JAHI −+* =??H@EC =I AH A H HA ME@MI =HA FA  JDA BEA ) BKHJDAH =H
      . =FFA=HI  JDA BEA E JDA ?KHHAJ ME@M =@ = IECA GKJA ’  = BEA @EBEA@ IE?A =IJ
      MHEJA



                                                    
5)                                                                                                  5)



        6DA ?=@ ME@M ?HA=JA@ =KJ=JE?=O MDA sam IJ=HJI EI = H@E=HO ME@M AN?AFJ JD=J
        JANJ JOFA@ J EJ EI EJAHFHAJA@ =I ?=@I BH JDA A@EJH H=JDAH JD= F=IIELA JANJ =@ JANJ FHEJA@
        >O A@EJH ?=@I =FFA=HI E EJ 6DA >AD=LEH EI EA rio MEJD = KJFKJ FEJ JD=J IAF=H=JAI
        ?=@I >AEC JOFA@ BH FHALEKI KJFKJ +=@I JOFA@ E JDA ?=@ ME@M =FFO J
        JDA ?KHHAJ FA BEA JDA BEA E JDA IJ HA?AJO ?KHHAJ ME@M
   Manipulating text
      *KJJ  ?D=CAI IAA?JE K?D EA rio 2EJEC J = ?KHHAJ ME@M MEJD >KJJ  =AI
      EJ ?KHHAJ MEJDE JDA ?KHHAJ ME@M >KJJ  IAA?JI JANJ JDKI IAJJEC @J ,K>A?E?EC
      IAA?JI JANJ J JDA >K@=HEAI B MH@I EAI GKJA@ IJHECI H >H=?AJA@ IJHECI @AFA@EC 
      JDA JANJ =J JDA ?E?
        *KJJ    FHLE@AI = AK B A@EJEC ?=@I
        cut          ,AAJA @J =@ I=LA JDA @AAJA@ JANJ E JDA I=HB >KBBAH
        paste        4AF=?A JDA JANJ E @J >O JDA ?JAJI B JDA I=HB >KBBAH
        snarf        5=LA JDA JANJ E @J E JDA I=HB >KBBAH
        plumb        5A@ JDA JANJ E JDA IAA?JE =I = FK> AII=CA 1B JDA IAA?JE EI AFJO JDA
                     MDEJAIF=?A@AEEJA@ >? B JANJ EI IAJ =I = FK> AII=CA MEJD = click
                     =JJHE>KJA @ABEEC MDAHA JDA IAA?JE EAI IAA plumb$
        look         5A=H?D BHM=H@ BH JDA ANJ ??KHHA?A B JDA EJAH= JANJ E @J 1B @J EI JDA K
                     IJHEC JDA JANJ E JDA I=HB >KBBAH EI KIA@ 6DA I=HB >KBBAH EI K=BBA?JA@
        <rio>        -N?D=CA I=HB >KBBAHI MEJD rio
        /regexp      5A=H?D BHM=H@ BH JDA ANJ =J?D B JDA =IJ HACK=H ANFHAIIE JOFA@ E = ?=@
                     J E ?=@ ME@M
        send         5A@ JDA JANJ E @J H JDA I=HB >KBBAH EB @J EI JDA K IJHEC =I EB EJ MAHA JOFA@ J
                     JDA ?=@ ME@M 5=LAI JDA IAJ JANJ E JDA I=HB >KBBAH +=@ ME@M
                     O
   External communication
       Sam EIJAI J JDA edit FK> FHJ 1B FK>EC EI J =?JELA  EL?=JE sam ?HA=JAI = =A@
       FEFA /srv/sam.user MDE?D =?JI =I = =@@EJE= IKH?A B ?=@I +D=H=?JAHI MHEJJA J JDA
       =A@ FEFA =HA JHA=JA@ =I EB JDAO D=@ >AA JOFA@ E JDA ?=@ ME@M
        B EI = IDAALA ?=@ JD=J ?=KIAI = EIJ=?A B sam HKEC  JDA I=A JAHE= J =@
        JDA =A@ files B KIAI AEJDAH FK>EC H JDA =A@ FEFA MDE?DALAH IAHLE?A EI =L=E=>A 1B
        FK>EC EI J A=>A@ JDA FJE =MI = EA K>AH J >A IFA?EBEA@ BH JDA EEJE= FIEJE J
        @EIF=O E JDA =IJ =A@ BEA FK>EC FHLE@AI = HA CAAH= A?D=EI BH JDEI =>EEJO
   Abnormal termination
      1B sam JAHE=JAI JDAH JD= >O = q ?=@ >O D=CKF @AAJEC EJI ME@M AJ? @EBEA@ BEAI
      =HA I=LA@ E = ANA?KJ=>A BEA $home/sam.save 6DEI FHCH= MDA ANA?KJA@ =II MDAJDAH
      J MHEJA A=?D BEA >=? J = ANJAH= BEA 6DA =IMAH y ?=KIAI MHEJEC =OJDEC AIA IEFI JDA BEA
FILES
        $home/sam.save
        $home/sam.err
        /sys/lib/samsave                 JDA FHCH= ?=A@ J KF=? $home/sam.save
SOURCE
     /sys/src/cmd/sam                    IKH?A BH sam EJIAB
     /sys/src/cmd/samterm                IKH?A BH JDA IAF=H=JA JAHE= F=HJ
     /rc/bin/B
SEE ALSO
      ed sed grep rio regexp$
        4> 2EA 6DA JANJ A@EJH I= 




                                                      
5-+564-                                                                                     5-+564-




NAME
       =AI?>? EFI IA?IJHA   IA?IJHA ?=@I
SYNOPSIS
     auth/secstore  −cinv   −(g|G) getfile   −p putfile   −r rmfile   −s server   −u user
     
       auth/aescbc A  E  <cleartext >ciphertext
       auth/aescbc @  E  <ciphertext >cleartext
       ipso  −a −e −l −f −s   file  
DESCRIPTION
      Secstore =KJDAJE?=JAI J = IA?KHAIJHA IAHLAH KIEC = F=IIMH@ =@ FJE=O = D=H@M=HA JA
      JDA I=LAI H HAJHEALAI = BEA 6DEI EI EJA@A@ J >A = ?HA@AJE=I IJHA FK>E?FHEL=JA AOF=EHI
      F=IIMH@I =@ JDAH IA?HAJI BH = B=?JJK
       FJE −c FHFJI BH = F=IIMH@ ?D=CA
       FJE −g HAJHEALAI = BEA J JDA ?= @EHA?JHO FJE −G MHEJAI EJ J IJ=@=H@ KJFKJ EIJA=@
       5FA?EBOEC getfile B . ME IA@ J IJ=@=H@ KJFKJ = EIJ B HAJA BEAI MEJD @=JAI ACJDI =@
       50) D=IDAI
       FJE −i I=OI JD=J JDA F=IIMH@ IDK@ >A HA=@ BH IJ=@=H@ EFKJ EIJA=@ B BH
       /dev/cons
       FJE −n I=OI JD=J JDA F=IIMH@ IDK@ >A HA=@ BH 84) IAA authsrv  EIJA=@ B BH
       /dev/cons
       FJE −p IJHAI = BEA  JDA IA?IJHA
       FJE −r HALAI = BEA BH JDA IA?IJHA
       6DA IAHLAH EI tcp!$auth!secstore H JDA IAHLAH IFA?EBEA@ >O FJE −s
       FJE −u =??AII JDA IA?KHAIJHA BEAI >ACEC J user
       FJE −v FH@K?AI HA LAH>IA KJFKJ E F=HJE?K=H FHLE@EC = BAM >EJI B BAA@>=? J DAF
       JDA KIAH @AJA?J EIJOFEC
       .H AN=FA J =@@ = IA?HAJ J JDA BEA HA=@ >O factotum" =J IJ=HJKF FA = AM ME@M JOFA
          % ramfs −p; cd /tmp
          % auth/secstore −g factotum
          secstore password:
          % echo ’key proto=apop dom=x.com user=ehg !password=hi’ >> factotum
          % auth/secstore −p factotum
          secstore password:
          % read −m factotum > /mnt/factotum/ctl
       =@ @AAJA JDA ME@M 6DA BEHIJ EA ?HA=JAI = AFDAAH= AHOHAIE@AJ MHIF=?A ELEIE>A
       J JDAHI =@ =KJ=JE?=O HALA@ MDA JDA ME@M EI @AAJA@ 6DA ANJ JDHAA ?=@I BAJ?D
       JDA FAHIEIJAJ ?FO B JDA IA?HAJI =FFA@ = AM IA?HAJ =@ I=LA JDA KF@=JA@ BEA >=? J IA?IJHA
       6DA BE= ?=@ =@I JDA AM IA?HAJ EJ JDA HKEC B=?JJK
       6DA ipso ?=@ F=?=CAI JDEI IAGKA?A EJ = ?LAEAJ I?HEFJ J IEFEBO A@EJEC B files
       IJHA@  = IA?KHA IJHA 1J ?FEAI JDA =A@ files EJ = ?= ramfs" =@ ELAI acme 
       JDA 9DA JDA A@EJH ANEJI ipso FHFJI JDA KIAH J ?BEH ?FOEC @EBA@ H AMO ?HA=JA@
       BEAI >=? J secstore. 1B  file EI AJEA@ ipso CH=>I = JDA KIAH I BEAI BH secstore BH A@EJ
       EC
       *O @AB=KJ ipso ME A@EJ JDA secstore BEAI =@ EB A B JDA EI =A@ factotum BKID ?KHHAJ
       AOI BH B=?JJK =@ =@ JDA AM AI BH JDA BEA 1B JDA −e −f H −l FJEI =HA CELA
       ipso ME KIJ FAHBH O JDA HAGKAIJA@ FAH=JEI EA A@EJ BKID =@H =@
       6DA −s FJE B ipso ELAI sam =I JDA A@EJH EIJA@ B acme JDA −a FJE FHLE@AI = IEE
       =H IAHLE?A BH BEAI A?HOFJA@ >O aescbc q.v. 9EJD JDA −a FJE JDA BK HJA@ F=JD=A B JDA
       file KIJ >A IFA?EBEA@ =@ = files KIJ >A A?HOFJA@ MEJD JDA I=A AO )I MEJD −a AMO ?HA
       =JA@ BEAI =HA ECHA@



                                                     !
5-+564-                                                                                   5-+564-



       Aescbc A?HOFJI K@AH −e =@ @A?HOFJI K@AH −d KIEC )-5 4E@=A E ?EFDAH >? ?D=EEC
       +*+ @A FJEI i =@ n =HA =I FAH secstore AN?AFJ JD=J i HA=@I BH BEA @AI?HEFJH !
SOURCE
     /rc/bin/ipso
     /sys/src/cmd/auth/secstore
SEE ALSO
      factotum" secstore&
BUGS
       6DAHA EI @AE>AH=JAO  >=?KF B BEAI  JDA IA?IJHA I −r H = @EI ?H=ID EI EHHAL?=>A ;K
       =HA =@LEIA@ J IJHA EFHJ=J IA?HAJI E = IA?@ ?=JE
       9DA KIEC ipso IA?HAJI ME =FFA=H =I F=E JANJ E JDA A@EJH ME@M I KIA JDA ?=@ E FHE
       L=JA




                                                     "
5-,                                                                                                    5-,




NAME
         IA@    IJHA= A@EJH
SYNOPSIS
     sed  −n   −g   −e script   −f sfile   file ... 
DESCRIPTION
      Sed ?FEAI JDA =A@ files IJ=@=H@ EFKJ @AB=KJ J JDA IJ=@=H@ KJFKJ A@EJA@ =??H@EC J =
      I?HEFJ B ?=@I 6DA −f FJE ?=KIAI JDA I?HEFJ J >A J=A BH BEA sfile JDAIA FJEI
      =??KK=JA 1B JDAHA EI KIJ A −e FJE =@  −f I JDA FJE −e =O >A EJJA@ 6DA −n
      FJE IKFFHAIIAI JDA @AB=KJ KJFKJ −g ?=KIAI = IK>IJEJKJEI J >A C>= =I EB IKBBENA@ g
         ) I?HEFJ ?IEIJI B A@EJEC ?=@I A FAH EA B JDA BMEC BH
                   address , address  function argument  ;
         1 H= FAH=JE sed ?O?E?=O ?FEAI = EA B EFKJ EJ = pattern space KAII JDAHA EI IA
         JDEC ABJ =BJAH = D ?=@ =FFEAI E IAGKA?A = ?=@I MDIA addresses IAA?J JD=J F=J
         JAH IF=?A =@ =J JDA A@ B JDA I?HEFJ ?FEAI JDA F=JJAH IF=?A J JDA IJ=@=H@ KJFKJ AN?AFJ
         K@AH −n =@ @AAJAI JDA F=JJAH IF=?A
         ) address EI AEJDAH = @A?E= K>AH JD=J ?KJI EFKJ EAI ?KK=JELAO =?HII BEAI = $ JD=J
         =@@HAIIAI JDA =IJ EA B EFKJ H = ?JANJ =@@HAII /regular−expression / E JDA IJOA B
         regexp$ MEJD JDA =@@A@ ?LAJE JD=J \n =J?DAI = AMEA A>A@@A@ E JDA F=JJAH IF=?A
         ) ?=@ EA MEJD  =@@HAIIAI IAA?JI ALAHO F=JJAH IF=?A
         ) ?=@ EA MEJD A =@@HAII IAA?JI A=?D F=JJAH IF=?A JD=J =J?DAI JDA =@@HAII
         ) ?=@ EA MEJD JM =@@HAIIAI IAA?JI JDA E?KIELA H=CA BH JDA BEHIJ F=JJAH IF=?A JD=J
         =J?DAI JDA BEHIJ =@@HAII JDHKCD JDA ANJ F=JJAH IF=?A JD=J =J?DAI JDA IA?@ 1B JDA IA?@
         =@@HAII EI = K>AH AII JD= H AGK= J JDA EA K>AH BEHIJ IAA?JA@ O A EA EI IAA?JA@
         6DAHA=BJAH JDA FH?AII EI HAFA=JA@ EC =C=E BH JDA BEHIJ =@@HAII
         -@EJEC ?=@I ?= >A =FFEA@ J IAA?JA@ F=JJAH IF=?AI >O KIA B JDA AC=JE BK?JE
         ! >AM
         ) =HCKAJ @AJA@ text ?IEIJI B A H HA EAI = >KJ JDA =IJ B MDE?D A@ MEJD \ J
         DE@A JDA AMEA *=?I=IDAI E JANJ =HA JHA=JA@ EA >=?I=IDAI E JDA HAF=?AAJ IJHEC B = s
         ?=@ =@ =O >A KIA@ J FHJA?J EEJE= >=I =@ J=>I =C=EIJ JDA IJHEFFEC JD=J EI @A 
         ALAHO I?HEFJ EA
         ) =HCKAJ @AJA@ rfile H wfile KIJ JAHE=JA JDA ?=@ EA =@ KIJ >A FHA?A@A@ >O
         AN=?JO A >= -=?D wfile EI ?HA=JA@ >ABHA FH?AIIEC >ACEI 6DAHA ?= >A =J IJ   @EI
         JE?J wfile =HCKAJI
         a\
         text              )FFA@ 2=?A text  JDA KJFKJ >ABHA HA=@EC JDA ANJ EFKJ EA
         b label           *H=?D J JDA : ?=@ >A=HEC JDA label 1B label EI AFJO >H=?D J JDA A@ B
                           JDA I?HEFJ
         c\
         text              +D=CA ,AAJA JDA F=JJAH IF=?A 9EJD  H  =@@HAII H =J JDA A@ B =           
                           =@@HAII H=CA F=?A text  JDA KJFKJ 5J=HJ JDA ANJ ?O?A
         d                 ,AAJA JDA F=JJAH IF=?A 5J=HJ JDA ANJ ?O?A
         D                 ,AAJA JDA EEJE= IACAJ B JDA F=JJAH IF=?A JDHKCD JDA BEHIJ AMEA 5J=HJ JDA
                           ANJ ?O?A
         g                 4AF=?A JDA ?JAJI B JDA F=JJAH IF=?A >O JDA ?JAJI B JDA D@ IF=?A
         G                 )FFA@ JDA ?JAJI B JDA D@ IF=?A J JDA F=JJAH IF=?A
         h                 4AF=?A JDA ?JAJI B JDA D@ IF=?A >O JDA ?JAJI B JDA F=JJAH IF=?A
         H                 )FFA@ JDA ?JAJI B JDA F=JJAH IF=?A J JDA D@ IF=?A
         i\




                                                         #
5-,                                                                                                  5-,



         text           1IAHJ 2=?A text  JDA IJ=@=H@ KJFKJ
         n              +FO JDA F=JJAH IF=?A J JDA IJ=@=H@ KJFKJ 4AF=?A JDA F=JJAH IF=?A MEJD JDA
                        ANJ EA B EFKJ
         N              )FFA@ JDA ANJ EA B EFKJ J JDA F=JJAH IF=?A MEJD = A>A@@A@ AMEA
                        6DA ?KHHAJ EA K>AH ?D=CAI
         p              2HEJ +FO JDA F=JJAH IF=?A J JDA IJ=@=H@ KJFKJ
         P              +FO JDA EEJE= IACAJ B JDA F=JJAH IF=?A JDHKCD JDA BEHIJ AMEA J JDA IJ=
                        @=H@ KJFKJ
         q              3KEJ *H=?D J JDA A@ B JDA I?HEFJ , J IJ=HJ = AM ?O?A
         r rfile        4A=@ JDA ?JAJI B rfile 2=?A JDA  JDA KJFKJ >ABHA HA=@EC JDA ANJ EFKJ
                        EA
         s/regular−expression/replacement/flags
                      5K>IJEJKJA JDA replacement IJHEC BH EIJ=?AI B JDA regular−expression E JDA
                      F=JJAH IF=?A )O ?D=H=?JAH =O >A KIA@ EIJA=@ B / .H = BKAH @AI?HEFJE
                      IAA regexp$ Flags EI AH H HA B
                        g         />= 5K>IJEJKJA BH = LAH=FFEC EIJ=?AI B JDA regular
                                  expression H=JDAH JD= KIJ JDA BEHIJ A
                        p         2HEJ JDA F=JJAH IF=?A EB = HAF=?AAJ M=I =@A
                        w wfile
                                  9HEJA )FFA@ JDA F=JJAH IF=?A J wfile EB = HAF=?AAJ M=I =@A
         t label        6AIJ *H=?D J JDA : ?=@ >A=HEC JDA label EB =O IK>IJEJKJEI D=LA >AA
                        =@A IE?A JDA IJ HA?AJ HA=@EC B = EFKJ EA H ANA?KJE B = t 1B label EI
                        AFJO >H=?D J JDA A@ B JDA I?HEFJ
         w              wfile
                        9HEJA )FFA@ JDA F=JJAH IF=?A J wfile
         x              -N?D=CA JDA ?JAJI B JDA F=JJAH =@ D@ IF=?AI
         y/string1/string2/
                       6H=IBH 4AF=?A = ??KHHA?AI B ?D=H=?JAHI E string1 MEJD JDA ?HHAIF@EC
                       ?D=H=?JAH E string2 6DA ACJDI B string1 =@ string2 KIJ >A AGK=
         !function      , J )FFO JDA function H CHKF EB function EI { O J EAI not IAA?JA@ >O
                        JDA =@@HAIIAI
         #              +AJ 1CHA JDA HAIJ B JDA EA
         : label        6DEI ?=@ @AI JDEC EJ >A=HI = label BH b =@ t ?=@I J >H=?D J
         =              2=?A JDA ?KHHAJ EA K>AH  JDA IJ=@=H@ KJFKJ =I = EA
         {              -NA?KJA JDA BMEC ?=@I JDHKCD = =J?DEC } O MDA JDA F=JJAH
                        IF=?A EI IAA?JA@
                        ) AFJO ?=@ EI ECHA@
EXAMPLES
     sed 10q file
          2HEJ JDA BEHIJ  EAI B JDA BEA
         sed ’/^$/d’
              ,AAJA AFJO EAI BH IJ=@=H@ EFKJ
         sed ’s/UNIX/& system/g’
              4AF=?A ALAHO EIJ=?A B UNIX >O UNIX system
         sed ’s/ *$//   @HF JH=EEC >=I
         /^$/d          @HF AFJO EAI
         s/ */\         HAF=?A >=I >O AMEAI
         /g
         /^$/d’ chapter*




                                                        $
5-,                                                                                           5-,



                2HEJ JDA BEAI chapter1 chapter2 AJ? A MH@ J = EA
         nroff −ms manuscript | sed ’
         ${
              /^$/p           EB =IJ EA B BEA EI AFJO FHEJ EJ
         }
         //N                  EB ?KHHAJ EA EI AFJO =FFA@ ANJ EA
         /^\n$/D’             EB JM EAI =HA AFJO @AAJA JDA BEHIJ
              ,AAJA = >KJ A B A=?D CHKF B AFJO EAI BH = BH=JJA@ =KI?HEFJ
SOURCE
     /sys/src/cmd/sed.c
SEE ALSO
      ed grep awk lex sam regexp$
       - ?=D 5-,       ) EJAH=?JELA 6ANJ -@EJH  7EN 4AIA=H?D 5OIJA 2HCH=AH I =
      K= 8KA 
BUGS
         1B EFKJ EI BH = FEFA >KBBAHEC =O ?IKA ?D=H=?JAHI >AO@ = EA  MDE?D = q ?=@ EI
         ANA?KJA@




                                                    %
5-3                                                                                              5-3




NAME
         IAG   FHEJ IAGKA?AI B K>AHI
SYNOPSIS
     seq  −w   −fformat   first  incr   last
DESCRIPTION
      Seq FHEJI = IAGKA?A B K>AHI A FAH EA BH first @AB=KJ  J =I A=H last =I FIIE>A E
      E?HAAJI B incr @AB=KJ  6DA F EI

           for(val = min; val <= max; val += incr) print val;

         6DA K>AHI =HA EJAHFHAJA@ =I B=JEC FEJ
         H=O EJACAH L=KAI =HA FHEJA@ =I @A?E= EJACAHI 6DA FJEI =HA
         −fformat      7IA JDA print IJOA format print BH FHEJEC A=?D B=JEC FEJ K>AH 6DA
                       @AB=KJ EI %g
         −w            -GK=EA JDA ME@JDI B = K>AHI >O F=@@EC MEJD A=@EC AHI =I A?AII=HO J
                       ABBA?JELA MEJD FJE −f H MEJD K>AHI E ANFAJE= J=JE
EXAMPLES
     seq 0 .05 .1
          2HEJ 0 0.05 0.1  IAF=H=JA EAI
         seq −w 0 .05 .1
              2HEJ 0.00 0.05 0.10
SOURCE
     /sys/src/cmd/seq.c
BUGS
         FJE −w =M=OI IKHLAOI ALAHO L=KA E =@L=?A 6DKI seq −w 1000000000 EI = F=EBK M=O
         J CAJ = EBEEJA IAGKA?A




                                                       &
51-                                                                                       51-




NAME
          IEA   FHEJ IEA B ANA?KJ=>A BEAI
SYNOPSIS
     size  file ... 
DESCRIPTION
      Size FHEJI JDA IEA B JDA IACAJI BH A=?D B JDA =HCKAJ ANA?KJ=>A BEAI @AB=KJ v.out
      6DA BH=J EI
                 textsizet  datasized  bsssizeb  total
          MDAHA JDA K>AHI =HA E >OJAI
SOURCE
     /sys/src/cmd/size.c
SEE ALSO
      a.out$




                                                     '
5--2                                                                       5--2




NAME
       IAAF   IKIFA@ ANA?KJE BH = EJAHL=
SYNOPSIS
     sleep time
DESCRIPTION
      Sleep IKIFA@I ANA?KJE BH time IA?@I Time =O >A B=JECFEJ
EXAMPLES
     -NA?KJA = ?=@  IA?@I DA?A
               {sleep 100; command}&
       4AFA=J = ?=@ ALAHO ! IA?@I
               while (){
                    command
                    sleep 30
               }
SOURCE
     /sys/src/cmd/sleep.c
SEE ALSO
      sleep 




                                                   
5-1                                                                                         5-1




NAME
       IAE    FHAFH?AII I E?KIE ?=@I E JHBB EFKJ
SYNOPSIS
     soelim  files ... 
DESCRIPTION
      Soelim HA=@I JDA IFA?EBEA@ BEAI H JDA IJ=@=H@ EFKJ =@ FAHBHI JDA JANJK= E?KIE EFEA@ >O
      troff @EHA?JELAI B JDA BH

            .so some_file

       MDA JDAO =FFA=H =J JDA >ACEEC B EFKJ EAI 6DEI EI KIABK MDA KIEC FHCH=I IK?D =I
       tbl JD=J @ J H=O @ JDEI =MEC F=?AAJ B E@ELE@K= J=>AI H JDAH JANJ >A?JI E
       IAF=H=JA BEAI J >A HK =I = F=HJ B = =HCA @?KAJ
       JA JD=J E?KIE ?= >A IKFFHAIIA@ >O KIEC ’ EIJA=@ B . =J JDA IJ=HJ B JDA EA =I E

            ’so /usr/share/lib/tmac/tmac.s
SOURCE
     /rc/bin/soelim
SEE ALSO
      troff
BUGS
       6DA IDA I?HEFJ M=I MHEJJA >O 5=FA KA@AH




                                                     
546                                                                                             546




NAME
       IHJ   IHJ =@H AHCA BEAI
SYNOPSIS
     sort  −cmuMbdfinrwtx   +pos1  −pos2      −k pos1  ,pos2   
              −o output   −T dir    option    file  
DESCRIPTION
      Sort IHJI EAI B = JDA files JCAJDAH =@ MHEJAI JDA HAIKJ  JDA IJ=@=H@ KJFKJ 1B  EFKJ
      BEAI =HA =A@ JDA IJ=@=H@ EFKJ EI IHJA@
       6DA @AB=KJ IHJ AO EI = AJEHA EA ,AB=KJ H@AHEC EI ANE?CH=FDE? >O HKAI 6DA H@AHEC EI
       =BBA?JA@ C>=O >O JDA BMEC FJEI A H HA B MDE?D =O =FFA=H
       −M      +F=HA =I JDI 6DA BEHIJ JDHAA MDEJA IF=?A ?D=H=?JAHI B JDA BEA@ =HA B@A@ J
               KFFAH ?=IA =@ ?F=HA@ I JD=J JAN FHA?A@AI FEB AJ? 1L=E@ BEA@I ?F=HA M J
               JAN
       −b      1CHA A=@EC MDEJA IF=?A IF=?AI =@ J=>I E BEA@ ?F=HEII
       −d       2DA @EHA?JHO H@AH O AJJAHI =??AJA@ AJJAHI @ECEJI =@ MDEJA IF=?A =HA IECEBE?=J
               E ?F=HEII
       −f      .@ MAH ?=IA AJJAHI J KFFAH ?=IA )??AJA@ ?D=H=?JAHI =HA B@A@ J JDAEH 
               =??AJA@ KFFAH ?=IA BH
       −i      1CHA ?D=H=?JAHI KJIE@A JDA )5+11 H=CA "%$ E KAHE? ?F=HEII
       −w      EA −i >KJ ECHA O J=>I =@ IF=?AI
       −n      ) EEJE= KAHE? IJHEC ?IEIJEC B FJE= MDEJA IF=?A FJE= FKI H EKI IEC
               =@ AH H HA @ECEJI MEJD FJE= @A?E= FEJ EI IHJA@ >O =HEJDAJE? L=KA
       −g      K>AHI EA −n >KJ MEJD FJE= eIJOA ANFAJI =HA IHJA@ >O L=KA
       −r      4ALAHIA JDA IAIA B ?F=HEII
       −tx     6=> ?D=H=?JAH IAF=H=JEC BEA@I EI x
       6DA J=JE +pos1 −pos2 HAIJHE?JI = IHJ AO J = BEA@ >ACEEC =J pos1 =@ A@EC KIJ >ABHA
       pos2 Pos1 =@ pos2 A=?D D=LA JDA BH m.n FJE=O BMA@ >O A H HA B JDA B=CI
       Mbdfginr MDAHA m JAI = K>AH B BEA@I J IEF BH JDA >ACEEC B JDA EA =@ n JAI =
       K>AH B ?D=H=?JAHI J IEF BKHJDAH 1B =O B=CI =HA FHAIAJ JDAO LAHHE@A = JDA C>= H@AHEC
       FJEI BH JDEI AO ) EIIEC .n A=I .0 = EIIEC −pos2 A=I JDA A@ B JDA EA 7@AH
       JDA −tx FJE BEA@I =HA IJHECI IAF=H=JA@ >O x JDAHMEIA BEA@I =HA AFJO IJHECI IAF=
       H=JA@ >O MDEJA IF=?A 9DEJA IF=?A >ABHA = BEA@ EI F=HJ B JDA BEA@ AN?AFJ K@AH FJE −b ) b
       B=C =O >A =JJ=?DA@ E@AFA@AJO J pos1 =@ pos2.
       6DA J=JE −k pos1pos2 EI DM 251: sort @ABEAI BEA@I pos1 =@ pos2 D=LA JDA I=A BH=J
       >KJ @EBBAHAJ A=ECI 6DA L=KA B m EI HECE  EIJA=@ B HECE  =@ = EIIEC .n E pos2 EI
       JDA A@ B JDA BEA@
       9DA JDAHA =HA KJEFA IHJ AOI =JAH AOI =HA ?F=HA@ O =BJAH = A=HEAH AOI ?F=HA
       AGK= EAI JD=J JDAHMEIA ?F=HA AGK= =HA H@AHA@ MEJD = >OJAI IECEBE?=J
       6DAIA FJE =HCKAJI =HA =I K@AHIJ@
       −c           +DA? JD=J JDA IECA EFKJ BEA EI IHJA@ =??H@EC J JDA H@AHEC HKAI CELA  KJ
                    FKJ KAII JDA BEA EI KJ B IHJ
       −m           AHCA =IIKA JDA EFKJ BEAI =HA =HA=@O IHJA@
       −u           5KFFHAII = >KJ A E A=?D IAJ B AGK= EAI 1CHA@ >OJAI =@ >OJAI KJIE@A AOI
                    @ J F=HJE?EF=JA E JDEI ?F=HEI
       −o           6DA ANJ =HCKAJ EI JDA =A B = KJFKJ BEA J KIA EIJA=@ B JDA IJ=@=H@ KJ
                    FKJ 6DEI BEA =O >A JDA I=A =I A B JDA EFKJI




                                                       
546                                                                                             546



        −Tdir       2KJ JAFH=HO BEAI E dir H=JDAH JD= E /tmp
EXAMPLES
     sort −u +0f +0 list
          2HEJ E =FD=>AJE?= H@AH = JDA KEGKA IFAECI E = EIJ B MH@I MDAHA ?=FEJ=EA@ MH@I
          @EBBAH BH K?=FEJ=EA@
        sort −t: +1 /adm/users
             2HEJ JDA KIAHI BEA IHJA@ >O KIAH =A JDA IA?@ ?IAF=H=JA@ BEA@
        sort −umM dates
             2HEJ JDA BEHIJ EIJ=?A B A=?D JD E = =HA=@O IHJA@ BEA FJEI −um MEJD KIJ A
             EFKJ BEA =A JDA ?DE?A B = KEGKA HAFHAIAJ=JELA BH = IAJ B AGK= EAI FHA@E?J=>A
        grep −n ’^’ input | sort −t: +1f +0n | sed ’s/[0−9]*://’
             ) IJ=>A IHJ EFKJ EAI JD=J ?F=HA AGK= ME ?A KJ E JDAEH HECE= H@AH
FILES
        /tmp/sort.<pid>.<ordinal>
SOURCE
     /sys/src/cmd/sort.c
SEE ALSO
      uniq look
DIAGNOSTICS
     Sort ?AJI =@ ANEJI MEJD K IJ=JKI BH L=HEKI JHK>A ?@EJEI =@ BH @EIH@AH @EI
     ?LAHA@ K@AH FJE −c
BUGS
        ) ANJAH= K ?D=H=?JAH ?= >A ?BKIA@ MEJD = EJAH=O CAAH=JA@ A@BBEA@ ?D=H=?JAH
        6DA HAIKJ ?= =A = IK>BEA@ J IHJ AII JD= = CAH BEA@
        5A B JDA FJEI AC −i =@ −M =HA DFAAIIO FHLE?E=




                                                     !
52-                                                                                           52-




NAME
        IFA IFHC   BE@ IFAEC AHHHI
SYNOPSIS
     spell  options    file  
        aux/sprog  options   −f file 
DESCRIPTION
      Spell I KF MH@I BH JDA =A@ files IJ=@=H@ EFKJ @AB=KJ E = IFAEC EIJ =@ F=?AI FI
      IE>A EIIFAECI MH@I J I=?JEA@ JDAHA  JDA IJ=@=H@ KJFKJ
        Spell ECHAI ?IJHK?JI B troff =@ EJI IJ=@=H@ FHAFH?AIIHI 1J K@AHIJ=@I JDAIA FJEI
        −b     +DA? *HEJEID IFAEC
        −v     2HEJ = MH@I J EJAH=O E JDA IFAEC EIJ MEJD @AHEL=JEI
        −x     2HEJ  IJ=@=H@ AHHH =HA@ MEJD = ALAHO IJA =I EJ EI A@ KF E JDA IFAEC EIJ
               =C MEJD EJI =BBEN ?=IIAI
        )I = =JJAH B FE?O spell @AI J =@EJ KJEFA IFAECI B JDA I=A MH@ 8=HE=JI JD=J B
        M CAAH= HKAI =HA FHABAHHA@ LAH JDIA JD=J @ J ALA MDA JDA KHKO IFAEC EI HA ?
         6DKI E )AHE?= KI=CA @AA@  IEA=>A  =@ K@CAJ =HA HAA?JA@ E B=LH B
         @AA@  IE=>A  =@ K@CAAJ  )CCKJE=JA@ L=HE=JI =HA IDKA@ ?HAMA>AH =@
         >=?O=H@ ?A@A J ?HAM A>AH =@ >=? O=H@ K H >=?O=H@ =@A?JELA
FILES
        /sys/lib/amspell            )AHE?= IFAEC EIJ
        /sys/lib/brspell            *HEJEID IFAEC EIJ
        /bin/aux/sprog              6DA =?JK= IFAEC ?DA?AH 1J ANFA?JI A MH@ FAH EA  IJ=@=H@
                                    EFKJ =@ J=AI JDA I=A =HCKAJI =I spell
SOURCE
     /rc/bin/spell                       JDA I?HEFJ
     /sys/src/cmd/spell                  IKH?A BH sprog
SEE ALSO
      deroff
BUGS
        6DA DAKHEIJE?I B deroff KIA@ J AN?EIA BH=JJEC EBH=JE =HA EFAHBA?J
        6DA IFAEC EIJ I ?LAH=CA EI KALA E F=HJE?K=H >ECO A@E?EA =@ ?DAEIJHO =@ FAHBH?A
        FHFAH =AI J J AJE =CK=CAI JDAH JD= -CEID =HA ?LAHA@ LAHO ECDJO




                                                        "
521                                                                                                   521




NAME
       IFE  LAHEBE?=JE J BH @AI B ??KHHAJ IOIJAI
SYNOPSIS
     spin −a  −m   −Pcpp  file
       spin  −bglmprsv   −nN   −Pcpp  file
       spin −c  −t   −Pcpp  file
       spin −d  −Pcpp  file
       spin −f ltl
       spin −F file
       spin −i  −bglmprsv   −nN   −Pcpp  file
       spin −M  −t   −Pcpp  file
       spin −tN  −bglmprsv   −jN   −Pcpp  file
       spin −V
DESCRIPTION
      Spin EI = J BH ==OEC JDA CE?= ?IEIJA?O B =IO?DHKI IOIJAI IFA?EBE?=O @EI
      JHE>KJA@ IBJM=HA =@ ?KE?=JE FHJ?I ) LAHEBE?=JE @A B JDA IOIJA EI BEHIJ IFA?E
      BEA@ E = CK=H@A@ ?=@ =CK=CA ?=A@ Promela 6DEI IFA?EBE?=JE =CK=CA @AI?HE>A@ E JDA
      HABAHA?A =MI BH JDA @AEC B @O=E? ?HA=JE B =IO?DHKI FH?AIIAI @AJAHEEI
      JE? ?=IA IAA?JE FI CJI ?= =@ C>= L=HE=>AI 1J =I =MI BH = ??EIA IFA?EBE?=JE
      B CE?= ?HHA?JAII HAGKEHAAJI E?K@EC >KJ J HAIJHE?JA@ J HAGKEHAAJI ANFHAIIA@ E E
      A=H JAFH= CE?
       /ELA = 2HA= @A IJHA@ E file spin ?= FAHBH EJAH=?JELA CKE@A@ H H=@ IEK=JEI
       B JDA IOIJA I ANA?KJE 1J ?= =I CAAH=JA = + FHCH= JD=J FAHBHI = AND=KIJELA H
       =FFHNE=JA LAHEBE?=JE B JDA ?HHA?JAII HAGKEHAAJI BH JDA IOIJA
       −a        /AAH=JA = LAHEBEAH @A ?DA?AH BH JDA IFA?EBE?=JE 6DA KJFKJ EI MHEJJA EJ = IAJ B
                 + BEAI =A@ pan.[cbhmt] JD=J ?= >A ?FEA@ pcc pan.c J FH@K?A = ANA
                 ?KJ=>A LAHEBEAH 6DA EA spin =K=I IAA >AM ?J=E JDA @AJ=EI  ?FE=JE
                 =@ KIA B JDA LAHEBEAHI
       −c        2H@K?A = )5+11 =FFHNE=JE B = AII=CA IAGKA?A ?D=HJ BH = H=@ H CKE@A@
                 MDA ?>EA@ MEJD −t IEK=JE HK 5AA =I FJE −M
       −d        2H@K?A IO> J=>A EBH=JE BH JDA @A IFA?EBEA@ E file .H A=?D 2HA= >A?J
                 JDEI EBH=JE E?K@AI JDA JOFA =A =@ K>AH B AAAJI EB @A?=HA@ =I = =HH=O
                 JDA EEJE= L=KA EB = @=J= >A?J H IEA EB = AII=CA ?D=A JDA I?FA C>= H ?=
                 =@ MDAJDAH JDA >A?J EI @A?=HA@ =I = L=HE=>A H =I = F=H=AJAH .H AII=CA ?D=AI
                 JDA @=J= JOFAI B JDA AII=CA BEA@I =HA EIJA@ .H IJHK?JKHA L=HE=>AI JDA JDEH@ BEA@
                 @ABEAI JDA =A B JDA IJHK?JKHA @A?=H=JE JD=J ?J=EI JDA L=HE=>A
       −f ltl 6H=I=JA JDA 6 BHK= ltl EJ = never ?=E
              6DEI FJE HA=@I = BHK= E 6 IOJ=N BH JDA IA?@ =HCKAJ =@ JH=I=JAI EJ EJ
              2HA= IOJ=N = never ?=E MDE?D EI 2HA= I AGKEL=AJ B = * ?DE )KJ=J 6DA
              6 FAH=JHI =HA MHEJJA [] =M=OI <> ALAJK=O =@ U IJHC KJE 6DAHA EI  X
              ANJ FAH=JH J IA?KHA ?F=JE>EEJO MEJD JDA F=HJE= H@AH HA@K?JE HKAI JD=J =HA
              =FFEA@ @KHEC JDA LAHEBE?=JE FH?AII 1B JDA BHK= ?J=EI IF=?AI EJ IDK@ >A GKJA@
              J BH = IECA =HCKAJ J JDA spin ?=@
       −F file
                 6H=I=JA JDA 6 BHK= IJHA@ E file EJ = never ?=E
                 6DEI >AD=LAI E@AJE?=O J FJE −f >KJ ME HA=@ JDA BHK= BH JDA file EIJA=@ B BH
                 JDA ?=@ EA 6DA BEA IDK@ ?J=E JDA BHK= =I JDA BEHIJ EA )O JANJ JD=J B
                 MI JDEI BEHIJ EA EI ECHA@ I EJ ?= >A KIA@ J IJHA ?AJI H =J=JE  JDA BH
                 K=  IA IOIJAI JDA GKJEC ?LAJEI B JDA IDA ?FE?=JA JDA KIA B FJE
                 −f FJE −F EI A=J J ILA JDIA FH>AI




                                                        #
521                                                                                              521



      −i     2AHBH = EJAH=?JELA IEK=JE FHFJEC JDA KIAH =J ALAHO ANA?KJE IJAF JD=J HAGKEHAI
             = @AJAHEEIJE? ?DE?A J >A =@A 6DA IEK=JE FH?AA@I MEJDKJ KIAH EJAHLAJE
             MDA ANA?KJE EI @AJAHEEIJE?
      −M     2H@K?A = AII=CA IAGKA?A ?D=HJ E 2IJI?HEFJ BH BH = H=@ IEK=JE H = CKE@A@
             IEK=JE MDA ?>EA@ MEJD −t BH JDA @A E file =@ MHEJA JDA HAIKJ EJ file.ps
             5AA =I FJE −c
      −m     +D=CAI JDA IA=JE?I B IA@ ALAJI H@E=HEO = IA@ =?JE ME >A >?A@ EB JDA J=H
             CAJ AII=CA >KBBAH EI BK 9EJD JDEI FJE = AII=CA IAJ J = BK >KBBAH EI IJ
      −nN    5AJ JDA IAA@ BH = H=@ IEK=JE J JDA EJACAH L=KA N 6DAHA EI  IF=?A >AJMAA JDA
             −n =@ JDA EJACAH N
      −t     2AHBH = CKE@A@ IEK=JE BMEC JDA AHHH JH=E JD=J M=I FH@K?AI >O = A=HEAH LAHEBE
             ?=JE HK IAA JDA EA =K=I BH JDA @AJ=EI  LAHEBE?=JE
      −V     2HEJI JDA spin LAHIE K>AH =@ ANEJI
      9EJD O = BEA=A =I = =HCKAJ =@  FJEI spin FAHBHI = H=@ IEK=JE B JDA
      @A IFA?EBEA@ E JDA BEA IJ=@=H@ EFKJ EI JDA @AB=KJ EB JDA BEA=A EI EJJA@ 1B FJE −i EI
      =@@A@ JDA IEK=JE EI interactive H EB FJE −t EI =@@A@ JDA IEK=JE EI guided
      6DA IEK=JE H=O @AI J CAAH=JA KJFKJ AN?AFJ MD=J EI CAAH=JA@ ANFE?EJO >O JDA KIAH
      MEJDE JDA @A MEJD printf IJ=JAAJI =@ IA @AJ=EI =>KJ JDA BE= IJ=JA JD=J EI HA=?DA@ =BJAH
      JDA IEK=JE ?FAJAI 6DA CHKF B FJEI −bglmprsv IAJI JDA @AIEHA@ ALA B EBH=JE
      JD=J JDA KIAH M=JI =>KJ = H=@ CKE@A@ H EJAH=?JELA IEK=JE HK -LAHO EA B KJFKJ
      H=O ?J=EI = HABAHA?A J JDA IKH?A EA E JDA IFA?EBE?=JE JD=J CAAH=JA@ EJ
      −b     5KFFHAII JDA ANA?KJE B printf IJ=JAAJI MEJDE JDA @A
      −g     5DM =J A=?D JEA IJAF JDA ?KHHAJ L=KA B C>= L=HE=>AI
      −l     1 ?>E=JE MEJD FJE −p IDM JDA ?KHHAJ L=KA B ?= L=HE=>AI B JDA FH?AII
      −p     5DM =J A=?D IEK=JE IJAF MDE?D FH?AII ?D=CA@ IJ=JA =@ MD=J IKH?A IJ=JAAJ M=I
             ANA?KJA@
      −r     5DM = AII=CAHA?AELA ALAJI CELEC JDA =A =@ K>AH B JDA HA?AELEC FH?AII =@
             JDA ?HHAIF@EC JDA IKH?A EA K>AH .H A=?D AII=CA F=H=AJAH IDM JDA AI
             I=CA JOFA =@ JDA AII=CA ?D=A K>AH =@ =A
      −s     5DM = AII=CAIA@ ALAJI
      −v     8AH>IA @A =@@ IA HA @AJ=E =@ CAAH=JA HA DEJI =@ M=HECI =>KJ JDA
             @A
SOURCE
     /sys/src/cmd/spin
SEE ALSO
      http://spinroot.com            GettingStarted.pdf           Roadmap.pdf       Manual.pdf
               WhatsNew.pdf Exercises.pdf
      / 0= Design and Validation of Computer Protocols 2HAJE?A 0= ''
         ,AIEC =@ L=E@=JE B FHJ?I = JKJHE= Computer Networks and ISDN Systems 8 #
       ' ''! FF '&%
         6DA @A ?DA?AH 5FE IEEE Trans. on SE 8 !  # =O ''%




                                                    $
5216                                                                                            5216




NAME
       IFEJ   IFEJ = BEA EJ FEA?AI
SYNOPSIS
     split  option ...   file 
DESCRIPTION
      Split HA=@I file IJ=@=H@ EFKJ >O @AB=KJ =@ MHEJAI EJ E FEA?AI B  EAI FAH KJFKJ BEA 6DA
      =AI B JDA KJFKJ BEAI =HA xaa xab =@ I  J xzz 6DA FJEI =HA
       −n n    5FEJ EJ nEA FEA?AI
       −l n    5OO BH −n n = @ J 7EN I IOJ=N
       −e expression
             .EA @ELEIEI ??KH =J A=?D EA JD=J =J?DAI = HACK=H expression IAA regexp$ KJEFA
             −e FJEI =O =FFA=H 1B = IK>ANFHAIIE B expression EI ?J=EA@ E F=HAJDAIAI
             () JDA KJFKJ BEA =A EI JDA FHJE B JDA EA MDE?D =J?DAI JDA IK>ANFHAIIE
       −f stem
             7IA stem EIJA=@ B x E KJFKJ BEA =AI
       −s suffix
              )FFA@ suffix J =AI E@AJEBEA@ K@AH −e
       −x      -N?K@A JDA =J?DA@ EFKJ EA BH JDA KJFKJ BEA
       −i      1CHA ?=IA E FJE −e BH?A KJFKJ BEA =AI AN?K@EC JDA IKBBEN J MAH ?=IA
SOURCE
     /sys/src/cmd/split.c
SEE ALSO
      sed awk grep regexp$




                                                     %
54+                                                                                                54+




NAME
         IH?   BE@ IKH?A ?@A BH ANA?KJ=>A
SYNOPSIS
     src  −n   −s symbol  file ...
DESCRIPTION
      Src AN=EAI JDA =A@ files J BE@ JDA ?HHAIF@EC IKH?A ?@A MDE?D EI JDA IAJ J JDA A@E
      JH KIEC B IAA sam 1B file EI = rc I?HEFJ JDA IKH?A EI JDA BEA EJIAB 1B file EI = ANA
      ?KJ=>A JDA IKH?A EI @ABEA@ J >A JDA IECA BEA ?J=EEC JDA @ABEEJE B main =@ src ME
      FEJ JDA A@EJH =J JDA EA JD=J >ACEI JDA @ABEEJE Src KIAI db J ANJH=?J JDA IO> J=>A
      EBH=JE JD=J E@AJEBEAI JDA IKH?A
         Src I BH A=?D file E JDA ?KHHAJ @EHA?JHO E /bin =@ E JDA IK>@EHA?JHEAI B /bin E JD=J
         H@AH
         6DA −n B=C ?=KIAI src J FHEJ JDA BEA =A >KJ J IA@ EJ J JDA A@EJH 6DA −s B=C E@AJEBEAI
         = symbol JDAH JD= main J ?=JA
EXAMPLES
     .E@ JDA IKH?A J JDA main HKJEA E /bin/ed
                src ed
         .E@ JDA IKH?A BH strcmp
                src −s strcmp rc
SOURCE
     /rc/bin/src
SEE ALSO
      db plumb sam




                                                       &
550                                                                                               550




NAME
         IID IIDAJ I?F IIDIAHLA       IA?KHA CE =@ BEA ?FO BHJ 7EN H 2= '
SYNOPSIS
     ssh  −CfiImPpRrw   −A authlist   −c cipherlist   −[lu] user  user@host  cmd  args 
     
         sshnet  −A authlist   −c cipherlist   −m mtpt   −s service  user@host
         scp DIJBEA DIJBEA
         scp DIJBEA  DIJ@EH
         aux/sshserve  −p  address
DESCRIPTION
      Ssh =MI =KJDAJE?=JA@ CE LAH = A?HOFJA@ ?D=A J DIJI JD=J IKFFHJ JDA IID FHJ?
      IAA JDA 4.+I EIJA@ >AM BH A?HOFJE =@ =KJDAJE?=JE @AJ=EI
         Ssh J=AI JDA DIJ =A B JDA =?DEA J ?A?J J =I EJI =@=JHO =HCKAJ 1J =O >A IFA?E
         BEA@ =I = @=E =A H = 12 =@@HAII H=O CE EI =JJAFJA@ KIEC JDA KIAH =A BH
         @ALKIAH
         +=@EA FJEI =HA
         −C      BH?A EFKJ J >A HA=@ E ?A@ @A EA =J = JEA MEJD ?= A?D
         −f      A=>A =CAJ BHM=H@EC 9EJD JDEI B=C ssh KIAI 550 I =CAJ BHM=H@EC FHJ? J =M
                 FHCH=I HKEC  JDA HAJA IAHLAH J EJAH=?J MEJD factotum" J FAHBH 45) =KJDA
                 JE?=JE
         −i      BH?A EJAH=?JELA @A 1 EJAH=?JELA @A ssh FHFJI BH F=IIMH@I =@ ?BEH=JEI
                 B AM DIJ AOI MDA A?AII=HO 1 EJAH=?JELA @A F=IIMH@ HAGKAIJI =HA
                 HAA?JA@ =@ KHA?CEA@ DIJ AOI =HA ?=KIA BH @EI?A?JEC *O @AB=KJ ssh HKI E
                 EJAH=?JELA @A O MDA EJI EFKJ BEA @AI?HEFJH EI /dev/cons
         −I      BH?A EJAH=?JELA @A
         −m      @EI=>A JDA ?JH\ AK @AI?HE>A@ >AM
         −p      BH?A FIAK@JAHE= HAGKAIJ 6DA ssh FHJ? CHK@A@ E 7EN JH=@EJE @EBBAHAJE=JAI
                 >AJMAA ?A?JEI JD=J HAGKAIJ ?JHEC FIAK@JAHE=I =@ JDIA JD=J @ J *O
                 @AB=KJ ssh HAGKAIJI = FIAK@JAHE= O MDA  command EI CELA
         −P      BH?A  FIAK@JAHE= HAGKAIJ
         −r      IJHEF ?=HHE=CA HAJKHI
         −R      FKJ JDA =?=JA@ FIAK@JAHE= EB =O E H=M @A
         −w      JEBO JDA HAJA IE@A MDAALAH JDA ME@M ?D=CAI IEA
         −lu user
                IFA?EBO KIAH =A 6DEI FJE EI @AFHA?=JA@ E B=LH B JDA user@hostname IOJ=N
         −A authlist
               IFA?EBO = H@AHA@ IF=?AIAF=H=JA@ EIJ B =KJDAJE?=JE FHJ?I J JHO 6DA BK IAJ B
               =KJDAJE?=JE FHJ?I EI rsa 45) KIEC factotum" J @AH=JA AO KI=CA
               password KIA = F=IIMH@ C=JDAHA@ BH B=?JJK =@ tis ?D=ACAHAIFIA 6DA
               @AB=KJ EIJ EI = JDHAA E JD=J H@AH
         −c cipherlist
                IFA?EBO = H@AHA@ IF=?AIAF=H=JA@ EIJ B =MA@ ?EFDAHI J KIA MDA A?HOFJEC JDA
                ?D=A 6DA BK IAJ B ?EFDAHI EI des IJ=@=H@ ,-5 3des = IAMD=J @K>JBK L=HE=
                JE  JHEFA ,-5 blowfish *HK?A 5?DAEAH I *MBEID rc4 4+" =@ none 
                A?HOFJE 6DA @AB=KJ ?EFDAH EIJ EI blowfish rc4 3des
         6DA ?JH \ ?D=H=?JAH EI = ?= AI?=FA =I E con 1J FHFJI MEJD >>> ACEJE=JA HAIFIAI
         J JDA FHFJ =HA
         q       -NEJ




                                                           '
550                                                                                              550



         .      4AJKH BH JDA AI?=FA
         !cmd 4K JDA ?=@ MEJD JDA AJMH ?A?JE =I EJI IJ=@=H@ EFKJ =@ IJ=@=H@ KJFKJ
              5J=@=H@ AHHH ME C J JDA I?HAA
         r      6CCA FHEJEC B ?=HHE=CA HAJKHI
         1B  ?=@ EI IFA?EBEA@ = CE IAIIE EI IJ=HJA@  JDA HAJA DIJ JDAHMEIA JDA ?
         =@ EI ANA?KJA@ MEJD EJI =HCKAJI
         Ssh AIJ=>EIDAI = ?A?JE MEJD = IID @=A  JDA HAJA DIJ 6DA @=A IA@I J ssh
         EJI 45) FK>E? DIJ AO =@ IAIIE AO 7IEC JDAIA ssh IA@I = IAIIE AO MDE?D FHAIK=>O
         O JDA @=A ?= @A?EFDAH )BJAH JDEI >JD IE@AI IJ=HJ A?HOFJEC JDAEH @=J= MEJD JDEI IAIIE
         AO
         9DA JDA @=A I DIJ AO D=I >AA HA?AELA@ ssh I EJ KF E $home/lib/keyring =@ E
         /sys/lib/ssh/keyring 1B JDA AO EI BK@ JDAHA =@ EJ =J?DAI JDA HA?AELA@ AO ssh EI
         I=JEIBEA@ 1B J ssh HAFHJI JDEI =@ BBAHI J =@@ JDA AO J $home/lib/keyring
         LAH JDA A?HOFJA@ ?D=A ssh =JJAFJI J ?LE?A JDA @=A J =??AFJ JDA ?= KIEC JDA
         EIJA@ =KJDAJE?=JE FHJ?I IAA JDA −A FJE =>LA
         6DA FHABAHHA@ M=O J =KJDAJE?=JA EI = netkeyIJOA ?D=ACAHAIFIA H LE= = 5A?KH1, JA Ssh
         KIAHI  JDAH IOIJAI JD= 2= ' IDK@ A=>A 615)KJDAJE?=JE
         9DA JDA ?A?JE EI =KJDAJE?=JA@ JDA CELA ?=@ EA >O @AB=KJ = CE IDA EI ANA
         ?KJA@  JDA HAJA DIJ

         6DA 550 FHJ? =MI ?EAJI J =A KJCEC 6+2 ?=I LE= JDA IAHLAH Sshnet AIJ=>EIDAI =
         550 ?A?JE =@ H=JDAH JD= ANA?KJA = HAJA ?=@ FHAIAJI JDA HAJA IAHLAH I 6+2
         IJ=? =I = AJMH IJ=? IAA JDA @EI?KIIE B 6+2 E ip! KJA@ =J mtpt @AB=KJ /net
         FJE=O FIJEC = '2 IAHLE?A @AI?HEFJH BH JDA AM BEA IOIJA =I /srv/service 6DA −A =@
         −c =HCKAJI =HA =I E ssh

         Scp KIAI ssh J ?FO BEAI BH A DIJ J =JDAH ) HAJA BEA EI E@AJEBEA@ >O = DIJ =A =
         ? =@ = BEA =A  IF=?AI Scp ?= ?FO BEAI BH HAJA DIJI =@ J HAJA DIJI

         Sshserve EI JDA IAHLAH JD=J IAHLE?AI ssh ?=I BH HAJA DIJI 6DA −A =@ −c FJEI IAJ L=E@
         =KJDAJE?=JE AJD@I =@ ?EFDAHI =I E ssh AN?AFJ JD=J JDAHA EI  rsa =KJDAJE?=JE AJD@
         7EA E ssh JDA EIJ EI J H@AHA@ JDA IAHLAH FHAIAJI = IAJ =@ JDA ?EAJ =AI JDA ?DE?A
         6DA @AB=KJ IAJI =HA tis =@ blowfish rc4 3des *O @AB=KJ KIAHI IJ=HJ MEJD JDA =AIF=?A
         @ABEA@ E /lib/namespace 7IAHI E CHKF noworld E /adm/users IJ=HJ MEJD JDA =AI
         F=?A @ABEA@ E /lib/namespace.noworld Sshserve @AI J FHLE@A JDA 6+2 BHM=H@EC
         BK?JE=EJO KIA@ >O sshnet >A?=KIA =O 7EN ?EAJI FHAIAJ JDEI ?=F=>EEJO E = EIA?KHA =
         AH
         Sshserve HAGKEHAI JD=J factotum" D@ JDA DIJ AO E@AJEBEA@ >O D=LEC =JJHE>KJAI proto=rsa
         service=sshserve 6 CAAH=JA = DIJ AO
                auth/rsagen −t ’service=sshserve’ >/mnt/factotum/ctl
         6 ANJH=?J JDA FK>E? F=HJ B JDA DIJ AO E JDA BH KIA@ >O 550 AO HECI
                grep ’service=sshserve’ /mnt/factotum/ctl | auth/rsa2ssh
FILES
         /sys/lib/ssh/keyring
              5OIJA AO HEC BEA ?J=EEC FK>E? AOI BH HAJA IID ?EAJI =@ IAHLAHI
         /usr/user/lib/keyring
              2AHI= AO HEC BEA ?J=EEC FK>E? AOI BH HAJA IID ?EAJI =@ IAHLAHI
SOURCE
     /sys/src/cmd/ssh
SEE ALSO
      /lib/rfc/rfc425[0−6]
      factotum" authsrv$ rsa&




                                                        
550                                                        550



BUGS
         O LAHIE  B JDA 550 FHJ? EI EFAAJA@




                                                      
562                                                                                       562




NAME
       IJF IJ=HJ   FHEJ ?=@I J IJF =@ IJ=HJ FH?AIIAI
SYNOPSIS
     stop name
       start name
DESCRIPTION
      Stop FHEJI ?=@I JD=J ME ?=KIA = FH?AIIAI ?=A@ name =@ MA@ >O JDA ?KHHAJ KIAH J
      >A IJFFA@ 6DA FH?AIIAI ?= JDA >A @A>KCCA@ MDA JDAO =HA E = ?IEIJAJ IJ=JA
       Start FHEJI ?=@I JD=J ME ?=KIA = IJFFA@ FH?AIIAI ?=A@ name =@ MA@ >O JDA ?KHHAJ
       KIAH J >A IJ=HJA@ =C=E
       7IA JDA send ?=@ B rio H FEFA EJ rc J ANA?KJA JDA ?=@I
SOURCE
     /rc/bin/stop
     /rc/bin/start
SEE ALSO
      ps kill proc!
5641/5                                                                                     5641/5




NAME
       IJHECI   ANJH=?J FHEJ=>A IJHECI
SYNOPSIS
     strings  −m min   file ... 
DESCRIPTION
      Strings BE@I =@ FHEJI IJHECI ?J=EEC min @AB=KJ $ H HA ?IA?KJELA FHEJ=>A 76.
      A?@A@ ?D=H=?JAHI E = JOFE?=O >E=HO BEA @AB=KJ IJ=@=H@ EFKJ 2HEJ=>A ?D=H=?JAHI =HA
      J=A J >A )5+11 ?D=H=?JAHI BH >= JDHKCD JE@A DAN=@A?E=  JDHKCD %- E?KIELA =@
      = JDAH ?D=H=?JAHI BH L=KA ) J .... 5JHECI HAFHJI JDA @A?E= BBIAJ MEJDE JDA BEA =J
      MDE?D JDA IJHEC IJ=HJI =@ JDA JANJ B JDA IJHEC 1B JDA IJHEC EI CAH JD= % HKAI JDA EA EI
      JAHE=JA@ >O JDHAA @JI =@ JDA FHEJEC EI HAIKA@  JDA ANJ EA MEJD JDA BBIAJ B JDA ?JE
      K=JE EA
SOURCE
     /sys/src/cmd/strings.c
SEE ALSO
      nm




                                                      !
56412                                                                                              56412




NAME
       IJHEF   HALA IO>I BH >E=HO BEAI
SYNOPSIS
     strip file ...
       strip −o ofile file
DESCRIPTION
      Strip HALAI IO> J=>A IACAJI BH ANA?KJ=>A BEAI HAMHEJEC JDA BEAI E F=?A 5JHEFFEC =
      BEA HAGKEHAI MHEJA FAHEIIE B JDA BEA =@ JDA @EHA?JHO EJ EI E
       1B JDA −o B=C EI CELA JDA IECA EFKJ BEA file EI IJHEFFA@ =@ JDA HAIKJ MHEJJA J ofile File EI
       K?D=CA@
SOURCE
     /sys/src/cmd/strip.c
SEE ALSO
      a.out$




                                                       "
57                                                                                              57




NAME
       IK @#IK ID=IK        IK =@ ?KJ >?I E = BEA
SYNOPSIS
     sum  −5r   file ... 
       md5sum  file ... 
       sha1sum  −2 bits   file ... 
DESCRIPTION
      *O @AB=KJ sum ?=?K=JAI =@ FHEJI = ! >EJ DAN=@A?E= ?DA?IK = >OJA ?KJ =@ JDA =A
      B A=?D file 6DA ?DA?IK EI =I = BK?JE B JDA EFKJ ACJD 1B  fileI =HA CELA JDA IJ=@=H@
      EFKJ EI IKA@ JDAH IKEC =CHEJDI =HA =L=E=>A 6DA FJEI =HA

       −r    5K MEJD JDA =CHEJD B 5OIJA 8 I sum −r =@ FHEJ JDA ACJD E  >?I B JDA
             EFKJ
       −5    5K MEJD 5OIJA 8 I @AB=KJ =CHEJD =@ FHEJ JDA ACJD E # >OJA >?I B JDA EFKJ
       Sum EI JOFE?=O KIA@ J  BH >=@ IFJI J L=E@=JA = BEA ?KE?=JA@ LAH IA JH=IEI
       IE EA H =I = GKE? M=O J @AJAHEA EB JM BEAI  @EBBAHAJ =?DEAI ECDJ >A JDA I=A
       Md5sum ?FKJAI JDA !          DAN @ECEJ 45) ,=J= 5A?KHEJO 1? ,# AII=CA,ECAIJ )CHEJD
       @AI?HE>A@ E 4.+! 
       Sha1sum ?FKJAI JDA " DAN @ECEJ =JE= 1IJEJKJA B 5J=@=H@I =@ 6A?DCO 156 50)
       IA?KHA D=ID =CHEJD @AI?HE>A@ E .125 27* & >O @AB=KJ /ELA JDA 2 FJE EJ EIJA=@ ?
       FKJAI JDA bits>EJ 156 50) IA?KHA D=ID =CHEJD @AI?HE>A@ E .125 27* & =@ FHEJI JDA
       D=ID E DAN +KHHAJO IKFFHJA@ L=KAI B bits =HA  " #$ !&" =@ # 
SOURCE
     /sys/src/cmd/sum.c
     /sys/src/cmd/md5sum.c
     /sys/src/cmd/sha1sum.c
SEE ALSO
      cmp wc sechash 




                                                      #
5;5+)                                                                                       5;5+)




NAME
       IOI?=    JAIJ = IOIJA ?=
SYNOPSIS
     syscall  −osx  entry  arg ... 
DESCRIPTION
      Syscall ELAI JDA IOIJA ?= entry MEJD JDA CELA =HCKAJI 5A BK?JEI IK?D =I write
      =@ read  =JDKCD J IJHE?JO IOIJA ?=I =HA L=E@ entries 1J FHEJI JDA HAJKH L=KA =@ JDA
      AHHH IJHEC EB JDAHA M=I = AHHH ) =HCKAJ EI AEJDAH = EJACAH ?IJ=J =I E + EJI L=KA EI
      F=IIA@ = IJHEC EJI =@@HAII EI F=IIA@ H JDA EJAH= buf = FEJAH J = * >KBBAH EI F=IIA@
       1B −o EI CELA JDA ?JAJI B JDA * >KBBAH =HA FHEJA@ =I = AHJAHE=JA@ IJHEC =BJAH JDA IOI
       JA ?= EI @A 6DA −x =@ −s FJEI =HA IEE=H >KJ −x BH=JI JDA @=J= =I DAN=@A?E=
       >OJAI MDEA −s EJAHFHAJI JDA @=J= =I = stat# AII=CA =@ BH=JI EJ IEE=H J JDA IJOA B ls
       −lqm IAA ls MEJD ANJH= @AJ=E =>KJ JDA @EBO =@ =??AII JEAI
EXAMPLES
     9HEJA = IJHEC J IJ=@=H@ KJFKJ
                 syscall write 1 hello 5
       2HEJ EBH=JE =>KJ JDA BEA ?A?JA@ J IJ=@=H@ EFKJ
                 syscall −s fstat 0 buf 1024
SOURCE
     /sys/src/cmd/syscall
SEE ALSO
      5A?JE     B JDEI =K=
DIAGNOSTICS
     1B entry EI J M J syscall JDA ANEJ IJ=JKI EI unknown 1B JDA IOIJA ?= IK??AA@I JDA ANEJ
     IJ=JKI EI K JDAHMEIA JDA ANEJ IJ=JKI EI JDA IJHEC JD=J errstr  HAJKHI




                                                       $
6)/4,                                                                                     6)/4,




NAME
       J=CH@   FK> = EB=HA 7JH=ECDJ J=C
SYNOPSIS
     tagrd  −D  /dev/cci*/rpc
DESCRIPTION
      Tagrd HKI ?JEKKIO FEC = usb" ??E@>=IA@ 6K?D=J=C HA=@AH =@ FK>I = AII=CA BH
      =O J=C MEJD EJI ?JAJ =@ EJI 71, 1J FK>I =JDAH AII=CA MDA JDA J=C @EI=FFA=HI .H =
      AN=FA B DM J KIA JDEI IAA /sys/src/cmd/scard/plumbing
       9DA JDA FHCH= IK??AIIBKO ?KE?=JAI MEJD JDA HA=@AH EJI A@ IDK@ JKH H=CA
       6DEI FHCH= EI F=HJ B = CEC FHCH=EC B JDA 15 I=HJ?=H@ IJ=@=H@I F=HJ B JDA
       E>H=HO ?= >A IAA =J /sys/src/cmd/scard
SOURCE
     /sys/src/cmd/scard/tagrd.c
     /sys/src/cmd/scard/plumbing
SEE ALSO
      usb"




                                                    %
6)1                                                                                                 6)1




NAME
       J=E   @AELAH JDA =IJ F=HJ B = BEA
SYNOPSIS
     tail  +−numberlbcrf   file 
       tail  −fr   −n nlines   −c nbytes   file 
DESCRIPTION
      Tail ?FEAI JDA =A@ BEA J JDA IJ=@=H@ KJFKJ >ACEEC =J = @AIEC=JA@ F=?A 1B  BEA EI
      =A@ JDA IJ=@=H@ EFKJ EI ?FEA@
       +FOEC >ACEI =J FIEJE +number A=IKHA@ BH JDA >ACEEC H −number BH JDA A@ B
       JDA EFKJ Number EI ?KJA@ E EAI  >?I H >OJAI =??H@EC J JDA =FFA@A@ B=C l b H
       c ,AB=KJ EI −10l JA A
       6DA BKHJDAH B=C r ?=KIAI J=E J FHEJ EAI BH JDA A@ B JDA BEA E HALAHIA H@AH f BM
       ?=KIAI tail =BJAH FHEJEC J JDA A@ J AAF M=J?D =@ FHEJ BKHJDAH @=J= =I EJ =FFA=HI
       6DA IA?@ IOJ=N EI JD=J FHKC=JA@ >O 251: MDAHA JDA numbers H=JDAH JD= JDA FJEI =HA
       IECA@
EXAMPLES
     tail file
          2HEJ JDA =IJ  EAI B = BEA
       tail +0f file
            2HEJ = BEA =@ ?JEKA J M=J?D @=J= =??KK=JA =I EJ CHMI
       sed 10q file
            2HEJ JDA BEHIJ  EAI B = BEA
SOURCE
     /sys/src/cmd/tail.c
BUGS
       6=EI HA=JELA J JDA A@ B JDA BEA =HA JHA=IKHA@ KF E = >KBBAH =@ JDKI =HA EEJA@ E ACJD
       )??H@EC J ?KIJ FJE +number ?KJI EAI BH  =@ ?KJI >?I =@ >OJAI BH 
       Tail EI ECH=J B 76.




                                                           &
6)4                                                                                                       6)4




NAME
         J=H @EH?F   =H?DELAH
SYNOPSIS
     tar key  file ... 
         dircp fromdir todir
DESCRIPTION
      Tar I=LAI =@ HAIJHAI BEA JHAAI 1J EI IJ BJA KIA@ J JH=IFHJ = JHAA B BEAI BH A IOIJA
      J =JDAH 6DA key EI = IJHEC JD=J ?J=EI =J IJ A BK?JE AJJAH FKI FJE= @EBEAHI
      JDAH =HCKAJI J JDA ?=@ =HA =AI B BEAI H @EHA?JHEAI J >A @KFA@ H HAIJHA@ )
      @EHA?JHO =A EFEAI = JDA ?J=EA@ BEAI =@ IK>@EHA?JHEAI HA?KHIELAO
         6DA BK?JE EI A B JDA BMEC AJJAHI
         c       +HA=JA = AM =H?DELA MEJD JDA CELA BEAI =I ?JAJI
         r       6DA =A@ BEAI =HA =FFA@A@ J JDA =H?DELA
         t       EIJ = ??KHHA?AI B A=?D file E JDA =H?DELA H B = BEAI EB JDAHA =HA  file =HCKAJI
         x       -NJH=?J JDA =A@ BEAI BH JDA =H?DELA 1B = BEA EI = @EHA?JHO JDA @EHA?JHO EI ANJH=?JA@
                 HA?KHIELAO @AI =HA HAIJHA@ EB FIIE>A 1B  BEA =HCKAJ EI CELA ANJH=?J JDA AJEHA
                 =H?DELA 1B JDA =H?DELA ?J=EI KJEFA AJHEAI BH = BEA JDA =JAIJ A MEI
         6DA @EBEAHI =HA
         f       7IA JDA ANJ =HCKAJ =I JDA =A B JDA =H?DELA EIJA=@ B JDA @AB=KJ IJ=@=H@ EFKJ BH
                 AOI x =@ t H IJ=@=H@ KJFKJ BH AOI c =@ r
         g       7IA JDA ANJ KAHE? =HCKAJ =I JDA CHKF E@ BH BEAI E JDA KJFKJ =H?DELA
         i       1CHA AHHHI A?KJAHA@ MDA HA=@EC -HHHI MHEJEC AEJDAH FH@K?A = ?HHKFJ =H?DELA H
                 E@E?=JA @AAFAH BEA IOIJA FH>AI
         k       AAF @EBEAI JDA >AD=LEH B x J J ANJH=?J BEAI MDE?D =HA=@O ANEIJ
         m       , J IAJ JDA @EBE?=JE JEA  ANJH=?JA@ BEAI 6DEI EI JDA @AB=KJ >AD=LEH JDA B=C
                 ANEIJI O BH ?F=JE>EEJO MEJD JDAH J=HI
         p       +HA=JA =H?DELA E 251: KIJ=H BH=J MDE?D H=EIAI JDA =NEK F=JD=A ACJD BH 
                 J #$ >OJAI 7IJ=H =H?DELAI =HA HA?CEIA@ =KJ=JE?=O >O tar MDA HA=@EC =H?DELAI
                 6DEI EI JDA @AB=KJ >AD=LEH JDA B=C ANEIJI O BH >=?M=H@I ?F=JE>EEJO MEJD @AH LAH
                 IEI B J=H
         P       , J CAAH=JA JDA 251: KIJ=H BH=J
         R       9DA ANJH=?JEC HAIFA?J A=@EC I=ID  BEA =AI *O @AB=KJ BEAI =HA =M=OI ANJH=?JA@
                 HA=JELA J JDA ?KHHAJ @EHA?JHO
         s       9DA ANJH=?JEC =JJAFJ J HAIO?DHEIA =BJAH J BE@EC = J=FA DA=@AH >? MDAHA
                 ANFA?JA@
         T       @EBEAI JDA >AD=LEH B x J IAJ JDA @EBEA@ JEA @A =@ BH 251: =H?DELAI =@
                 BEAIOIJA FAHEJJEC JDA KIAH =@ CHKF B A=?D BEA J JD=J IFA?EBEA@ E JDA =H?DELA
         u       7IA JDA ANJ KAHE? =HCKAJ =I JDA KIAH E@ BH BEAI E JDA KJFKJ =H?DELA 6DEI EI O
                 KIABK MDA LEC BEAI J = 2= ' IOIJA
         v       LAH>IA 2HEJ JDA =A B A=?D BEA =I EJ EI FH?AIIA@ 9EJD t CELA HA @AJ=EI =>KJ JDA
                 =H?DELA AJHEAI
         z       FAH=JA  ?FHAIIA@ tar =H?DELAI 6DA JOFA B ?FHAIIE EI EBAHHA@ BH JDA BEA
                 =A ANJAIE gzip BH .tar.gz =@ .tgz bzip2 IAA gzip BH .tar.bz
                 .tbz .tar.bz2 =@ .tbz2 compress BH .tar.Z =@ .tz 1B  ANJAIE
                 =J?DAI gzip EI KIA@ 6DA z B=C EI KA?AII=HO >KJ =MA@ MDA KIEC JDA t =@ x
                 LAH>I  =H?DELAI MEJD HA?CEA@ ANJAIEI




                                                           '
6)4                                                                                                6)4



EXAMPLES
     Tar ?= >A KIA@ J ?FO DEAH=H?DEAI JDKI
                @{cd fromdir && tar c .} | @{cd todir && tar xT}
         Dircp @AI JDEI
SOURCE
     /sys/src/cmd/tar.c
     /rc/bin/dircp
SEE ALSO
      ar bundle tapefs" mkfs&
BUGS
         6DAHA EI  M=O J =I BH =O >KJ JDA =IJ ??KHHA?A B = BEA
         .EA F=JD =AI =HA EEJA@ J  ?D=H=?JAHI  #$ MDA KIEC KIJ=H BH=J
         6DA tar BH=J =MI IFA?EBE?=JE B EI =@ IO>E? EI ??AFJI BHAEC J 2= ' JDAO =HA
         ECHA@
         6DA r AO =FFA@ ?=J >A KIA@  ?FHAIIA@ =H?DELAI
         Tar JDKI dircp @AI J HA?H@ 2='IFA?EBE? AJ=@=J= IK?D =I =FFA@O =@ AN?KIELAFA
         FAHEIIE >EJI I JDAO =HA J ?FEA@




                                                        !
6*                                                                                                6*




NAME
         J>   BH=J J=>AI BH HBB H JHBB
SYNOPSIS
     tbl  file ... 
DESCRIPTION
      Tbl EI = FHAFH?AIIH BH BH=JJEC J=>AI BH nroff H troff 6DA EFKJ files =HA ?FEA@ J JDA
      IJ=@=H@ KJFKJ AN?AFJ BH IACAJI B JDA BH
                 .TS
                 options ;
                 format .
                 data
                 .T&
                 format .
                 data
                 
                 .TE
         MDE?D @AI?HE>A J=>AI =@ =HA HAF=?A@ >O troff HAGKAIJI J =O KJ JDA J=>AI 1B  =HCKAJI =HA
         CELA tbl HA=@I JDA IJ=@=H@ EFKJ
         6DA FJE= options EA EI JAHE=JA@ >O = IAE? =@ ?J=EI A H HA B
                 center              ?AJAH JDA J=>A @AB=KJ EI ABJ=@KIJ
                 expand              =A J=>A =I ME@A =I ?KHHAJ EA ACJD
                 box
                 doublebox           A?IA JDA J=>A E = >N H @K>A >N
                 allbox              A?IA ALAHO EJA E = >N
                 tab(x)              KIA x J IAF=H=JA EFKJ EJAI @AB=KJ EI J=>
                 linesize(n)         IAJ HKAI E nFEJ JOFA
                 delim(xy)           HA?CEA x =@ y =I eqn @AEEJAHI
         -=?D EA AN?AFJ JDA =IJ B JDA >EC=JHO format @AI?HE>AI A HM B JDA J=>A 6DA =IJ EA
         @AI?HE>AI = HMI KJE JDA ANJ .T& MDAHA JDA BH=J ?D=CAI H JDA A@ B JDA J=>A =J .TE )
         BH=J EI IFA?EBEA@ >O AO AJJAHI A FAH ?K AEJDAH KFFAH H MAH ?=IA
                 L       ABJ KIJEBO JDA @AB=KJ BH ?KI MEJDKJ BH=J AOI
                 R       4ECDJ KIJEBO
                 C       +AJAH
                 N       KAHE? =EC =J @A?E= FEJ EBAHHA@ BH EJACAHI H =J \&
                 S       5F= ANJA@ FHALEKI ?K =?HII JDEI A
                 A       )FD=>AJE? ABJ=ECA@ MEJDE ?K ME@AIJ EJA ?AJAHA@ E@AJA@ HA=JELA J L
                         HMI
                 ^       8AHJE?= IF= ?JEKA EJA BH FHALEKI HM EJ JDEI HM
                 −       ,H=M = DHEJ= HKA E JDEI ?K
                 =       ,H=M = @K>A DHEJ= HKA E JDEI ?K
         AO AJJAHI =O >A BMA@ >O @EBEAHI =I AEJDAH ?=IA
                 |        ,H=M LAHJE?= HKA >AJMAA ?KI
                 ||       ,H=M = @K>A LAHJE?= HKA >AJMAA ?KI
                 n        /=F >AJMAA ?K EI n AI ME@A ,AB=KJ EI !
                 Ffont    7IA IFA?EBEA@ font B =@ I A= FB =@ FI
                 T        *ACE LAHJE?=OIF=A@ EJA =J JF HM B H=CA @AB=KJ EI LAHJE?= ?AJAHEC
                          MEJD ^
                 Pn       7IA FEJ IEA n
                 Vn       7IA nFEJ LAHJE?= IF=?EC E JANJ >? IECA@ n A=I HA=JELA ?D=CA
                 W(n)     +K ME@JD =I = troff ME@JD IFA?EBE?=JE 2=HAI =HA FJE= EB n EI = IEFA
                          EJACAH
                 E        -GK=EA JDA ME@JDI B = ?KI =HA@ E
         -=?D EA B data >A?AI A HM B JDA J=>A J=>I IAF=H=JA EJAI EAI >ACEEC MEJD . =HA
         troff HAGKAIJI +AHJ=E IFA?E= @=J= EJAI =HA HA?CEA@


                                                        !
6*                                                                                               6*



                _      ,H=M = DHEJ= HKA E JDEI ?K
                =      ,H=M = @K>A DHEJ= HKA E JDEI ?K ) @=J= EA ?IEIJEC B = IECA _ H
                       = @H=MI JDA HKA =?HII JDA MDA J=>A
                \_     ,H=M = HKA O =I ME@A =I JDA ?JAJI B JDA ?K
                \Rx    4AFA=J ?D=H=?JAH x =?HII JDA ?K
                \^     5F= JDA FHALEKI EJA E JDEI ?K @M EJ JDEI HM
                T{     6DA EJA EI = JANJ >? J >A IAF=H=JAO BH=JJA@ >O troff =@ F=?A@ E JDA J=>A
                       6DA >? ?JEKAI J JDA ANJ EA >ACEEC MEJD T} 6DA HA=E@AH B JDA @=J=
                       EA BMI =J JD=J FEJ
         9DA EJ EI KIA@ E = FEFAEA MEJD eqn JDA tbl ?=@ IDK@ >A BEHIJ J EEEA JDA LKA B
         @=J= F=IIA@ JDHKCD FEFAI
EXAMPLES
     AJ J=> HAFHAIAJ = J=> MDE?D IDK@ >A JOFA@ =I = CAKEA J=>
     .TS
     c s s
     c c s
     c c c                                                    Household Population
     l n n.                                                    Town        Households
     Household Population                                                 Number Size
     TownJ=>Households                                 Bedminster         789   3.26
     J=>NumberJ=>Size                                Bernards Twp.     3087   3.74
     BedminsterJ=>789J=>3.26                         Bernardsville     2018   3.30
     Bernards Twp.J=>3087J=>3.74
     BernardsvilleJ=>2018J=>3.30
     .TE
SOURCE
     /sys/src/cmd/tbl
SEE ALSO
      troff eqn doctype
       - AI =@   +DAHHO 6* = 2HCH= J .H=J 6=>AI  Unix Research System
      Programmer’s Manual, 6AJD -@EJE 8KA 




                                                     !
6+5                                                                                               6+5




NAME
         J?I   JH=I=JA ?D=H=?JAH IAJI
SYNOPSIS
     tcs  −slcv   −f ics   −t ocs   file ... 
DESCRIPTION
      Tcs EJAHFHAJI JDA =A@ file(s) IJ=@=H@ EFKJ @AB=KJ =I = IJHA= B ?D=H=?JAHI BH JDA ics ?D=H
      =?JAH IAJ H BH=J ?LAHJI JDA J HKAI =@ JDA ?LAHJI JDA EJ = IJHA= B ?D=H=?JAHI
      BH JDA ocs ?D=H=?JAH IAJ H BH=J  JDA IJ=@=H@ KJFKJ 6DA @AB=KJ L=KA BH ics =@ ocs EI
      utf JDA 76. A?@EC @AI?HE>A@ E utf$ 6DA −l FJE EIJI JDA ?D=H=?JAH IAJI M J tcs
      2H?AIIEC ?JEKAI E JDA B=?A B ?LAHIE AHHHI JDA −s FJE FHALAJI HAFHJEC B JDAIA
      AHHHI 6DA −c FJE BH?AI JDA KJFKJ J ?J=E O ?HHA?JO ?LAHJA@ ?D=H=?JAHI JDAHMEIA
      Runeerror N..., ?D=H=?JAHI ME >A IK>IJEJKJA@ BH 76. A?@EC AHHHI =@ KM ?D=H=?
      JAHI
         6DA −v FJE CAAH=JAI L=HEKI @E=CIJE? =@ IK=HO EBH=JE  IJ=@=H@ AHHH H =AI
         JDA −l KJFKJ HA LAH>IA
         Tcs HA?CEAI = ALAH ?D=CEC EIJ B ?D=H=?JAH IAJI 1 F=HJE?K=H EJ IKFFHJI = L=HEAJO B 4KI
         IE= =@ =F=AIA A?@ECI 5A B JDA IKFFHJA@ A?@ECI =HA
         utf              6DA 2= ' 76. A?@EC M >O 15 =I 76.&
         utf1             6DA @AFHA?=JA@ HECE= 76. A?@EC BH 15 $"$
         ascii            %>EJ )5+11
         8859−1           =JE +AJH= -KHFA=
         8859−2           =JE +A?D  5L=
         8859−3           =JE! ,KJ?D  6KHEID
         8859−4           =JE" 5?=@E=LE=
         8859−5           2=HJ # +OHEE?
         8859−6           2=HJ $ )H=>E?
         8859−7           2=HJ % /HAA
         8859−8           2=HJ & 0A>HAM
         8859−9           =JE# .EEID  2HJKCKAIA
         html             7E?@A =I A?@A@ >O 06
         koi8             1& /56 '%$'%"
         jis−kanji        15  2
         ujis             -7+: 15  &
         ms−kanji         E?HIBJ H 5DEBJ15
         jis              BH O CKAIIAI >AJMAA 15  2 -7+ H 5DEBJEI
         gb               +DEAIA =JE= IJ=@=H@ /* ! &
         big5             *EC # 07 LAHIE
         unicode          7E?@A 5J=@=H@ 
         tis              6D=E ?D=H=?JAH IAJ FKI )5+11 615 $ '&$
         msdos            1* 2+ +2 "!%
         atari            )J=HE56 ?D=H=?JAH IAJ
EXAMPLES
     tcs −f 8859−1
          +LAHJ &&#' =JE ?D=H=?JAHI EJ 76. BH=J
         tcs −s −f jis
              +LAHJ ?D=H=?JAHI A?@A@ E A B IALAH= IDEBJ 15 A?@ECI EJ 76. BH=J 7M
              =E ME >A ?LAHJA@ EJ 0xFFFD ?D=H=?JAHI
         tcs −t html
              +LAHJ 76. EJ ?D=H=?JAH IAJE@AFA@AJ 06
         tcs −lv
              2HEJ = KF J @=JA EIJ B JDA IKFFHJA@ ?D=H=?JAH IAJI
SOURCE
     /sys/src/cmd/tcs




                                                        !!
6+5                                  6+5



SEE ALSO
      ascii rune  utf$




                                   !"
6--                                                                                     6--




NAME
         JAA   FEFA BEJJEC
SYNOPSIS
     tee  −i   −a  files
DESCRIPTION
      Tee JH=I?HE>AI JDA IJ=@=H@ EFKJ J JDA IJ=@=H@ KJFKJ =@ =AI ?FEAI E JDA files 6DA
      FJEI =HA
         −i      1CHA EJAHHKFJI
         −a      )FFA@ JDA KJFKJ J JDA files H=JDAH JD= HAMHEJEC JDA
SOURCE
     /sys/src/cmd/tee.c




                                                       !#
6-                                                                                        6-




NAME
         JA EMDEI    E FDA >
SYNOPSIS
     tel key ...
         iwhois name@domain
DESCRIPTION
      Tel I KF key E = FHEL=JA JAAFDA > $home/lib/tel =@ E JDA FK>E? JAAFDA
      > /lib/tel 1J KIAI grep MEJD JDA −i FJE J ECHA ?=IA @EBBAHA?AI I JDA AO =O >A
      =O F=HJ B = =A H K>AH +KIJ=HEO JDA JAAFDA > ?J=EI =AI KIAHE@I DA
      K>AHI =@ BBE?A K>AHI B KIAHI 1J =I ?J=EI = @EHA?JHO B =HA= ?@AI =@ EI?A=
      AKI FAFA B CAAH= EJAHAIJ
         Iwhois I KF =AI E JDA 1JAHAJ 1+ I FAHIA @=J=>=IA Name IDK@ >A = IKH=A
         FJE=O BMA@ >O = ?= =@ CELA =A ) @EBBAHAJ IAHLAH ?= >A ?DIA >O =FFA@EC
         J JDA =A = @ BMA@ >O JDA IAHLAH I @=E =A
FILES
         /lib/areacodes          6AAFDA =HA= ?@AI @=J=>=IA
         /lib/tel                2K>E? JAAFDA K>AH @=J=>=IA
         $home/lib/tel           2AHI= JAAFDA K>AH @=J=>=IA
SOURCE
     /rc/bin/tel
     /rc/bin/iwhois




                                                     !$
6-56                                                                                               6-56




NAME
       JAIJ     IAJ IJ=JKI =??H@EC J ?@EJE
SYNOPSIS
     test expr
DESCRIPTION
      Test AL=K=JAI JDA ANFHAIIE expr 1B JDA L=KA EI JHKA JDA ANEJ IJ=JKI EI K JDAHMEIA JDA ANEJ IJ=
      JKI EI K 1B JDAHA =HA  =HCKAJI JDA ANEJ IJ=JKI EI K
       6DA BMEC FHEEJELAI =HA KIA@ J ?IJHK?J expr
       −r     file6HKA EB JDA BEA ANEIJI EI =??AIIE>A =@ EI HA=@=>A
       −w     file6HKA EB JDA BEA ANEIJI =@ EI MHEJ=>A
       −x     file6HKA EB JDA BEA ANEIJI =@ D=I ANA?KJA FAHEIIE
       −e     file6HKA EB JDA BEA ANEIJI
       −f     file6HKA EB JDA BEA ANEIJI =@ EI = F=E BEA
       −d     file6HKA EB JDA BEA ANEIJI =@ EI = @EHA?JHO
       −s     file6HKA EB JDA BEA ANEIJI =@ D=I = IEA CHA=JAH JD= AH
       −t         6HKA EB JDA FA BEA MDIA BEA @AI?HEFJH K>AH EI fildes  >O @AB=KJ EI JDA I=A
              fildes
                  BEA =I /dev/cons
       −A file    6HKA EB JDA BEA ANEIJI =@ EI =FFA@O
       −L file    6HKA EB JDA BEA ANEIJI =@ EI AN?KIELAKIA
       −Tfile     6HKA EB JDA BEA ANEIJI =@ EI JAFH=HO
       s1 = s2    6HKA EB JDA IJHECI s1 =@ s2 =HA E@AJE?=
       s1 != s2   6HKA EB JDA IJHECI s1 =@ s2 =HA J E@AJE?=
       I         6HKA EB s1 EI J JDA K IJHEC ,AFHA?=JA@
       −n s1      6HKA EB JDA ACJD B IJHEC s1 EI AH
       −z s1      6HKA EB JDA ACJD B IJHEC s1 EI AH
       n1 −eq n2 6HKA EB JDA EJACAHI n1 =@ n2 =HA =HEJDAJE?=O AGK= )O B JDA ?F=HEII
                  −ne −gt −ge −lt H −le =O >A KIA@ E F=?A B −eq 6DA IJ=@=H@
                  ?IJHK?J −l string A=EC JDA ACJD B string =O >A KIA@ E F=?A B = EJA
                  CAH
       a −nt b    6HKA EB BEA a EI AMAH JD= @EBEA@ =BJAH BEA b
       a −ot b    6HKA EB BEA a EI @AH JD= @EBEA@ >ABHA BEA b
       f −older t 6HKA EB BEA f EI @AH JD= @EBEA@ >ABHA JEA t 1B t EI = EJACAH BMA@ >O JDA
                  AJJAHI yOA=HI MJDI d@=OI hDKHI mEKJAI H sIA?@I EJ HAFHA
                  IAJI ?KHHAJ JEA EKI JDA IFA?EBEA@ JEA 1B JDAHA EI  AJJAH EJ HAFHAIAJI IA?
                  @I IE?A AF?D ;K ?= =I ??=JA=JA ENA@ KEJI .H AN=FA 3d12h
                  A=I JDHAA @=OI =@ JMALA DKHI =C
       6DAIA FHE=HEAI =O >A ?>EA@ MEJD JDA BMEC FAH=JHI
       !               K=HO AC=JE FAH=JH
       −o              >E=HO or FAH=JH
       −a              >E=HO and FAH=JH DECDAH FHA?A@A?A JD= −o
       ( expr )        F=HAJDAIAI BH CHKFEC
       6DA FHEEJELAI −b −u −g =@ −s HAJKH B=IA JDAO =HA HA?CEA@ BH ?F=JE>EEJO MEJD 251:
       JE?A JD=J = JDA FAH=JHI =@ B=CI =HA IAF=H=JA =HCKAJI J test JE?A =I JD=J F=HAJDAIAI
       =@ AGK= IECI =HA A=ECBK J rc =@ KIJ >A A?IA@ E GKJAI
EXAMPLES
     Test EI = @K>EKI M=O J ?DA? BH IFA?EBE? ?D=H=?JAH IJHECI EJ KIAI = FH?AII J @ MD=J = rc
     =J?D H IMEJ?D IJ=JAAJ ?= @ 6DA BEHIJ AN=FA EI J O EABBE?EAJ >KJ MHC >A?=KIA
     test K@AHIJ=@I JDA FKHFHJA@ IJHEC "−c" =I = FJE
                  if (test $1 ’=’ "−c") echo OK # wrong!
       ) >AJJAH M=O EI
                  if (~ $1 −c) echo OK
       6AIJ MDAJDAH abc EI E JDA ?KHHAJ @EHA?JHO




                                                       !%
6-56                                                                                  6-56



              test −f abc −o −d abc
SOURCE
     /sys/src/cmd/test.c
SEE ALSO
      rc
BUGS
       9 J ?F=E =>KJ ANJH=AKI =HCKAJI IE?A JDAHA =O >A =HCKAJI ABJ KFH?AIIA@ >O
       IDHJ?EH?KEJ AL=K=JE B −a H −o




                                                !&
60-5)7475                                                                      60-5)7475




NAME
       JDAI=KHKI   IA=H?D EA JDAI=KHKI
SYNOPSIS
     thesaurus word
DESCRIPTION
      thesaurus IA=H?DAI JDA EA JDAI=KHKI =J DJJFJDAI=KHKIHABAHA?A?
SOURCE
     /rc/bin/thesaurus




                                                  !'
61-                                                                                       61-




NAME
       JEA   JEA = ?=@
SYNOPSIS
     time command  arg ... 
DESCRIPTION
      6DA command EI ANA?KJA@ MEJD JDA CELA =HCKAJI =BJAH EJ EI ?FAJA time HAFHJI  IJ=@=H@
      AHHH JDA FHCH= I A=FIA@ KIAH JEA IOIJA JEA =@ HA= JEA E IA?@I BMA@ >O JDA
      ?=@ EA
SOURCE
     /sys/src/cmd/time.c
SEE ALSO
      prof




                                                  "
67+0                                                                                        67+0




NAME
       JK?D   IAJ @EBE?=JE @=JA B = BEA
SYNOPSIS
     touch  −c   −t time  file ...
DESCRIPTION
      Touch =JJAFJI J IAJ JDA @EBE?=JE JEA B JDA files J time >O @AB=KJ JDA ?KHHAJ JEA 1B =
      file @AI J ANEIJ EJ ME >A ?HA=JA@ KAII FJE −c EI FHAIAJ
SOURCE
     /sys/src/cmd/touch.c
SEE ALSO
      ls stat  chmod
BUGS
       Touch ME J JK?D @EHA?JHEAI




                                                    "
64                                                                                                   64




NAME
        JH   JH=I=JA ?D=H=?JAHI
SYNOPSIS
     tr  −cds   string1  string2  
DESCRIPTION
      Tr ?FEAI JDA IJ=@=H@ EFKJ J JDA IJ=@=H@ KJFKJ MEJD IK>IJEJKJE H @AAJE B IAA?JA@ ?D=H
      =?JAHI HKAI 1FKJ ?D=H=?JAHI BK@ E string1 =HA =FFA@ EJ JDA ?HHAIF@EC ?D=H=?JAHI B
      string2 9DA string2 EI IDHJ EJ EI F=@@A@ J JDA ACJD B string1 >O @KFE?=JEC EJI =IJ ?D=H=?JAH
      )O ?>E=JE B JDA FJEI −cds =O >A KIA@
        −c      +FAAJ string1 HAF=?A EJ MEJD = ANE?CH=FDE?=O H@AHA@ EIJ B = JDAH ?D=H=?JAHI
        −d      ,AAJA BH EFKJ = ?D=H=?JAHI E string1
        −s      5GKAAA HAFA=JA@ KJFKJ ?D=H=?JAHI JD=J ??KH E string2 J IECA ?D=H=?JAHI
        1 AEJDAH IJHEC = EEJE= IAGKA?A −x MDAHA x EI =O ?D=H=?JAH FIIE>O GKJA@ IJ=@I BH =
        H=CA B ?D=H=?JAHI = FIIE>O AFJO IAGKA?A B ?@AI HKEC BH JDA IK??AIIH B JDA FHALE
        KI ?@A KF JDHKCD JDA ?@A BH x 6DA ?D=H=?JAH \ BMA@ >O  H ! ?J= @ECEJI IJ=@I BH
        JDA ?D=H=?JAH MDIA $>EJ L=KA EI CELA >O JDIA @ECEJI 6DA ?D=H=?JAH IAGKA?A \x BMA@ >O
          ! H " DAN=@A?E= @ECEJI IJ=@I BH JDA ?D=H=?JAH MDIA $>EJ L=KA EI CELA >O JDIA @EC
        EJI ) \ BMA@ >O =O JDAH ?D=H=?JAH IJ=@I BH JD=J ?D=H=?JAH
EXAMPLES
     4AF=?A = KFFAH?=IA )5+11 AJJAHI >O MAH?=IA
                tr A−Z a−z <mixed >lower
        +HA=JA = EIJ B = JDA MH@I E file1 A FAH EA E file2 MDAHA = MH@ EI J=A J >A = =NE
        = IJHEC B =FD=>AJE?I String2 EI CELA =I = GKJA@ AMEA
                tr −cs A−Za−z ’
                ’ <file1 >file2
SOURCE
     /sys/src/cmd/tr.c
SEE ALSO
      sed




                                                       "
64)+-                                                                                    64)+-




NAME
        JH=?A   IDM HA=JEA FH?AII >AD=LEH
SYNOPSIS
     trace  −d file   −v   −w   pid  
DESCRIPTION
      Trace @EIF=OI JDA >AD=LEH B FH?AIIAI HKEC  JDA =?DEA 1 EJI ME@M EJ IDMI = JEA
      EA BH A=?D JH=?A@ FH?AII 4KEC FH?AIIAI =FFA=H =I ?HA@ >?I MEJD =HHMI =HEC
      EFHJ=J ALAJI E HA=JEA FH?AIIAI IAA proc! *=? KF =HHMI =H FH?AII HAA=IAI
      >=? @M =HHMI =H FH?AII @A=@EAI CHAA @M =HHMI =H JEAI MDA = FH?AII OEA@A@
      JDA FH?AIIH >ABHA EJI @A=@EA HA@ @M =HHMI =H JEAI MDA JDA FH?AII LAHH= EJI =J
      JA@ JEA
        Trace HA=@I /proc/trace J HAJHEALA JH=?A ALAJI BH JDA AHA I?DA@KAH 6H=?A ALAJI =HA
        >E=HO @=J= IJHK?JKHAI CAAH=JA@ >O JDA AHA I?DA@KAH 1J EI =IIKA@ JD=J JDA HA=@AH B
        /proc/trace =@ JDA AHA FHLE@EC EJ D=LA JDA I=A >OJA H@AH
        6DA FJEI =HA
        −d      IFA?EBO = =JAH=JA JH=?A ALAJ BEA
        −v      FHEJ ALAJI =I JDAO =HA HA=@ BH JDA JH=?A ALAJ BEA
        −w      HK E = AM ME@M H=JDAH JD= KIEC JDA ?KHHAJ A
        Trace HA?CEAI JDAIA AOIJHA ?=@I MDEA EJ EI HKEC
        +        E >O = B=?JH B JM
        −        KJ >O = B=?JH B JM
        p       F=KIA H HAIKA
        q       GKEJ
SEE ALSO
      proc!
FILES
        /proc/trace                       JH=?A ALAJ BEA
        /sys/include/trace.h              JH=?A ALAJ @=J= IJHK?JKHAI
SOURCE
     /sys/src/cmd/trace.c




                                                        "!
64..                                                                                             64..




NAME
        JHBB HBB @FIJ   JANJ BH=JJEC =@ JOFAIAJJEC
SYNOPSIS
     troff  option ...   file ... 
        dpost  −f   file ... 
        nroff  option ...   file ... 
DESCRIPTION
      Troff BH=JI JANJ E JDA =A@ files BH FHEJEC  = JOFAIAJJAH AEJJEC = JANJK= EJAHA@E=JA
      BH=J ?=A@ JOFAIAJJAHE@AFA@AJ troff KJFKJ  K@AHIJ@ >O FHCH=I IK?D =I proof =@
      lp >KJ =I >O = troff FIJFH?AIIH =A@ dpost MDE?D AEJI ?HHAIF@EC 2IJI?HEFJ
      7@AH −f dpost =I AEJI 2IJI?HEFJ BJ @ABEEJEI =I AA@A@ Nroff @AI JDA I=A =I troff
      >KJ FH@K?AI KJFKJ IKEJ=>A BH JOFAMHEJAHEA @ALE?AI KIK=O MEJDKJ BKHJDAH FIJFH?AIIEC
      >KJ IAA col
        1B  file =HCKAJ EI FHAIAJ JDA IJ=@=H@ EFKJ EI HA=@ ) =HCKAJ ?IEIJEC B = IECA
        EKI − EI J=A J >A = BEA =A ?HHAIF@EC J JDA IJ=@=H@ EFKJ 6DA FJEI =HA
        −olist     2HEJ F=CAI E JDA ?=IAF=H=JA@ list B K>AHI =@ H=CAI ) H=CA N−M A=I N
                   JDHKCD M EEJE= −M A=I KF J M BE= N− A=I BH N J JDA A@
        −nN        K>AH BEHIJ CAAH=JA@ F=CA N
        −mname 2H?AII JDA =?H BEA /sys/lib/tmac/tmac.name >ABHA JDA EFKJ files
        −raN       5AJ HACEIJAH a A ?D=H=?JAH =A J N
        −i         4A=@ IJ=@=H@ EFKJ =BJAH JDA EFKJ BEAI =HA AND=KIJA@
        −q         1LA JDA IEKJ=AKI EFKJKJFKJ @A B JDA rd HAGKAIJ
        −N         2H@K?A KJFKJ IKEJ=>A BH JOFAMHEJAHEA @ALE?AI
   Typesetter devices (not −N) only
      −a       5A@ = FHEJ=>A JANJK= =FFHNE=JE B JDA HAIKJI J JDA IJ=@=H@ KJFKJ
        −Tdest     2HAF=HA KJFKJ BH JOFAIAJJAH dest
                   −Tutf       6DA @AB=KJ 2IJ5?HEFJ FHEJAHI MEJD FHAFH?AIIEC J D=@A 7E?@A
                               ?D=H=?JAHI A?@A@ E 76.
                   −Tpost      4ACK=H 2IJ5?HEFJ FHEJAHI
                   −T202       AHCAJD=AH EJH 
        −Fdir     6=A BJ EBH=JE BH @EHA?JHO dir
   Typewriter (−N) output only
      −sN       0=J FHEH J ALAHO N F=CAI @AB=KJ N J =M F=FAH =@EC H ?D=CEC
        −Tname 2HAF=HA KJFKJ BH IFA?EBEA@ JAHE= M names E?K@A utf BH JDA H= 2= '
               76. A?@EC B JDA 7E?@A 5J=@=H@ ?D=H=?JAH IAJ @AB=KJ 37 BH JDA 6AAJOFA @A
               !% lp  EAFHEJAH  BH =O JAHE= MEJDKJ D=BEA ?=F=>EEJO 450 BH JDA ,)51"#
               ,E=> 0OJAH =@ think 02 6DEAJ
        −e         2H@K?A AGK=OIF=?A@ MH@I E =@KIJA@ EAI KIEC BK JAHE= HAIKJE
        −h         7IA KJFKJ J=>I @KHEC DHEJ= IF=?EC J IFAA@ KJFKJ =@ HA@K?A KJFKJ ?D=H=?JAH
                   ?KJ 6=> IAJJECI =HA =IIKA@ J >A ALAHO & E= ?D=H=?JAH ME@JDI
FILES
        /tmp/trtmp*                         JAFH=HO BEA
        /sys/lib/tmac/tmac.*                IJ=@=H@ =?H BEAI
        /sys/lib/troff/term/*               JAHE= @HELEC J=>AI BH nroff
        /sys/lib/troff/font/*               BJ ME@JD J=>AI BH troff
SOURCE
     /sys/src/cmd/troff
     /rc/bin/dpost




                                                       ""
64..                                                                                   64..



SEE ALSO
      lp proof page eqn tbl pic grap doctype ms$ image$ tex
      deroff col
       . II== =@ * 9 AHECD= 6HBB 7IAH I =K=
      * 9 AHECD= ) 6OFAIAJJAH1@AFA@AJ 64..  +564 '%
      * 9 AHECD= ) 64.. 6KJHE=  Unix Research System Programmer’s Manual, 6AJD -@EJE
      8KA 




                                                 "#
64.. 06                                                                           64.. 06 




NAME
       JHBB DJ   ?LAHJ JHBB KJFKJ EJ 06
SYNOPSIS
     troff2html  −t title   file  
DESCRIPTION
      Troff2html HA=@I JDA troff KJFKJ E JDA =A@ files @AB=KJ IJ=@=H@ EFKJ =@ ?LAHJI JDA
      EJ 06
       Troff2html @AI = JAH=>A > MEJD IJH=ECDJ troff KJFKJ >KJ EJ EI DAFA@ >O =J=JEI
       @AI?HE>A@ >AM 1JI =E KIA EI BH man2html IAA httpd& MDE?D ?LAHJI man F=CAI EJ
       06 =@ @AFA@I  = IFA?E=O =J=JA@ IAJ B man$ =?HI ELA@ >O troff
       −manhtml
       Troff KJFKJ EAI >ACEEC
              x X html 
       MDE?D =HA EJH@K?A@ >O F=?EC \X’html ’ E JDA input ?=KIA JDA HAIJ B JDA EA J >A EJAH
       F=JA@ EJ JDA 06 FH@K?A@ 5ALAH= IK?D EAI =HA HA?CEA@ IFA?E=O >O troff2html 6DA
       IJ EFHJ=J =HA JDA F=EH
              x X html manref start cp 1
              x X html manref end cp 1
       MDE?D =HA KIA@ J ?HA=JA 06 DOFAHEI =HK@ JANJ B JDA BH cp FEJEC J
       /magic/man2html/1/cp
       Troff2html EI AM =@ ANFAHEAJ= E JEA EJ =O EFHLA =@ IK>IKA ms2html  JDA A
       D=@ >A?=KIA EJ KIAI JDA EFKJ ms2html ?= D=@A pic eqn AJ? MDE?D troff2html @AI
       J D=@A =J =  JDA JDAH D=@ ms2html K@AHIJ=@I O ms$ @?KAJI =@ EI A=IEO
       ?BKIA@ >O ?FAN troff ?IJHK?JEI Troff2html D=I JDA HALAHIA FHFAHJEAI EJ @AI J
       D=@A JDA FHAFH?AIIHI >KJ EJI KJFKJ EI HAE=>A =@ @K DAFAH =J=JEI EI E@AFA@AJ
       B =?H F=?=CA
SOURCE
     /sys/src/cmd/troff2html
SEE ALSO
      troff ms2html man2html E httpd&
BUGS
       Troff =@ 06 D=LA @EBBAHAJ @AI =@ JDAO @ J AID MA E = ?=IAI Troff I E@AJA@
       F=H=CH=FDI =HA J MA IAHLA@ E 06 =@ JDA KJFKJ B troff2html IDMI JDEI




                                                     "$
69-)                                                                                        69-)




NAME
       JMA=   A@EJ E=CA BEAI IK>BJ BEAI B=?A BEAI AJ?
SYNOPSIS
     tweak  file ... 
DESCRIPTION
      Tweak A@EJI ANEIJEC BEAI D@EC L=HEKI BHI B E=CAI 6 ?HA=JA HECE= E=CAI IJ=HJ BH
      = ANEIJEC E=CA IK>BJ AJ?
       Tweak HA=@I EJI =HCKAJ files =@ @EIF=OI JDA HAIKJEC E=CAI E = LAHJE?= ?K 1B JDA E=CA
       EI J ME@A J BEJ =?HII JDA @EIF=O EJ EI B@A@ K?D EA = C EA B JANJ E = rio ME@M
       7@AH A=?D E=CA EI @EIF=OA@ A H JM EAI B JANJ FHAIAJEC EJI F=H=AJAHI 6DA BEHIJ EA
       IDMI JDA E=CA I depth JDA K>AH B >EJI FAH FENA r JDA HA?J=CA ?LAHA@ >O JDA E=CA
       =@ JDA =A B JDA file BH MDE?D EJ M=I HA=@ 1B JDA BEA EI = IK>BJ = IA?@ EA FHAIAJI =
       DAN=@A?E= $>EJ offset J >A =FFEA@ J ?D=H=?JAH L=KAI BH JDA IK>BJ JOFE?=O =I
       IJHA@ E = BJ BEA IAA font$ =@ JDA IK>BJ I n height =@ ascent =I @ABEA@ E
       cachechars 
       *O A=I @AI?HE>A@ >AM =CEBEA@ LEAMI B FHJEI B JDA E=CAI =O >A @EIF=OA@ 6DA JANJ
       =II?E=JA@ MEJD IK?D = LEAM E?K@AI mag JDA =CEBE?=JE 1B JDA LEAM EI B = IECA ?D=H=?JAH
       BH = IK>BJ JDA IA?@ EA B JANJ IDMI JDA ?D=H=?JAH I L=KA E?K@EC JDA IK>BJ I BBIAJ
       E DAN=@A?E= =@ =I = ?D=H=?JAH E tweak’s @AB=KJ BJ JDA ?D=H=?JAH I x top bottom left
       =@ width =I @ABEA@ E cachechars  =@ iwidth JDA FDOIE?= ME@JD B JDA E=CA E JDA
       IK>BJ I E=CA
       6DAHA =HA JM AJD@I J >J=E = =CEBEA@ LEAM B = ?D=H=?JAH BH = IK>BJ 6DA BEHIJ EI J
       ?E? KIA >KJJ  LAH JDA E=CA B JDA ?D=H=?JAH E JDA IK>BJ 6DA IA?@ EI J IAA?J JDA
       char AJHO  JDA >KJJ ! AK FEJ JDA HAIKJEC CKIECDJ ?KHIH =J JDA @AIEHA@ IK>BJ =@
       ?E? >KJJ ! =@ JDA JOFA =J JDA JANJ FHFJ =J JDA >JJ B JDA I?HAA JDA ?D=H=?JAH L=KA
       AEJDAH =I = KJE@ECEJ DAN=@A?E= K>AH H =I = IECA HKA HAFHAIAJEC JDA ?D=H=?JAH
       6 =CEBO = FHJE B JDAH JOFAI B E=CA BEAI ?E? >KJJ  LAH JDA K=CEBEA@ BEA 6DA
       ?KHIH ME IMEJ?D J = ?HII 5JE MEJD >KJJ  IMAAF = HA?J=CA =I E rio JD=J A?IAI JDA
       FHJE B JDA E=CA J >A =CEBEA@ 1B JDA BEA EI $ $ H I=AH tweak ME KIJ =CEBO JDA
       AJEHA BEA  IMAAFEC EI A?AII=HO
       2HAIIEC >KJJI  =@ MEJDE =CEBEA@ E=CAI ?D=CAI FENA L=KAI *O @AB=KJ >KJJ  IAJI
       JDA FENA J = AHI =@ >KJJ IAJI JDA FENA J = AI
       )?HII JDA JF B JDA I?HAA EI = JANJK= @EIF=O B C>= F=H=AJAHI 6DAIA L=KAI =I MA =I
       =O B JDA JANJK= L=KAI =II?E=JA@ MEJD JDA E=CAI =O >A A@EJA@ >O ?E?EC >KJJ   JDA
       @EIF=OA@ L=KA =@ JOFEC = AM L=KA 6DA L=KAI =C JDA JF B JDA I?HAA =HA
       mag     ,AB=KJ =CEBE?=JE
       val(hex)
            6DA L=KA KIA@ J @EBO FENAI MEJDE =CEBEA@ E=CAI 6DA L=KA KIJ >A E DAN=@A?E
            = FJE=O FHA?A@A@ >O = JE@A BH >EJMEIA AC=JE
       but1
       but2 6DA FENA L=KA MHEJJA MDA JDA ?HHAIF@EC >KJJ EI FHAIIA@ LAH = FENA
       invert−on−copy
            9DAJDAH JDA FENA L=KAI =HA ELAHJA@ MDA = copy FAH=JE EI FAHBHA@
       7@AH >KJJ ! EI = AK D@EC = L=HEAJO B BK?JEI =O B JDAIA BK?JEI FHFJ BH JDA
       E=CA KF MDE?D J =?J >O IMEJ?DEC J = CKIECDJ ?KHIH ?E? >KJJ ! LAH JDA IAA?JE H
       ?E? = @EBBAHAJ >KJJ J ?=?A JDA =?JE
       open 4A=@ =@ @EIF=O = BEA 6DA =A B JDA BEA EI JOFA@ J JDA FHFJ  JDA >JJ EA
       read 4AHA=@ = BEA
       write
            9HEJA = BEA




                                                        "%
69-)                                                                                       69-)



       copy 7IA JDA ?FO BK?JE @AB=KJ S J JH=IBAH = HA?J=CA B FENAI BH A E=CA J
            =JDAH 6DA FHCH= FHFJI MEJD = ?HII ?KHIH IMAAF KJ = HA?J=CA E A E=CA H
            KIJ ?E? >KJJ ! J IAA?J JDA MDA E=CA 6DA FHCH= ME A=LA JD=J HA?J=CA E F=?A
            =@ =JJ=?D =JDAH A J JDA ?KHIH LA JD=J HA?J=CA J JDA @AIEHA@ F=?A E =O
            E=CA =@ ?E? >KJJ ! H =JDAH >KJJ J ?=?A JDA =?JE
       char )I @AI?HE>A@ =>LA FA = =CEBEA@ LEAM B = ?D=H=?JAH E=CA E = IK>BJ
       pixels
            4AFHJ JDA ?H@E=JA =@ L=KA B E@ELE@K= FENAI E@E?=JA@ >O FHAIIEC >KJJ ! 6DEI EI
            = @A B FAH=JE ?=?AA@ >O FHAIIEC >KJJ  H 
       close
            +IA JDA IFA?EBEA@ E=CA 1B JDA E=CA EI JDA K=CEBEA@ BEA =I ?IA =O =CEBEA@
            LEAMI B JD=J BEA
       exit 3KEJ tweak 6DA FHCH= ME ?F=E ?A =>KJ @EBEA@ >KJ KMHEJJA BEAI
SOURCE
     /sys/src/cmd/tweak.c
SEE ALSO
      cachechars  image$ font$
BUGS
       .H = FHCH= MHEJJA J =@KIJ ME@JD J=>AI E BJI tweak D=I >AA FKIDA@ KHA=I=>O B=H




                                                   "&
713                                                                                          713




NAME
       KEG     HAFHJ HAFA=JA@ EAI E = BEA
SYNOPSIS
     uniq  −udc  +−num    file 
DESCRIPTION
      Uniq ?FEAI JDA EFKJ file H JDA IJ=@=H@ EFKJ J JDA IJ=@=H@ KJFKJ ?F=HEC =@=?AJ EAI
      1 JDA H= ?=IA JDA IA?@ =@ IK??AA@EC ?FEAI B HAFA=JA@ EAI =HA HALA@ 4AFA=JA@
      EAI KIJ >A =@=?AJ E H@AH J >A BK@
       −u       2HEJ KEGKA EAI
       −d       2HEJ A ?FO B @KFE?=JA@ EAI
       −c       2HABEN = HAFAJEJE ?KJ =@ = J=> J A=?D KJFKJ EA 1FEAI −u =@ −d
       −num 6DA BEHIJ num BEA@I JCAJDAH MEJD =O >=I >ABHA A=?D =HA ECHA@ ) BEA@ EI @ABEA@ =I
            = IJHEC B IF=?A J=> ?D=H=?JAHI IAF=H=JA@ >O J=>I =@ IF=?AI BH EJI AECD
            >HI
       +num 6DA BEHIJ num ?D=H=?JAHI =HA ECHA@ .EA@I =HA IEFFA@ >ABHA ?D=H=?JAHI
SOURCE
     /sys/src/cmd/uniq.c
SEE ALSO
      sort
BUGS
       .EA@ IAA?JE =@ ?F=HEI IDK@ >A ?F=JE>A MEJD sort




                                                        "'
7165                                                                                         7165




NAME
        KEJI   ?LAHIE FHCH=
SYNOPSIS
     units  −v   file 
DESCRIPTION
      Units ?LAHJI GK=JEJEAI ANFHAIIA@ E L=HEKI IJ=@=H@ I?=AI J JDAEH AGKEL=AJI E JDAH I?=AI
      1J MHI EJAH=?JELAO E JDEI B=IDE
                you have: inch
                you want: cm
                    * 2.54
                    / 0.393701
        ) GK=JEJO EI IFA?EBEA@ =I = KJEFE?=JELA ?>E=JE B KEJI =@ B=JEC FEJ K>AHI FAH=
        JHI D=LA JDA BMEC FHA?A@A?A
                + −                    =@@ =@ IK>JH=?J
                */×÷                   KJEFO =@ @ELE@A
                ?=JA=JE             KJEFO
                ²³^                    ANFAJE=JE
                |                      @ELE@A
                (  )                CHKFEC
        IJ B=EE=H KEJI =>>HALE=JEI =@ AJHE? FHABENAI =HA HA?CEA@ JCAJDAH MEJD = CAAHKI
        A=LAEC B ANJE?= =@ = BAM ?IJ=JI B =JKHA E?K@EC
                pi,         H=JE B ?EH?KBAHA?A J @E=AJAH
                c            IFAA@ B ECDJ
                e            ?D=HCA  = AA?JH
                g            =??AAH=JE B CH=LEJO
                force        I=A =I g
                mole         )LC=@H I K>AH
                water        FHAIIKHA DA=@ FAH KEJ DAECDJ B M=JAH
                au           =IJHE?= KEJ
        6DA pound EI = KEJ B =II +FK@ =AI =HA HK JCAJDAH AC lightyear *HEJEID
        KEJI JD=J @EBBAH BH JDAEH 75 ?KJAHF=HJI =HA FHABENA@ JDKI brgallon +KHHA?O EI @AJA@
        belgiumfranc britainpound AJ?
        6DA ?FAJA EIJ B KEJI ?= >A BK@ E /lib/units ) file =HCKAJ J units IFA?EBEAI = BEA
        J >A KIA@ EIJA=@ B /lib/units. 6DA −v B=C ?=KIAI units J FHEJ EJI AJEHA @=J=>=IA
EXAMPLE
     you have: 15 pounds force/in²
     you want: atm
         * 1.02069
         / .97973
FILES
        /lib/units
SOURCE
     /sys/src/cmd/units.y
BUGS
        5E?A units @AI O KJEFE?=JELA I?=A ?D=CAI EJ ?= ?LAHJ ALE J 4=EA >KJ J +AJE
        CH=@A J .=DHADAEJ
        +KHHA?O ?LAHIEI =HA O =I =??KH=JA =I JDA =IJ JEA IAA KF@=JA@ JDA @=J=>=IA




                                                      #
7261-                                                                                7261-




NAME
       KFJEA    IDM DM C JDA IOIJA D=I >AA HKEC
SYNOPSIS
     uptime
DESCRIPTION
      Uptime IDMI DM C JDA IOIJA D=I >AA HKEC 1J KIAI JDA BMEC BH=J
                sysname up 33 days, 17:56:42
       6DA JEA CELA =??KJI BH JDA JEAA


SOURCE
     /rc/bin/uptime
SEE ALSO
      date




                                                   #
77-+,-                                                                                77-+,-




NAME
       KKA?@A KK@A?@A     A?@A@A?@A = BEA =I FHEJ=>A )5+11
SYNOPSIS
     uuencode  input 
       uudecode  input 
DESCRIPTION
      Uuencode =@ uudecode =HA BEJAHI KIA@ J JH=IEJ BEAI LAH JH=IEIIE A@E= JD=J @ J IKF
      FHJ JDAH JD= IEFA )5+11 @=J=
       Uuencode ?LAHJI = BEA J = FKHAO )5+11>=IA@ HAFHAIAJ=JE
       Uudecode HA=@I = BEA FH@K?A@ >O uuencode ECHEC =O A=@EC =@ JH=EEC EAI JD=J =HA J
       F=HJ B JDA A?@EC =@ AEJI JDA HECE= BEA  IJ=@=H@ KJFKJ =I MHEJEC EJI =A J IJ=
       @=H@ AHHH
EXAMPLES
     -?@A = dis BEA limbo.dis I JD=J EJ ?= >A E?K@A@ E = =E AII=CA
              uuencode limbo.dis >tmp
              place tmp in mail message and send to recipient
       ,A?@A JDA =E AII=CA msg I=O
              uudecode <msg >limbo.dis
SOURCE
     /sys/src/cmd/uuencode.c
     /sys/src/cmd/uudecode.c
SEE ALSO
      marshal
BUGS
       6DA A?@A@ BEA EI ANF=@A@ >O =J A=IJ = JDEH@
       6DEI A?@EC EI = HAE? B JDA @=OI >ABHA 1- A?@EC




                                                     #
8)+                                                                                                   8)+




NAME
         L=? KL=?   ?HA=JA ANJH=?J = L=? =H?DELA  8AJE
SYNOPSIS
     vac  −mqsv   −b blocksize   −d oldvacfile   −e exclude   −f vacfile   −i name   −h host 
     file ...
         unvac  −Tctv   −h host  vacfile  file ... 
DESCRIPTION
      Vac ?HA=JAI = =H?DEL= ?FO B 2= ' BEA JHAAI  8AJE 1J ?= >A KIA@ J >KE@ = IEFA >=?KF
      IOIJA A B JDA KKIK= FHFAHJEAI B 8AJE EI JD=J @KFE?=JA >?I =HA @AJA?JA@ =@ ?=AI?A@
      9DA vac EI KIA@  = BEA JHAA JD=J ID=HAI @=J= MEJD = ANEIJEC =H?DELA JDA ?IKFJE B IJH
      =CA ME >A =FFHNE=JAO AGK= J = E?HAAJ= >=?KF 6DEI HA@K?JE E IJH=CA ?IKFJE
      ??KHI JH=IF=HAJO J JDA KIAH
         )I = FJEE=JE JDA −d =@ −q FJEI @AI?HE>A@ >AM ?= >A KIA@ J ANFE?EJO ?HA=JA =
         =H?DELA HA=JELA J = ANEIJEC =H?DELA 6DAIA FJEI @ J ?D=CA JDA HAIKJEC =H?DELA CAAH
         =JA@ >O vac >KJ IEFO HA@K?A JDA K>AH B MHEJA FAH=JEI J 8AJE
         6DA KJFKJ B vac EI JDA DAN=@A?E= HAFHAIAJ=JE B JDA 50) BECAHFHEJ B JDA HJ B JDA
         =H?DELA E JDEI BH=J
                vac:64daefaecc4df4b5cb48a368b361ef56012a4f46
         6DA FJEI J vac =HA

         −b blocksize 5FA?EBEAI JDA >? IEA JD=J @=J= ME >A >HA EJ 6DA KEJI BH JDA IEA ?= >A
                      IFA?EBEA@ >O =FFA@EC k J E@E?=JA E>OJAI 6DA @AB=KJ EI & 6DA IEA KIJ >A
                      E JDA H=CA B # >OJAI J # 
         −d oldvacfile 4A@K?A JDA K>AH B >?I MHEJJA J 8AJE >O ?F=HEC JDA BEAI J >A IJHA@
                       MEJD JDA ?JAJI B = ANEIJEC vac BEA JHAA MDIA I?HA EI IJHA@ E oldvacfile
         −e exclude     , J E?K@A JDA BEA H @EHA?JHO IFA?EBEA@ >O exclude 6DEI FJE =O >A
                        HAFA=JA@ KJEFA JEAI
         −f vacfile     6DA HAIKJI B vac =HA F=?A@ E vacfile H JDA IJ=@=H@ KJFKJ EB  BEA EI CELA
         −i name        1?K@A IJ=@=H@ EFKJ =I A B JDA EFKJ BEAI IJHEC EJ E JDA =H?DELA MEJD JDA
                        IFA?EBEA@ name
         −h host        6DA AJMH =@@HAII B JDA 8AJE IAHLAH 6DA @AB=KJ EI J=A BH JDA ALEHAJ
                        L=HE=>A venti 1B JDEI L=HE=>A @AI J ANEIJ JDA JDA @AB=KJ EI JDA AJ==A
                        $venti MDE?D ?= >A ?BECKHA@ LE= ndb$
         −m             -NF=@ =@ AHCA =O vac =H?DELAI JD=J =HA BK@ MDEA HA=@EC JDA EFKJ BEAI
                        6DEI FJE EI KIABK BH >KE@EC = =H?DELA BH = ?A?JE B ANEIJEC =H?DELAI
                        -=?D =H?DELA EI EIAHJA@ EJ JDA AM =H?DELA =I EB EJ D=@ >AA KF=?A@ E JDA @EHA?
                        JHO E MDE?D EJ M=I BK@ KJEFA =H?DELAI ?= >A KF=?A@ E = IECA @EHA?JHO
                        =@ JDA ?JAJI ME >A AHCA@ 6 >A @AJA?JA@ JDA =H?DELAI KIJ A@ E .vac
                        JA = =H?DELA EI EIAHJA@ >O IEFO ?FOEC JDA HJ BECAHFHEJ =@ @AI J
                        HAGKEHA JDA =H?DELA J >A KF=?A@
         −q             1?HA=IA JDA FAHBH=?A B JDA −d FJE >O @AJA?JEC K?D=CA@ BEAI >=IA@  =
                        =J?D B JDA BEAI =A =@ JDAH AJ= @=J= H=JDAH JD= AN=EEC JDA ?JAJI B
                        JDA BEAI
         −s             2HEJ KJ L=HEKI IJ=JEIJE?I  IJ=@=H@ AHHH
         −v             2H@K?A HA LAH>IA KJFKJ  IJ=@=H@ AHHH E?K@EC JDA =A B JDA BEAI
                        =@@A@ J JDA =H?DELA =@ JDA L=? =H?DELAI JD=J =HA ANF=@A@ =@ AHCA@
         Unvac EIJI H ANJH=?JI BEAI IJHA@ E JDA L=? =H?DELA vacfile MDE?D ?= >A AEJDAH = L=? =H?DELA
         IJHEC E JDA BH=J CELA =>LA H JDA =A B = BEA ?J=EEC A 1B file =HCKAJI =HA CELA
         O JDIA BEAI H @EHA?JHEAI ME >A ANJH=?JA@ 6DA FJEI =HA
         −T     5AJ JDA @EBE?=JE JEA  ANJH=?JA@ BEAI J JDA JEA EIJA@ E JDA =H?DELA




                                                        #!
8)+                                                                                                   8)+



         −c   9HEJA ANJH=?JA@ BEAI J IJ=@=H@ KJFKJ EIJA=@ B ?HA=JEC = BEA
         −h   =I FAH vac
         −t   2HEJ = EIJ B JDA BEAI J IJ=@=H@ KJFKJ H=JDAH JD= ANJH=?JEC JDA
         −v   1B ANJH=?JEC BEAI FHEJ JDA =A B A=?D BEA =@ @EHA?JHO J IJ=@=H@ AHHH 1B EIJEC BEAI
              FHEJ AJ=@=J= E =@@EJE J JDA =AI
SOURCE
     /sys/src/cmd/vac
     /sys/src/cmd/unvac
SEE ALSO
      vacfs" venti&




                                                      #"
8-61                                                                                           8-61




NAME
       HA=@ MHEJA ?FO   IEFA 8AJE ?EAJI
SYNOPSIS
     venti/read  −h host   −t type  score
     venti/write  −z   −h host   −t type 
     venti/copy  −fir   −t type  srchost dsthost score  type 
DESCRIPTION
      8AJE EI = 50)=@@HAIIA@ >? IJH=CA IAHLAH 5AA venti$ BH = BK EJH@K?JE
       Read HA=@I = >? MEJD JDA CELA score =@ KAHE? type BH JDA IAHLAH host =@ FHEJI JDA >?
       J IJ=@=H@ KJFKJ 1B JDA −h FJE EI EJJA@ read ?IKJI JDA ALEHAJ L=HE=>A $venti
       BH JDA =A B JDA 8AJE IAHLAH 1B JDA −t FJE EI EJJA@ read ME JHO A=?D JOFA A =J = JEA
       KJE EJ BE@I A JD=J MHI 1J FHEJI JDA ?HHAIF@EC read −t ?=@ J IJ=@=H@ AHHH J
       E@E?=JA JDA JOFA B JDA >?
       Write MHEJAI =J IJ #$ E>OJAI B @=J= BH IJ=@=H@ EFKJ J JDA IAHLAH host =@ FHEJI JDA
       HAIKJEC I?HA J IJ=@=H@ KJFKJ 1B JDA −t FJE EI EJJA@ write KIAI JOFA  @AJEC = @=J=
       >? 1B JDA −z FJE EI CELA write AH JHK?=JAI JDA >? >ABHA MHEJEC EJ J JDA IAHLAH
       Copy ANFA?JI score J >A JDA I?HA B = VtRoot >? 1J ?FEAI JDA AJEHA JHAA B >?I HA=?D
       =>A BH JDA HJ >? BH JDA IAHLAH srchost J JDA IAHLAH dsthost
       6DA −f FJE ?=KIAI copy J HK E B=IJ @A =IIKEC JD=J EB = >? =HA=@O ANEIJI  JDA
       @AIJE=JE 8AJE IAHLAH = EJI ?DE@HA =I ANEIJ =@ AA@ J >A ?DA?A@
       6DA −i =@ −r FJEI ?JH copy I HA=?JE J AHHHI HA=@EC BH srchost Copy =M=OI FHEJI
       EBH=JE J IJ=@=H@ AHHH =>KJ A=?D HA=@ AHHH *O @AB=KJ copy ANEJI =BJAH FHEJEC JDA BEHIJ
       AHHH 1B JDA −i FJE EI CELA HA=@ AHHHI =HA ECHA@ 6DEI EI @=CAHKI >AD=LEH >A?=KIA EJ
       >HA=I JDA =IIKFJE =@A >O B=IJ @A 1B JDA −r FJE EI CELA copy HAF=?AI FEJAHI J
       KHA=@=>A >?I MEJD FEJAHI J JDA AH >? 1J MHEJAI JDA AM HJ I?HA J IJ=@=H@ KJFKJ
SOURCE
     /sys/src/cmd/venti
SEE ALSO
      vac venti  vacfs" venti$ venti& venti−backup& venti−fmt&
BUGS
       6DAHA IDK@ >A FHCH=I J HA=@ =@ MHEJA LAJE BEAI =@ @EHA?JHEAI




                                                     ##
81                                                                                                81




NAME
        #E E LE GE       EIJHK?JE IEK=JHI
SYNOPSIS
     vi      textfile   
     vi     pid
     5i      textfile   
     5i     pid
     ki      textfile   
     ki     pid
     qi      textfile   
     qi     pid
DESCRIPTION
      Vi IEK=JAI JDA ANA?KJE B = 125 >E=HO E = 2= ' ALEHAJ 1J D=I JM =E KIAI =I =
      @A>KCCAH =@ =I = IJ=JEIJE?I C=JDAHAH 2HCH=I HKEC K@AH vi ANA?KJA =>KJ JM DK@HA@
      JEAI IMAH JD= H= >KJ B=IJAH JD= IECA IJAFFEC K@AH db 5i ki =@ qi =HA IEE=H J vi
      >KJ EJAHFHAJ )4 52)4+ =@ 2MAH2+ >E=HEAI 6DA BMEC @EI?KIIE HABAHI J vi >KJ =FFEAI
      J JDA JDAHI =I MA
        Vi ME IEK=JA JDA ANA?KJE B = =A@ textfile 1J ME =I =A = ?FO B = ANEIJEC FH?AII
        MEJD FH?AII E@ pid =@ IEK=JA EJI ?JEK=JE
        )I = @A>KCCAH vi BBAHI HA ?FAJA EBH=JE JD= db 6H=?EC ?= >A FAHBHA@ =J JDA
        ALA B EIJHK?JEI IOIJA ?=I H BK?JE ?=I Vi =MI >HA=FEJI J >A JHECCAHA@ MDA
        IFA?EBEA@ =@@HAIIAI E AHO =HA =??AIIA@ ) HAFHJ B EIJHK?JE ?KJI =@ @A=O BEI =@
        @EIJHE>KJE EI FH@K?A@ BH A=?D HK Vi IEK=JAI JDA +27 I ?=?DAI =@ 7 J =IIEIJ JDA FJE
        E=JE B ?FEAHI =@ FHCH=I
        6DA ?=@ EJAHB=?A EHHHI JDA EJAHB=?A J db IAA db BH = @AJ=EA@ @AI?HEFJE ,=J= BH
        =JI =@ =@@HAIIEC =HA ?F=JE>A MEJD db AN?AFJ BH @EI=IIA>O vi BBAHI O 125 db
        −mmipsco AE?I BH =?DEA EIJHK?JEI Ki BBAHI >JD 2= ' =@ 5K 52)4+ BH=JI
        5ALAH= ANJH= ?=@I =M ANJA@A@ JH=?EC =@ FHEJEC B IJ=JEIJE?I
        $t0ics
              6DA t ?=@ ?JHI JH=?EC AH ?=?AI = JH=?EC FJEI
                 i            -=>A EIJHK?JE JH=?EC
                 c            -=>A ?= JH=?EC
                 s            -=>A IOIJA ?= JH=?EC
        $iitsp
              6DA i ?=@ FHEJI IJ=JEIJE?I =??KK=JA@ >O = ?@A HK E JDEI IAIIE
                 i            2HEJ EIJHK?JE ?KJI =@ BHAGKA?O
                 p            2HEJ ?O?A FHBEA
                 t            Vi O 2HEJ 6* =@ ?=?DA IJ=JEIJE?I
                 s            2HEJ AHO HABAHA?A MHEC IAJ =@ IEA IJ=JEIJE?I
        :barwe
              Vi =MI >HA=FEJI J >A IAJ  =O AHO ?=JE 6DAIA >HA=FEJI EJH MDA
              = ?=JE EI =??AIIA@ HA=@ MHEJJA H AGK=I = ?AHJ=E L=KA .H AGK=EJO JDA ?F=HA@
              L=KA EI JDA count IAA db IKFFEA@ J JDA ?=@
SOURCE
     /sys/src/cmd/vi AJ?
SEE ALSO
      nm db
BUGS
        6DA ?@A CAAH=JA@ >O JDA ?FEAHI EI MA IKFFHJA@ >KJ IA KKIK= EIJHK?JEI =HA KE
        FAAJA@ 5A 2= ' IOIJA ?=I IK?D =I rfork ?=KIA IEK=JA@ JH=FI 6DA B=JEC FEJ



                                                              #$
81                                                                                             81



        IEK=JE =AI =IIKFJEI =>KJ JDA EJAHFHAJEC =?DEA I B=JEC FEJ IKFFHJ 6DA B=J
        EC FEJ ?LAHIEI FAHBHA@ >O vi =O ?=KIA = II B FHA?EIE




                                                   #%
8+                                                                                               8+




NAME
       L?I L?L   HAJA BH=A >KBBAH IAHLAH =@ LEAMAH BH 8EHJK= AJMH +FKJEC 8+
SYNOPSIS
     vncs  −v   −c cert   −d :display   −g widthxheight   −p pixfmt   −x net   cmd  args  
       vncs −k :display  −x net 
       vncv  −cstv   −e encodings   −k keypattern  host:n
DESCRIPTION
      8+ EI = ECDJMAECDJ FHJ? BH =??AIIEC CH=FDE?= =FFE?=JEI HAJAO 6DA FHJ? =MI
      A H HA ?EAJI J ?A?J J = IAHLAH 9DEA ?A?JA@ ?EAJI @EIF=O JDA BH=A >KBBAH FHA
      IAJA@ >O JDA IAHLAH =@ ?= IA@ KIA ALAJI AO>=H@ ALAJI =@ AN?D=CA I=HB >KBBAHI
      6DA IAHLAH FAHIEIJI =?HII LEAMAH IAIIEI I JD=J JDA LEHJK= =FFE?=JE ?= >A =??AIIA@ BH
      L=HEKI ?=JEI =I EJI MAH LAI =HK@
       8+ @EIF=OI D=LA =AI B JDA BH host:n MDAHA host EI JDA =?DEA I AJMH =A =@ n EI
       = I= EJACAH E@AJEBEAH @EIF=O n EI IAHLA@  6+2 FHJ #'n
       Vncs IJ=HJI = AM LEHJK= BH=A >KBBAH E AHO IEK=JEC = 2= ' JAHE= HKEC cmd args
       >O @AB=KJ = EJAH=?JELA IDA )I LEAMAHI ?A?J A=?D EI =KJDAJE?=JA@ KIEC = H=JDAH >HA==>A
       ?D=ACAHAIFIA FHJ? KIEC JDA KIAH I 1BAH22 F=IIMH@
       6DA FJEI =HA

       −c cert      IJ=HJ 65  A=?D LEAMAH ?A?JE KIEC JDA ?AHJEBE?=JA E JDA BEA cert 6DA ?HHA
                    IF@EC FHEL=JA AO KIJ >A =@A@ EJ JDA IAHLAH I factotum" 9DA IAHLEC 65
                    ?A?JEI JDA >=IA FHJ EI !#% ' H=JDAH JD= #'
       −d :n        HK  @EIF=O n ; MEJDKJ JDEI FJE JDA IAHLAH IA=H?DAI BH = KKIA@ @EIF=O
       −g widthxheight
                 IAJ JDA LEHJK= BH=A >KBBAH J >A widthxheight @AB=KJ  "N%$& FENAI
       −p pixfmt IAJ JDA LEHJK= BH=A >KBBAH I EJAH= FENA BH=J J pixfmt @AB=KJ r5g6b5
       −v           FHEJ LAH>IA KJFKJ J IJ=@=H@ AHHH
       −x net       =K?A  = =JAH=JA AJMH EJAHB=?A *A?=KIA B JDA MA= =KJDAJE?=JE FH
                    J? =@ @AB=KJ =? B A?HOFJE JDEI FJE KIJ >A =??F=EA@ >O −c
       6DA ?=@ vncs −k :n EI JDA 8+ IAHLAH HKEC  @EIF=O n
       Vncv FHLE@AI =??AII J HAJA @EIF=O host:n 1J HAIEAI EJI ME@M J >A JDA I=AH B JDA
       HAJA BH=A >KBBAH IEA =@ JDA ?= I?HAA
       6DA FJEI =HA
       −c      MDA ?A?JEC J &>EJ @EIF=OI HAGKAIJ r4g4b4 FENAI H=JDAH JD= r3g3b2 FENAI
               6DEI J=AI KF HA >=@ME@JD >KJ KIK=O CELAI IECEBE?=JO >AJJAH =J?DEC J JDA 2= '
               ?H =F
       −e encodings
             IAJ JDA H@AHA@ EIJ B =MA@ BH=A >KBBAH KF@=JA A?@ECI 6DA @AB=KJ =@ BK IAJ EI
             copyrect corre hextile rre raw 6DA A?@ECI IDK@ >A CELA =I = IECA
             IF=?AIAF=H=JA@ =HCKAJ GKJA@ MDA KIEC JDA IDA
       −k keypattern
             =@@ keypattern J JDA F=JJAH KIA@ J IAA?J = AO BH factotum"
       −s      ID=HA JDA @EIF=O MEJD ANJ=J LEAMAHI >O @AB=KJ ANJ=J LEAMAHI =HA ?IA@ MDA = AM
               LEAMAH ?A?JI
       −t      IJ=HJ 65  JDA ?A?JE
       −v      FHEJ LAH>IA KJFKJ J IJ=@=H@ AHHH
       6DA 8+ FHJ? HAFHAIAJI AO>=H@ EFKJ =I AO KF@M ALAJI 2= ' @AI J ANFIA JDA
       IJ=JA B JDA +J =@ 5DEBJ AOI AN?AFJ =I EJ ?= >A EBAHHA@ BH HA?AEFJ B ?JH H IDEBJA@ ?D=H=?
       JAHI 1J @AI J ANFIA JDA IJ=JA B JDA )J AO =J = IE?A JDA )J AO EI KIA@ J ?FIA



                                                     #&
8+                                                                                          8+



       7E?@A ?D=H=?JAHI IAA keyboard $ Vncv ?HHA?JO D=@AI JDA IA@EC B ?JH =@ IDEBJA@
       ?D=H=?JAHI 6 IKFFHJ IOIJAI JD=J KIA AO IAGKA?AI EA )J: H MHIA )JKIA?E? JOF
       EC JDA 2= ' ?FIA IAGKA?AI Alt Z A BH )J Alt Z C BH +JH =@ Alt Z S BH 5DEBJ
       ME IA@ = AO @M AII=CA BH JDA CELA AO ) ?HHAIF@EC AO KF AII=CA ME >A
       IAJ =BJAH JDA ANJ AO EI FHAIIA@ H MDA JDA IAGKA?A EI HAJOFA@ MDE?DALAH D=FFAI BEHIJ
SOURCE
     /sys/src/cmd/vnc
SEE ALSO
      drawterm&
      http://www.uk.research.att.com/vnc
BUGS
       1B JDA HAJA BH=A >KBBAH EI =HCAH JD= JDA ?= I?HAA O JDA KFFAH ABJ ?HAH ?= >A
       =??AIIA@
       Vncv @AI  LAHEBE?=JE B JDA 65 ?AHJEBE?=JA FHAIAJA@ >O JDA IAHLAH
       Vncv IKFFHJI O LAHIE !! B JDA 4.* FHJ?




                                                     #'
86                                                                                                      86




NAME
        LJ   AK=JA = 86 H 86     JAHE=
SYNOPSIS
     vt  −2abcx   −f font   −l log 
DESCRIPTION
      Vt HAF=?AI = rio ME@M MEJD = BHAID EIJ=?A B JDA IDA rc HKEC MEJDE = AK=JE B =
      ,-+ 86 JAHE= 6 ANEJ vt ANEJ JDA rc EJ IJ=HJI
   Options
       2
       a
       x ?D=CA vt J AK=JA = 86  )51 H :6AH JAHE= HAIFA?JELAO
       b ?D=CAI JDA ?H I?DAA J MDEJA JANJ  = >=? >=?CHK@ >KJ FJAJE=O MEJD ?HI
           BH AI?=FA IAGKA?AI
       c ?D=CAI JDA ?H I?DAA J ?DHA  ?HI
       f IAJI JDA font
       l =AI = log BEA BH JDA IAIIE
   Menus
      6DA HECDJ >KJJ D=I = AK MEJD JDA BMEC AJHEAI J FHLE@A JDA IHJ B ?D=H=?JAH FH?AIIEC
      ANFA?JA@ >O 2= ' IOIJAI
        24x80      4AIEA JDA vt ME@M J D@ " HMI B & ?KI
        crnl       2HEJ = AMEA EABAA@ ?D=H=?JAH =BJAH HA?AELEC = ?=HHE=CA HAJKH BH JDA DIJ
        cr         , J FHEJ = AMEA =BJAH ?=HHE=CA HAJKH
        nlcr       2HEJ = ?=HHE=CA HAJKH =BJAH HA?AELEC = AMEA BH JDA DIJ
        nl         , J FHEJ = ?=HHE=CA HAJKH =BJAH AMEA
        raw        -JAH H=M  A?D  EJAHFHAJ=JE ?D=H=?JAH @A BH EFKJ
        cooked     A=LA H=M @A
        exit       -NEJ vt
        6DA E@@A >KJJ D=I = AK MEJD JDA BMEC AJHEAI
        backup         LA JDA @EIF=O >=? A I?HAABK
        forward        LA JDA @EIF=O BHM=H@ A I?HAABK 6DAIA =HA = FH IK>IJEJKJA BH = I?H
                       >=H
        reset          ,EIF=O JDA =IJ I?HAABK JDA I=A =I CEC forward J JDA A@
        clear          +A=H JDA I?HAA 2HALEKI ?JAJI ?= >A HA?LAHA@ KIEC backup
        send           5A@ JDA ?JAJI B JDA rio I=HB >KBBAH KIJ =I send E JDA rio AK
        scroll         =A AM EAI LEIE>A =I JDAO =FFA=H =J JDA >JJ
        page           9DA JDA F=CA BEI F=KIA =@ M=EJ BH = ?D=H=?JAH J >A JOFA@ >ABHA FH?AA@EC
                       6DA @M =HHM AO =@L=?AI = F=CA MEJDKJ IA@EC JDA ?D=H=?JAH J JDA DIJ
SOURCE
     /sys/src/cmd/vt
BUGS
        6DEI FHCH= EI KIA@ O BH ?KE?=JEC MEJD BHAEC IOIJAI I EJ EI J =I HE?D = AK=
        JE =I EJI AGKEL=AJ E JDAH ALEHAJI
        7IA ?=HA E IAJJEC H=M =@ AMEA @AI MDA ?A?JEC J 7EN IOIJAI LE= con H ssh
        1J =O =I >A A?AII=HO J IAJ JDA AK=JH EJ H=M @A




                                                     $
9+                                                                                            9+




NAME
        M?   MH@ ?KJ
SYNOPSIS
     wc  −lwrbc   file ... 
DESCRIPTION
      Wc ?KJI EAI MH@I HKAI IOJ=?JE?=OEL=E@ 76. ?@AI =@ >OJAI E JDA =A@ files H E
      JDA IJ=@=H@ EFKJ EB  BEA EI =A@ ) MH@ EI = =NE= IJHEC B ?D=H=?JAHI @AEEJA@ >O
      IF=?AI J=>I H AMEAI 6DA ?KJ B HKAI E?K@AI EL=E@ ?@AI
        1B JDA FJE= =HCKAJ EI FHAIAJ KIJ JDA IFA?EBEA@ ?KJI EAI MH@I HKAI >HA 76.
        ?@AI H >OJAI =HA IAA?JA@ >O JDA AJJAHI l w r b H c JDAHMEIA EAI MH@I =@ >OJAI
        −lwc =HA HAFHJA@
SOURCE
     /sys/src/cmd/wc.c
BUGS
        6DA 7E?@A 5J=@=H@ D=I =O >= ?D=H=?JAHI I?=JJAHA@ JDHKCD EJ >KJ wc I BH O )5+11
        IF=?A J=> =@ AMEA
        Wc IDK@ D=LA FJEI J ?KJ IK>FJE= 76. ?@AI =@ >OJAI JD=J ?=J ??KH E =O 76.
        ?@A




                                                   $
9-)60-4                                                                                    9-)60-4




NAME
       MA=JDAH   FHEJ MA=JDAH HAFHJ
SYNOPSIS
     weather  air   st 
DESCRIPTION
      Weather FHEJI JDA ?= ?@EJEI =@ IALA@=O BHA?=IJ IJ HA?AJO HAFHJA@ =J JDA 75 =EHFHJ
      MEJD JDA JDHAAAJJAH ?=JE E@AJEBEAH air /ELA = JMAJJAH 75 IJ=JA =>>HALE=JE st EIJA=@
      weather FHEJI = J=>A B air ?=JE E@AJEBEAHI M BH st
       6DA =HCKAJI =HA KJK=O AN?KIELA =@ ?=IAEIAIEJELA 1B AEJDAH EI CELA air @AB=KJI J ?=
       JE E@AJEBEAH ewr @AIEC=JEC JDA AM=H  =EHFHJ A=H *A =>I KHH=O 0E
SOURCE
     /rc/bin/weather




                                                    $
90                                                                                     90




NAME
       MD MDEI   MD EI KIEC JDA =?DEA
SYNOPSIS
     who
       whois person
DESCRIPTION
      Who FHEJI JDA =A B ALAHOA MEJD = -NEJEC FH?AII  JDA ?KHHAJ =?DEA
       Whois I E /adm/whois =@ /adm/users J BE@ KJ HA EBH=JE =>KJ person
SOURCE
     /rc/bin/who




                                                  $!
919)6+0                                                                                919)6+0




NAME
        MEM=J?D   EJH HE ME@MI
SYNOPSIS
     winwatch  −e exclude   −f font 
DESCRIPTION
      Winwatch @EIF=OI JDA =>AI B = ?KHHAJ rio" ME@MI HABHAIDEC JDA @EIF=O ALAHO BELA IA?
      @I 4ECDJ ?E?EC = ME@M I =>A KDE@AI H=EIAI =@ CELAI B?KI J JD=J ME@M 6OFEC q H
      ,- GKEJI winwatch
        1B JDA −e B=C EI CELA ME@MI =J?DEC JDA HACK=H ANFHAIIE exclude =HA J IDM
EXAMPLE
     -N?K@EC MEM=J?D IJ=JI =@ B=?AI BH >AEC IDMA@
               % winwatch −e ’^(winwatch|stats|faces)’
FILES
        /dev/wsys/*/label
SOURCE
     /sys/src/cmd/winwatch.c
SEE ALSO
      rio rio" regexp$




                                                    $"
:,                                                                                                  :,




NAME
        N@       DAN ?J= @A?E= H )5+11 @KF
SYNOPSIS
     xd  option ...   −format ...   file ... 
DESCRIPTION
      Xd ??=JA=JAI =@ @KFI JDA files IJ=@=H@ EFKJ >O @AB=KJ E A H HA BH=JI /HKFI
      B $ >OJAI =HA FHEJA@ E A=?D B JDA =A@ BH=JI A BH=J FAH EA -=?D EA B KJFKJ EI
      FHABENA@ >O EJI =@@HAII >OJA BBIAJ E JDA EFKJ BEA 6DA BEHIJ EA B KJFKJ BH A=?D CHKF EI
      AHF=@@A@ IK>IAGKAJ =HA >=F=@@A@
        .H=JI JDAH JD= −c =HA IFA?EBEA@ >O F=EHI B ?D=H=?JAHI JAEC IEA =@ IJOA 4x >O @AB=KJ
        6DA IEAI =HA
        1   H   b >OJA KEJI
        2   H   w  >OJA >ECA@E= KEJI
        4   H   l ">OJA >ECA@E= KEJI
        8   H   v &>OJA >ECA@E= KEJI
        6DA IJOAI =HA
        o          ?J=
        x          0AN=@A?E=
        d          ,A?E=
        JDAH FJEI =HA
        −c            .H=J =I 1x >KJ FHEJ )5+11 HAFHAIAJ=JEI H + AI?=FA IAGKA?AI MDAHA FIIE>A
        −astyle       2HEJ BEA =@@HAIIAI E JDA CELA IJOA =@ IEA "
        −u            7>KBBAHA@ .KID JDA KJFKJ >KBBAH =BJAH A=?D $>OJA IAGKA?A
        −s            4ALAHIA IM=> JDA H@AH B >OJAI E A=?D CHKF B " >ABHA FHEJEC
        −r            2HEJ HAFA=JEC CHKFI B E@AJE?= $>OJA IAGKA?AI =I JDA BEHIJ CHKF BMA@ >O =
                      =IJAHEI
SOURCE
     /sys/src/cmd/xd.c
SEE ALSO
      db
BUGS
        6DA L=HEKI KJFKJ BH=JI @ J EA KF FHFAHO E JDA KJFKJ B xd




                                                           $#
;)++                                                                                           ;)++




NAME
        O=??   OAJ =JDAH ?FEAH?FEAH
SYNOPSIS
     yacc  option ...  grammar
DESCRIPTION
      Yacc ?LAHJI = ?JANJBHAA CH==H =@ JH=I=JE ?@A EJ = IAJ B J=>AI BH = 4 F=HIAH
      =@ JH=I=JH 6DA CH==H =O >A =>ECKKI IFA?EBEA@ FHA?A@A?A HKAI =HA KIA@ J >HA=
      =>ECKEJEAI
        6DA KJFKJ BEA y.tab.c KIJ >A ?FEA@ >O JDA + ?FEAH J FH@K?A = FHCH= yyparse
        6DEI FHCH= KIJ >A =@A@ MEJD = ANE?= ==OAH BK?JE yylex(void) BJA CAAH=JA@ >O
        lex MEJD = main(int argc, char *argv[]) FHCH= =@ MEJD = AHHH D=@EC HK
        JEA yyerror(char*)
        6DA FJEI =HA
        −o output    ,EHA?J KJFKJ J JDA IFA?EBEA@ BEA EIJA=@ B y.tab.c
        −Dn          +HA=JA BEA y.debug ?J=EEC @E=CIJE? AII=CAI 6 E?HFH=JA JDA E JDA
                     F=HIAH ?FEA EJ MEJD FHAFH?AIIH IO> yydebug @ABEA@ 6DA =KJ B
                     @E=CIJE? KJFKJ BH JDA F=HIAH EI HACK=JA@ >O L=KA n 6DA L=KA  HAFHJI AHHHI
                      HAFHJI HA@K?JEI DECDAH L=KAI KF J " E?K@A HA EBH=JE =>KJ IJ=JA
                     JH=IEJEI
        −v           +HA=JA BEA y.output ?J=EEC = @AI?HEFJE B JDA F=HIEC J=>AI =@ B ?
                     BE?JI =HEIEC BH =>ECKEJEAI E JDA CH==H
        −d           +HA=JA BEA y.tab.h ?J=EEC #define IJ=JAAJI JD=J =II?E=JA yacc=IIECA@
                     JA ?@AI MEJD KIAH@A?=HA@ JA =AI  1?K@A EJ E IKH?A BEAI JDAH JD=
                     y.tab.c J CELA =??AII J JDA JA ?@AI
        −s stem      +D=CA JDA FHABEN y B JDA BEA =AI y.tab.c y.tab.h y.debug =@
                     y.output J stem
        −S           9HEJA = F=HIAH JD=J KIAI 5J@E EIJA=@ B JDA print HKJEAI E E>?
        6DA IFA?EBE?=JE B yacc EJIAB EI AIIAJE=O JDA I=A =I JDA 71: LAHIE @AI?HE>A@ E JDA HABAH
        A?AI AJEA@ >AM *AIE@AI JDA −D FJE JDA =E HAAL=J @EBBAHA?AI =HA
               6DA EJAHB=?A J JDA + ALEHAJ EI >O @AB=KJ JDHKCD <libc.h> H=JDAH JD=
               <stdio.h> JDA −S FJE HALAHIAI JDEI
               6DA F=HIAH =??AFJI 76. EFKJ JANJ IAA utf$ MDE?D D=I = ?KFA B ABBA?JI .EHIJ JDA
               HAJKH L=KA B yylex()  CAH BEJI E = short IA?@ JDA IJ=HJEC L=KA BH 
               JAHE=I EI M N- H=JDAH JD= #%
               6DA CAAH=JA@ F=HIAH ?= >A HA?KHIELA =?JEI ?= ?= yyparse BH AN=FA J EFAAJ
               = IHJ B #include IJ=JAAJ E = EJAHFHAJAH
               .E=O IA K@?KAJA@ EAH MHECI B JDA F=HIAH D=LA >AA ?D=CA@ MDE?D =O
               =BBA?J FHCH=I JD=J M J K?D =>KJ EJI IJHK?JKHA
FILES
        y.output
        y.tab.c
        y.tab.h
        y.debug
        y.tmp.*                     JAFH=HO BEA
        y.acts.*                    JAFH=HO BEA
        /sys/lib/yaccpar            F=HIAH FHJJOFA
        /sys/lib/yaccpars           F=HIAH FHJJOFA KIEC IJ@E
SOURCE
     /sys/src/cmd/yacc.c
SEE ALSO
      lex



                                                     $$
;)++                                                                                    ;)++



       5 + DI =@ 4 5AJDE ;=?? ) F=HIAH CAAH=JH  Unix Research System Programmer’s Man-
       ual, 6AJD -@EJE 8KA
       * 9 AHECD= =@ 4> 2EA The UNIX Programming Environment, 2HAJE?A 0= '&"
BUGS
       6DA F=HIAH =O J D=LA BK EBH=JE MDA EJ MHEJAI J y.debug I JD=J JDA =AI B JDA
       JAI HAJKHA@ >O yylex =O >A EIIEC




                                                 $%
;-56-4,);                                                                                   ;-56-4,);




NAME
        OAIJAH@=O @EBBO   FHEJ BEA =AI BH JDA @KF
SYNOPSIS
     yesterday  −abcCdDs   −n daysago   date  files ...
        diffy  −abcefmnrw  files ...
DESCRIPTION
      Yesterday FHEJI JDA =AI B JDA files BH JDA IJ HA?AJ @KF 5E?A @KFI =HA @A A=HO E
      JDA HEC OAIJAH@=O I BEAI =HA HA=O E J@=O I @KF .H AN=FA EB J@=O EI =H?D % '' 
                 yesterday /adm/users
        FHEJI
                 /n/dump/1992/0317/adm/users
        1 B=?J JDA EFAAJ=JE EI J IAA?J JDA IJ HA?AJ @KF E JDA ?KHHAJ OA=H I JDA @KF
        IAA?JA@ =O J >A BH J@=O
        9DA FHAIAJA@ MEJD = F=JD B JDA BH /n/fs/path yesterday ME  BH @KF BEAI B JDA
        BH /n/fsdump/yyyy/hhmm/path
        *O @AB=KJ yesterday FHEJI JDA =AI B JDA @KF BEAI ?HHAIF@EC J JDA =A@ BEAI 6DA
        BEHIJ IAJ B FJEI ?D=CAI JDEI >AD=LEH
        −a       4K acme I adiff J ?F=HA JDA @KF BEAI MEJD JDA =A@ BEAI
        −b       *E@ JDA @KF BEAI LAH JDA =A@ BEAI
        −c       +FO JDA @KF BEAI LAH JDA =A@ BEAI
        −C       +FO JDA @KF BEAI LAH JDA =A@ BEAI O MDA JDAO @EBBAH
        −d       4K diff J ?F=HA JDA @KF BEAI MEJD JDA =A@ BEAI
        −D       4K diff −n J ?F=HA JDA @KF BEAI MEJD JDA =A@ BEAI
        6DA date FJE IAA?JI JDAH @=O I @KFI MEJD = BH=J B        " $ H & @ECEJI B JDA BH d,
        dd mmdd yymmdd H yyyymmdd 
        6DA −n FJE IAA?JI JDA @KF daysago FHEH J JDA ?KHHAJ @=O
        6DA −s FJE IAA?JI JDA IJ HA?AJ I=FIDJ EIJA=@ B JDA IJ HA?AJ =H?DELA@ @KF 5=F
        IDJI =O ??KH HA BHAGKAJO JD= @KFI
        Yesterday @AI J CK=H=JAA JD=J JDA IJHEC EJ FHEJI HAFHAIAJI = ANEIJEC BEA
        Diffy HKI diff MEJD JDA CELA FJEI J ?F=HA OAIJAH@=O I LAHIE B A=?D B JDA =A@ BEAI
        MEJD J@=O I
EXAMPLES
     *=? KF J OAIJAH@=O I 125 >E=HO B vc
                 yesterday −c /mips/bin/vc
        6AFH=HEO >=? KF J =H?D  I 125 + E>H=HO J IAA EB = FHCH= HKI ?HHA?JO MDA =@A@
        MEJD EJ
                 yesterday −b −0301 /mips/lib/libc.a
                 rm v.out
                 mk
                 v.out
        .E@ MD=J D=I ?D=CA@ E JDA + E>H=HO IE?A =H?D 
                 yesterday −d −0301 /sys/src/libc/port/*.c
        .E@ MD=J D=I ?D=CA@ E JDA IKH?A JHAA J@=O
                 diffy −r /sys/src
FILES
        /n/dump



                                                      $&
;-56-4,);                                            ;-56-4,);



SOURCE
     /rc/bin/yesterday
     /rc/bin/diffy
SEE ALSO
      history bind diff fs"
BUGS
       1J I D=H@ J KIA JDEI ?=@ MEJDKJ IECEC




                                                   $'
164                                                                                               164 




NAME
       EJH   EJH@K?JE J E>H=HO BK?JEI
SYNOPSIS
     #include <u.h>
       #include <libc.h>
       #include <auth.h>
       #include <bio.h>
       #include <draw.h>
       #include <fcall.h>
       #include <frame.h>
       #include <mach.h>
       #include <ndb.h>
       #include <regexp.h>
       #include <stdio.h>
       #include <thread.h>
DESCRIPTION
      6DEI IA?JE @AI?HE>AI BK?JEI E L=HEKI E>H=HEAI .H JDA IJ F=HJ A=?D E>H=HO EI @ABEA@ >O =
      IECA + E?K@A BEA IK?D =I JDIA EIJA@ =>LA =@ = IECA =H?DELA BEA ?J=EEC JDA E>H=HO
      FHFAH 6DA =A B JDA =H?DELA EI /$objtype/lib/libx.a MDAHA x EI JDA >=IA B JDA
      E?K@A BEA =A IJHEFFA@ B = A=@EC lib EB FHAIAJ .H AN=FA <draw.h> @ABEAI JDA ?
      JAJI B E>H=HO /$objtype/lib/libdraw.a MDE?D =O >A =>>HALE=JA@ MDA =A@ J JDA
      =@AH =I −ldraw 1 FH=?JE?A A=?D E?K@A BEA ?J=EI = #pragma JD=J @EHA?JI JDA =@AH J
      FE? KF JDA =II?E=JA@ =H?DELA =KJ=JE?=O I EJ EI H=HAO A?AII=HO J JA JDA =@AH MDE?D
      E>H=HEAI = FHCH= AA@I
       6DA E>H=HO J MDE?D = BK?JE >ACI EI @ABEA@ >O JDA DA=@AH BEA JD=J @ABEAI EJI EJAHB=?A 6DA
        + E>H=HO  libc ?J=EI IJ B JDA >=IE? IK>HKJEAI IK?D =I strlen ,A?=H=JEI BH = B JDAIA
       BK?JEI =HA E <libc.h> MDE?D KIJ >A FHA?A@A@ >O needs = E?K@A B <u.h> 6DA
       CH=FDE?I E>H=HO draw EI @ABEA@ >O <draw.h> MDE?D AA@I <libc.h> =@ <u.h> 6DA *KB
       BAHA@ 1 E>H=HO libbio EI @ABEA@ >O <bio.h> MDE?D AA@I <libc.h> =@ <u.h> 6DA )51
       + 5J=@=H@ 1 E>H=HO libstdio EI @ABEA@ >O <stdio.h> MDE?D AA@I <u.h> 6DAHA =HA = BAM
       JDAH AII ?O KIA@ E>H=HEAI @ABEA@  E@ELE@K= F=CAI B JDEI IA?JE
       6DA E?K@A BEA <u.h> = FHAHAGKEIEJA B IALAH= JDAH E?K@A BEAI @A?=HAI JDA =H?DEJA?JKHA
       @AFA@AJ =@ E@AFA@AJ JOFAI E?K@EC uchar ushort uint =@ ulong JDA KIECA@ EJA
       CAH JOFAI schar JDA IECA@ ?D=H JOFA vlong =@ uvlong JDA IECA@ =@ KIECA@ LAHO C EJA
       CH= JOFAI Rune JDA 7E?@A ?D=H=?JAH JOFA u8int u16int u32int =@ u64int JDA KIECA@ EJA
       CH= JOFAI MEJD IFA?EBE? ME@JDI uintptr JDA KIECA@ EJACH= JOFA MEJD JDA I=A ME@JD =I =
       FEJAH jmp_buf JDA JOFA B JDA =HCKAJ J setjmp =@ longjmp FKI =?HI JD=J @ABEA JDA =O
       KJ B jmp_buf IAA setjmp  @ABEEJEI B JDA >EJI E JDA B=JECFEJ ?JH HACEIJAH =I KIA@
       >O getfcr  =@ JDA =?HI va_arg =@ BHEA@I BH =??AIIEC =HCKAJI B L=HE=@E? BK?JEI
       E@AJE?= J JDA =?HI @ABEA@ E <stdarg.h> E )51 +
   Name space
      .EAI =HA ?A?JA@ EJ = DEAH=H?DE?= HC=E=JE ?=A@ = file tree IJ=HJEC E = directory ?=A@ JDA
      root .EA =AI =I ?=A@ paths ?IEIJ B = K>AH B /IAF=H=JA@ path elements MEJD JDA
      I=IDAI ?HHAIF@EC J @EHA?JHEAI ) F=JD AAAJ KIJ ?J=E O FHEJ=>A ?D=H=?JAHI JDIA
      KJIE@A JDA ?JH IF=?AI B )5+11 =@ =JE ) F=JD AAAJ ?=J ?J=E = I=ID
       9DA = FH?AII FHAIAJI = BEA =A J 2= ' EJ EI evaluated >O JDA BMEC =CHEJD 5J=HJ
       MEJD = @EHA?JHO JD=J @AFA@I  JDA BEHIJ ?D=H=?JAH B JDA F=JD / A=I JDA HJ B JDA =E DEAH
       =H?DO # A=I JDA IAF=H=JA HJ B = AHA @ALE?A I BEA JHAA IAA 5A?JE ! =@ =OJDEC AIA
       A=I JDA FH?AII I ?KHHAJ MHEC @EHA?JHO 6DA BH A=?D F=JD AAAJ  KF JDA AAAJ
       E JDA @EHA?JHO =@L=?A J JD=J @EHA?JHO @ = FIIE>A JH=I=JE IAA >AM =@ HAFA=J 6DA
       =IJ IJAF =O OEA@ = @EHA?JHO H HACK=H BEA 6DA ?A?JE B BEAI HA=?D=>A BH JDA HJ EI



                                                       %
164                                                                                            164 



      ?=A@ JDA name space B = FH?AII
      ) FHCH= ?= KIA bind H mount IAA bind  J I=O JD=J MDAALAH = IFA?EBEA@ BEA EI HA=?DA@ @KH
      EC AL=K=JE AL=K=JE EIJA=@ ?JEKAI BH = IA?@ IFA?EBEA@ BEA )I JDA I=A IOIJA
      ?=I ?HA=JA union directories MDE?D =HA ??=JA=JEI B H@E=HO @EHA?JHEAI JD=J =HA IA=H?DA@
      IAGKAJE=O KJE JDA @AIEHA@ AAAJ EI BK@ 7IEC bind =@ mount J @ =A IF=?A =@KIJ
      AJ =BBA?JI O JDA ?KHHAJ FH?AII CHKF IAA >AM +AHJ=E ?LAJEI =>KJ JDA =OKJ B
      JDA =A IF=?A IDK@ >A FHAIAHLA@ IAA namespace"
  File I/O
       .EAI =HA FAA@ BH EFKJ H KJFKJ >O open H create IAA open  6DAIA ?=I HAJKH = EJACAH
       ?=A@ = file descriptor MDE?D E@AJEBEAI JDA BEA J IK>IAGKAJ 1 ?=I J=>O read  =@ write
       6DA IOIJA =?=JAI JDA K>AHI >O IAA?JEC JDA MAIJ KKIA@ @AI?HEFJH 6DAO =HA =?=JA@
       @O=E?=O JDAHA EI  LEIE>A EEJ J JDA K>AH B BEA @AI?HEFJHI = FH?AII =O D=LA FA
       6DAO =O >A HA=IIECA@ KIEC dup  .EA @AI?HEFJHI =HA E@E?AI EJ = AHA HAIE@AJ file
       descriptor table -=?D FH?AII D=I = =II?E=JA@ BEA @AI?HEFJH J=>A 1 IA ?=IAI IAA rfork E
       fork  = BEA @AI?HEFJH J=>A =O >A ID=HA@ >O IALAH= FH?AIIAI
      *O ?LAJE BEA @AI?HEFJH  EI JDA IJ=@=H@ EFKJ  EI JDA IJ=@=H@ KJFKJ =@ EI JDA IJ=
      @=H@ AHHH KJFKJ 9EJD A AN?AFJE JDA FAH=JEC IOIJA EI K=M=HA B JDAIA ?LAJEI EJ EI
      FAHEIIE>A J ?IA BEA  H ALA J HAF=?A EJ >O = BEA FA O BH MHEJEC >KJ =O FHCH=I
      ME >A ?BKIA@ >O IK?D ?DE?=AHO 6DA AN?AFJE EI JD=J JDA IOIJA FHEJI AII=CAI =>KJ >H
      A FH?AIIAI J BEA @AI?HEFJH 
      .EAI =HA H=O HA=@ H MHEJJA E IAGKAJE= H@AH 6DA 1 FIEJE E JDA BEA EI ?=A@ JDA file
      offset =@ =O >A IAJ =H>EJH=HEO KIEC JDA seek  IOIJA ?=
      ,EHA?JHEAI =O >A FAA@ =@ HA=@ K?D EA HACK=H BEAI 6DAO ?J=E = EJACH= K>AH B
      HA?H@I ?=A@ directory entries -=?D AJHO EI = =?DEAE@AFA@AJ HAFHAIAJ=JE B JDA EBH
      =JE =>KJ = ANEIJEC BEA E JDA @EHA?JHO E?K@EC JDA =A MAHIDEF FAHEIIE =??AII
      @=JAI =@ I  6DA AJHO ?HHAIF@EC J = =H>EJH=HO BEA ?= >A HAJHEALA@ >O stat  H fstat
      wstat =@ fwstat MHEJA >=? AJHEAI JDKI ?D=CEC JDA FHFAHJEAI B = BEA ) AJHO =O >A JH=I
      =JA@ EJ = HA ?LAEAJ =@@HAII=>A BH ?=A@ = Dir IJHK?JKHA dirstat dirfstat, dirwstat
      =@ dirfwstat ANA?KJA JDA =FFHFHE=JA JH=I=JEI IAA stat 
      AM BEAI =HA =@A MEJD create IAA open  =@ @AAJA@ MEJD remove  ,EHA?JHEAI =O J
      @EHA?JO >A MHEJJA create remove wstat =@ fwstat =JAH JDA
      6DA FAH=JEC IOIJA AHA HA?H@I JDA BEA =A KIA@ J =??AII A=?D FA BEA H @EHA?JHO 1B
      JDA BEA EI FAA@ >O = ?= =A A JD=J @AI J >ACE / H # JDA IOIJA =AI JDA IJHA@
      =A =>IKJA >O FHABENEC JDA IJHEC =II?E=JA@ MEJD JDA ?KHHAJ @EHA?JHO 5EE=H ANE?= =@KIJ
      AJI =HA =@A BH F=JD =AI ?J=EEC . @J H .. @J@J *O JDEI FH?AII JDA IOIJA
      =EJ=EI = HA?H@ B JDA HKJA >O MDE?D A=?D BEA M=I =??AIIA@ )JDKCD JDAHA EI = FIIE>EEJO BH
      AHHH JDA =A EI J =EJ=EA@ =BJAH JDA BEA EI FAA@ I HAL=I =@ HA=ECI ?= ?
      BK@ EJ JDEI IEFA AJD@ KIK=O FAHEJI JDA IOIJA J HAJKH LE= JDA fd2path  IOIJA ?=
      =@ HA=JA@ ?=I IK?D =I getwd  = L=E@ =A JD=J =O >A KIA@ J BE@ = BEA =C=E 6DEI EI =I
      JDA IKH?A B JDA =AI HAFHJA@ E JDA =A IF=?A EIJEC B ns H /dev/ns IAA proc!
      Pipe  ?HA=JAI = ?A?JA@ F=EH B BEA @AI?HEFJHI KIABK BH >E@EHA?JE= ?= ?KE?=JE
  Process execution and control
      ) AM FH?AII EI ?HA=JA@ MDA = ANEIJEC A ?=I rfork MEJD JDA RFPROC >EJ IAJ KIK=O KIJ >O
      ?=EC fork  6DA AM ?DE@ FH?AII IJ=HJI KJ MEJD ?FEAI B JDA =@@HAII IF=?A =@ IJ JDAH
      =JJHE>KJAI B JDA @ F=HAJ FH?AII 1 F=HJE?K=H JDA ?DE@ IJ=HJI KJ HKEC JDA I=A FHCH=
      =I JDA F=HAJ exec  ME >HEC E = @EBBAHAJ A
      -=?D FH?AII D=I = KEGKA EJACAH FH?AII E@ = IAJ B FA BEAI E@ANA@ >O BEA @AI?HEFJH =@ =
      ?KHHAJ MHEC @EHA?JHO ?D=CA@ >O chdir 
      -=?D FH?AII D=I = IAJ B =JJHE>KJAI   AHO FA BEAI =A IF=?A AJ?        JD=J =O >A ID=HA@
      H KEGKA .=CI J rfork ?JH JDA ID=HEC B JDAIA =JJHE>KJAI
      6DA AHO B = FH?AII EI @ELE@A@ EJ segments -LAHO FHCH= D=I =J A=IJ = text EIJHK?JE
      =@ stack IACAJ IJ =I D=LA = EEJE=EA@ data IACAJ =@ = IACAJ B AHBEA@ @=J=
      ?=A@ bss 2H?AIIAI =O segattach  JDAH IACAJI BH IFA?E= FKHFIAI




                                                     %
164                                                                                           164 



       ) FH?AII JAHE=JAI >O ?=EC exits  ) F=HAJ FH?AII =O ?= wait  J M=EJ BH IA ?DE@ J
       JAHE=JA ) IJHEC B IJ=JKI EBH=JE =O >A F=IIA@ BH exits J wait ) FH?AII ?= C J
       IAAF BH = IFA?EBEA@ JEA >O ?=EC sleep 
       6DAHA EI = notification A?D=EI BH JAEC = FH?AII =>KJ ALAJI IK?D =I =@@HAII B=KJI B=J
       EC FEJ B=KJI =@ AII=CAI BH JDAH FH?AIIAI ) FH?AII KIAI notify  J HACEIJAH JDA BK?
       JE J >A ?=A@ JDA notification handler MDA IK?D ALAJI ??KH
   Multithreading
       *O ?=EC rfork MEJD JDA RFMEM >EJ IAJ = FHCH= =O ?HA=JA IALAH= E@AFA@AJO ANA?KJEC
       FH?AIIAI ID=HEC JDA I=A AHO AN?AFJ BH JDA IJ=? IACAJ MDE?D EI KEGKA J A=?D FH
       ?AII 9DAHA FIIE>A =??H@EC J JDA )51 + IJ=@=H@ JDA =E + E>H=HO MHI FHFAHO E K
       JEFH?AII FHCH=I malloc print =@ JDA JDAH HKJEAI KIA ?I IAA lock  J IO?DHEA
       =??AII J JDAEH @=J= IJHK?JKHAI 6DA CH=FDE?I E>H=HO @ABEA@ E <draw.h> EI =I KJEFH?AII
       ?=F=>A @AJ=EI =HA E graphics  1 CAAH= JDKCD KJEFH?AII FHCH=I IDK@ KIA IA
       BH B IO?DHE=JE J FHJA?J ID=HA@ @=J=
       6DA JDHA=@ E>H=HO @ABEA@ E <thread.h> FHLE@AI IKFFHJ BH KJEFH?AII FHCH=I 1J
       E?K@AI = @=J= IJHK?JKHA ?=A@ = Channel JD=J ?= >A KIA@ J IA@ AII=CAI >AJMAA FH
       ?AIIAI =@ ?HKJEAEA threads MDE?D A=>A KJEFA JDHA=@I B ?JH MEJDE = IECA FH
       ?AII 6DA JDHA=@I MEJDE = FH?AII =HA I?DA@KA@ >O JDA E>H=HO >KJ JDAHA EI  FHAAFJELA
       I?DA@KEC MEJDE = FH?AII JDHA=@ IMEJ?DEC ??KHI O =J ?KE?=JE H IO?DHE=JE
       FEJI
       IJ FHCH=I KIEC JDA JDHA=@ E>H=HO ?FHEIA KJEFA FH?AIIAI ?KE?=JEC LAH ?D=
       AI =@ MEJDE IA FH?AIIAI KJEFA JDHA=@I 5E?A 2= ' 1 ?=I =O >? = IOIJA ?=
       =O >? = JDA JDHA=@I E = FH?AII 6DAHABHA = FHCH= JD=J IDK@ J >? KANFA?JA@O
       ME KIA = FH?AII J IAHLA JDA 1 HAGKAIJ F=IIEC JDA HAIKJ J JDA =E FH?AIIAI LAH = ?D=A
       MDA JDA HAGKAIJ ?FAJAI .H AN=FAI B JDEI @AIEC IAA ioproc  H mouse 
SEE ALSO
      nm 2l 2c
DIAGNOSTICS
     =JD BK?JEI E libc HAJKH IFA?E= L=KAI MDA JDA BK?JE EI K@ABEA@ BH JDA CELA =HCKAJI
     H MDA JDA L=KA EI J HAFHAIAJ=>A IAA nan 
       5A B JDA BK?JEI E libc =HA IOIJA ?=I =@ =O JDAHI AFO IOIJA ?=I E JDAEH EFA
       AJ=JE ) IOIJA ?=I HAJKH EJACAHI MEJD  E@E?=JEC JD=J = AHHH ??KHHA@ errstr 
       HA?LAHI = IJHEC @AI?HE>EC JDA AHHH 5A KIAHALA E>H=HO BK?JEI =I KIA JDA errstr A?D=
       EI J HAFHJ AHHHI .K?JEI JD=J =O =BBA?J JDA L=KA B JDA AHHH IJHEC =HA I=E@ J IAJ
       errstr  EJ EI K@AHIJ@ JD=J JDA AHHH IJHEC EI =JAHA@ O EB = AHHH ??KHI




                                                     %
'2                                                                                               '2 




NAME
        5HL @EHHA=@'F A=?'F AHA=?'F AIJH@KF'F EIJAIHL FIJB@ FIJKJIHL HA=@>KB HA=@
        IJH HAIF@ HAIF@AHHH JDHA=@EIJAIHL JDHA=@FIJKJIHL IHL '2 BEA IAHLE?A
SYNOPSIS
     #include       <u.h>
     #include       <libc.h>
     #include       <fcall.h>
     #include       <thread.h>
     #include       <9p.h>
        typedef struct Srv {
            Tree* tree;

             void     (*attach)(Req *r);
             void     (*auth)(Req *r);
             void     (*open)(Req *r);
             void     (*create)(Req *r);
             void     (*read)(Req *r);
             void     (*write)(Req *r);
             void     (*remove)(Req *r);
             void     (*flush)(Req *r);
             void     (*stat)(Req *r);
             void     (*wstat)(Req *r);
             void     (*walk)(Req *r);

             char* (*walk1)(Fid *fid, char *name, Qid *qid);
             char* (*clone)(Fid *oldfid, Fid *newfid);

             void     (*destroyfid)(Fid *fid);
             void     (*destroyreq)(Req *r);
             void     (*end)(Srv *s);
             void*    aux;

            int       infd;
            int       outfd;
            int       srvfd;
            int       nopipe;
        } Srv;
        int   srv(Srv *s)
        void postmountsrv(Srv *s, char *name, char *mtpt, int flag)
        void threadpostmountsrv(Srv *s, char *name, char *mtpt, int flag)
        void listensrv(Srv *s, char *addr)
        void threadlistensrv(Srv *s, char *addr)
        int   postfd(char *srvname, int fd)
        void respond(Req *r, char *error)
        void responderror(Req*)
        void readstr(Req *r, char *src)
        void readbuf(Req *r, void *src, long nsrc)
        typedef int Dirgen(int n, Dir *dir, void *aux)
        void dirread9p(Req *r, Dirgen *gen, void *aux)
        void walkandclone(Req *r, char *(*walk1)(Fid *old, char *name, void *v),
                  char *(*clone)(Fid *old, Fid *new, void *v), void *v)
        void* emalloc9p(ulong n)
        void* erealloc9p(void *v, ulong n)
        char* estrdup9p(char *s)
        extern int chatty9p;




                                                    %!
'2                                                                                                    '2 



DESCRIPTION
      6DA BK?JE srv IAHLAI = '2 IAIIE >O HA=@EC HAGKAIJI BH s−>infd @EIF=J?DEC JDA J JDA
      BK?JE FEJAHI AFJ E Srv =@ MHEJEC JDA HAIFIAI J s−>outfd 6OFE?=O postmountsrv
      H threadpostmountsrv EEJE=EAI JDA infd =@ outfd IJHK?JKHA A>AHI 5AA JDA @AI?HEFJE
      >AM
        Req =@ Fid IJHK?JKHAI =HA =?=JA@ AJA MEJD K?FAJA@ HAGKAIJI =@ =?JELA BE@I =@
        =HA @AI?HE>A@ E 9pfid 
        6DA >AD=LEH B srv @AFA@I  MDAJDAH JDAHA EI = BEA JHAA IAA 9pfile  =II?E=JA@ MEJD JDA
        IAHLAH JD=J EI MDAJDAH JDA tree AAAJ EI AH 6DA @EBBAHA?AI =HA =@A ANFE?EJ E JDA @EI
        ?KIIE B JDA IAHLE?A F >AM 6DA aux AAAJ EI JDA ?EAJ I J @ MEJD =I EJ FA=IAI
        Srv @AI J HAJKH KJE JDA '2 ?LAHI=JE EI BEEIDA@ 5E?A EJ EI KIK=O HK E = IAF=H=JA FH
        ?AII I JD=J JDA ?=AH ?= ANEJ JDA IAHLE?A F D=I EJJA ?D=?A J HAJKH CH=?ABKO  KJ B
        AHO AHHHI 1J ?=I emalloc9p erealloc9p =@ estrdup9p J >J=E EJI AHO 6DA @AB=KJ
        EFAAJ=JEI B JDAIA BK?JEI =?J =I malloc realloc =@ strdup >KJ =>HJ JDA FHCH= EB
        JDAO HK KJ B AHO 1B =JAH=JA >AD=LEH EI @AIEHA@ ?EAJI ?= E =C=EIJ =JAH=JA EFA
        AJ=JEI B JDAIA BK?JEI
        Postmountsrv =@ threadpostmountsrv =HA MH=FFAHI JD=J ?HA=JA = IAF=H=JA FH?AII E MDE?D J HK
        srv 6DAO @ JDA BMEC
               1B s−>nopipe EI AH JDA ? ?=IA EEJE=EA s−>infd =@ s−>outfd J >A A A@ B
               = BHAIDO =?=JA@ FEFA MEJD s−>srvfd EEJE=EA@ =I JDA JDAH A@
               1B name EI E ?= postfd(s−>srvfd, name) J FIJ s−>srvfd =I /srv/name.
               .H = ?DE@ FH?AII LE= rfork IAA fork  H procrfork IAA thread  KIEC JDA RFFDG
               RFNAMEG =@ RFMEM B=CI 6DA ?DE@ FH?AII ?=I close(s−>srvfd) =@ JDA srv(s) EJ
               ME ANEJ ?A srv HAJKHI
               1B mtpt EI E ?= amount(s−>srvfd, mtpt, flag, "") JDAHMEIA ?IA s−>srvfd
               6DA F=HAJ HAJKHI J JDA ?=AH
        1B =O AHHH ??KHI @KHEC JDEI FH?AII JDA AJEHA FH?AII EI JAHE=JA@ >O ?=EC sysfatal IAA
        perror 
        Listensrv =@ threadlistensrv ?HA=JA = IAF=H=JA FH?AII J =K?A =I addr 6DA FH?AII EIJAI
        BH E?EC ?A?JEI ?HA=JEC = AM FH?AII J IAHLA A=?D 7IEC JDAIA BK?JEI HAIKJI E
        srv =@ JDA IAHLE?A BK?JEI >AEC HK E KJEFA FH?AIIAI IEKJ=AKIO 6DA E>H=HO ?I EJI
        M @=J= IJHK?JKHAI =I A?AII=HO JDA ?EAJ =O AA@ J ? @=J= EJ ID=HAI >AJMAA JDA KJEFA
        ?A?JEI
  Service functions
      6DA BK?JEI E = Srv IJHK?JKHA =A@ =BJAH '2 JH=I=?JEI =HA ?=A@ J I=JEIBO HAGKAIJI =I JDAO
      =HHELA 1B = BK?JE EI FHLE@A@ EJ must =HH=CA BH respond J >A ?=A@ MDA JDA HAGKAIJ EI I=JEI
      BEA@ 6DA O F=H=AJAH B A=?D IAHLE?A BK?JE EI = Req* F=H=AJAH I=O r 6DA E?EC
      HAGKAIJ F=H=AJAHI =HA IJHA@ E r−>ifcall r−>fid =@ r−>newfid =HA FEJAHI J Fid IJHK?JKHAI
      ?HHAIF@EC J JDA KAHE? BE@I E r−>ifcall IEE=HO r−>oldreq EI JDA Req IJHK?JKHA ?HHA
      IF@EC J r−>ifcall.oldtag 6DA KJCEC HAIFIA @=J= IDK@ >A IJHA@ E r−>ofcall 6DA
      A AN?AFJE J JDEI HKA EI JD=J stat IDK@ BE E r−>d H=JDAH JD= r−>ofcall.stat JDA E>H=HO ME
      ?LAHJ JDA IJHK?JKHA EJ JDA =?DEAE@AFA@AJ MEHA HAFHAIAJ=JE 5EE=HO wstat =O ?
      IKJ r−>d H=JDAH JD= @A?@EC r−>ifcall.stat EJIAB 9DA = HAGKAIJ D=I >AA D=@A@ respond
      IDK@ >A ?=A@ MEJD r =@ = AHHH IJHEC 1B JDA HAGKAIJ M=I I=JEIBEA@ IK??AIIBKO JDA AHHH
      IJHEC IDK@ >A = E FEJAH JA JD=J EJ EI FAHEIIE>A BH = BK?JE J HAJKH MEJDKJ EJIAB ?=
      EC respond =I C =I EJ D=I =HH=CA@ BH respond J >A ?=A@ =J IA FEJ E JDA BKJKHA >O
      =JDAH FH? ID=HEC EJI =@@HAII IF=?A >KJ IAA JDA @EI?KIIE B flush >AM ?A respond D=I
      >AA ?=A@ JDA Req* =I MA =I =O FEJAHI EJ ?A ?J=EA@ KIJ >A ?IE@AHA@ BHAA@ =@ J
      HABAHA?A@
        Responderror ?=I respond MEJD JDA IOIJA AHHH IJHEC IAA errstr 
        1B JDA IAHLE?A F @AJA?JI = AHHH E = HAGKAIJ AC = =JJAFJ J HAKIA = ANJ=J BE@ = FA B
        = =HA=@O FA BE@ = HA=@ BH = BE@ FAA@ BH MHEJA AJ? EJ ME HAFO MEJD = AHHH MEJDKJ ?
        IKJEC JDA IAHLE?A BK?JEI




                                                      %"
'2                                                                                                      '2 



        6DA IAHLE?A F FHLE@A@ >O srv =@ E@EHA?JO >O postmountsrv =@ threadpostmountsrv EI
        IECAJDHA=@A@ 1B EJ EI ANFA?JA@ JD=J IA HAGKAIJI ECDJ >? =HH=CEC BH =JAH=JA FH
        ?AIIAI J D=@A JDA EI IKCCAIJA@
        6DA ?IJH=EJI  JDA IAHLE?A BK?JEI =HA =I BMI 6DAIA ?IJH=EJI =HA ?DA?A@ MDEA JDA
        IAHLAH ANA?KJAI 1B = IAHLE?A BK?JE B=EI J @ IAJDEC EJ KCDJ J D=LA srv ME ?= endsrv
        =@ JDA =>HJ
        Auth   1B =KJDAJE?=JE EI @AIEHA@ JDA auth BK?JE IDK@ HA?H@ JD=J r−>afid EI JDA AM
               =KJDAJE?=JE BE@ =@ IAJ r−>afid−>qid =@ ofcall.qid Auth =O >A E E MDE?D ?=IA EJ
               ME >A JHA=JA@ =I D=LEC HAIF@A@ MEJD JDA AHHH argv0: authentication not required
               MDAHA argv0 EI JDA FHCH= =A L=HE=>A =I IAJ >O ARGBEGIN IAA arg 
        Attach 6DA attach BK?JE IDK@ ?DA? JDA =KJDAJE?=JE IJ=JA B afid EB @AIEHA@ =@ IAJ
               r−>fid−>qid =@ ofcall.qid J JDA GE@ B JDA BEA IOIJA HJ Attach =O >A E O EB BEA
               JHAAI =HA E KIA E JDEI ?=IA JDA GE@ ME >A BEA@ BH JDA HJ B JDA JHAA =@  =KJDAJE
               ?=JE ME >A @A
        Walk   1B BEA JHAAI =HA E KIA walk EI D=@A@ EJAH=O =@ srv−>walk EI ALAH ?=A@
               1B BEA JHAAI =HA J E KIA walk IDK@ ?IKJ r−>ifcall.wname =@ r−>ifcall.nwname
               BEEC E ofcall.qid =@ ofcall.nqid =@ =I ?FOEC =O A?AII=HO aux IJ=JA BH r−>fid
               J r−>newfid MDA JDA JM =HA @EBBAHAJ )I C =I walk IAJI ofcall.nqid =FFHFHE=JAO EJ
               ?= respond MEJD = E AHHH IJHEC ALA MDA '2 @A=@I = AHHH e.g. E JDA ?=IA B =
               IDHJ M= JDA E>H=HO @AJA?JI AHHH ?@EJEI =@ D=@AI JDA =FFHFHE=JAO
               *A?=KIA EFAAJEC JDA BK M= AII=CA EI EJHE?=JA =@ FHA J AHHH JDA DAFAH HK
               JEA walkandclone ME D=@A JDA HAGKAIJ CELA FEJAHI J JM BK?JEI walk1 =@
               FJE=O clone . Clone EB E EI ?=A@ J IEC= JDA ?HA=JE B newfid BH oldfid
               6OFE?=O = clone HKJEA ME ?FO H E?HAAJ = HABAHA?A ?KJ E oldfid I aux AAAJ
               Walk1 IDK@ M= fid J name EEJE=EEC fid−>qid J JDA AM F=JD I GE@ *JD IDK@
               HAJKH E  IK??AII H = AHHH AII=CA  AHHH Walkandclone ME ?= respond =BJAH
               D=@EC JDA HAGKAIJ
        Walk1 Clone
               1B JDA ?EAJ FHLE@AI BK?JEI srv−>walk1 =@ FJE=O srv−>clone JDA '2 IAHLE?A
               F ME ?= walkandclone MEJD JDAIA BK?JEI J D=@A JDA HAGKAIJ 7EA JDA walk1
               =>LA srv−>walk1 KIJ BE E >JD fid−>qid =@ *qid MEJD JDA AM GE@  = IK??AIIBK
               M=
        Open   1B BEA JHAAI =HA E KIA JDA BEA AJ=@=J= ME >A ?IKJA@  FA ?HA=JA HALA =@
               MIJ=J J IAA EB JDA HAGKAIJAH D=I JDA =FFHFHE=JA FAHEIIEI 1B J = AHHH ME >A IAJ
               >=? MEJDKJ ?IKJEC = IAHLE?A BK?JE
               1B J KIEC BEA JHAAI H JDA KIAH D=I JDA =FFHFHE=JA FAHEIIEI open EI ?=A@ MEJD
               r−>ofcall.qid =HA=@O EEJE=EA@ J JDA A IJHA@ E JDA Fid IJHK?JKHA JD=J EI JDA A
               HAJKHA@ E JDA FHALEKI M= 1B JDA GE@ ?D=CAI >JD IDK@ >A KF@=JA@
        Create 6DA create BK?JE KIJ BE E >JD r−>fid−>qid =@ r−>ofcall.qid  IK??AII 9DA
               KIEC BEA JHAAI create IDK@ =?=JA = AM File MEJD createfile JA JD=J createfile =O
               HAJKH E >A?=KIA I=O JDA BEA =HA=@O ANEIJI 1B JDA create BK?JE EI E srv >AD=LAI =I
               JDKCD EJ MAHA = BK?JE JD=J =M=OI HAIF@A@ MEJD JDA AHHH ?HA=JA FHDE>EJA@ 
        Remove
              Remove IDK@ =H JDA BEA =I HALA@ MDAJDAH >O ?=EC removefile MDA KIEC BEA
              JHAAI H >O KF@=JEC = EJAH= @=J= IJHK?JKHA 1 CAAH= EJ EI J = C@ E@A= J ?A= KF
              JDA aux EBH=JE =II?E=JA@ MEJD JDA ?HHAIF@EC File =J JDEI JEA J =LE@ AHO
              AHHHI EB JDAH BE@I D=LA HABAHA?AI J JD=J BEA 1IJA=@ EJ EI IKCCAIJA@ JD=J remove IEFO
              =H JDA BEA =I HALA@ I JD=J BKHJDAH FAH=JEI  EJ M J B=E =@ M=EJ KJE JDA BEA
              JHAA I @AIJHO BK?JE EI ?=A@ J HA?=E JDA aux FEJAH 1B J KIEC BEA JHAAI EJ EI FHK
              @AJ J J=A JDA ==CKI A=IKHAI 1B remove EI J FHLE@A@ = HALA HAGKAIJI ME
              @H=M HALA FHDE>EJA@ AHHHI
        Read   6DA read BK?JE KIJ >A FHLE@A@ EJ BEI r−>ofcall.data MEJD =J IJ r−>ifcall.count
               >OJAI B @=J= BH BBIAJ r−>ifcall.offset B JDA BEA 1J =I IAJI r−>ofcall.count J JDA
               K>AH B >OJAI >AEC HAJKHA@ 1B KIEC BEA JHAAI srv ME D=@A HA=@I B @EHA?JHEAI
               EJAH=O O ?=EC read BH HAGKAIJI  BEAI Readstr =@ readbuf =HA KIABK BH


                                                       %#
'2                                                                                                       '2 



                I=JEIBOEC HA=@ HAGKAIJI  = IJHEC H >KBBAH +IKJEC JDA HAGKAIJ E r−>ifcall JDAO BE
                r−>ofcall.data =@ IAJ r−>ofcall.count JDAO @ J ?= respond. 5EE=HO dirread9p
                ?= >A KIA@ J D=@A @EHA?JHO HA=@I E IAHLAHI J KIEC BEA JHAAI 6DA F=IIA@ gen BK?
                JE ME >A ?=A@ =I A?AII=HO J BE dir MEJD EBH=JE BH JDA nJD AJHO E JDA @EHA?JHO
                6DA IJHEC FEJAHI F=?A@ E dir IDK@ >A BHAID ?FEAI =@A MEJD estrdup9p JDAO ME >A
                BHAA@ >O dirread9p =BJAH A=?D IK??AIIBK ?= J gen Gen IDK@ HAJKH AH EB EJ IK??AII
                BKO BEA@ dir EKI A  A@ B @EHA?JHO
        Write   6DA write BK?JE EI IEE=H >KJ AA@ J >A FHLE@A@ 1B EJ EI J = MHEJAI ME @H=M
                 MHEJA FHDE>EJA@ AHHHI JDAHMEIA write IDK@ =JJAFJ J MHEJA JDA r−>ifcall.count
                >OJAI B r−>ifcall.data J BBIAJ r−>ifcall.offset B JDA BEA IAJJEC r−>ofcall.count J
                JDA K>AH B >OJAI =?JK=O MHEJJA IJ FHCH=I ?IE@AH EJ = AHHH J MHEJA AII JD=
                JDA HAGKAIJA@ =KJ
        Stat    Stat IDK@ BE r−>d MEJD JDA IJ=J EBH=JE BH r−>fid 1B KIEC BEA JHAAI r−>d ME
                D=LA >AA EEJE=EA@ MEJD JDA IJ=J EB BH JDA JHAA =@ stat EJIAB =O >A E
        Wstat 6DA wstat ?IKJI r−>d E ?D=CEC JDA AJ=@=J= BH r−>fid =I @AI?HE>A@ E stat# 9DA
              KIEC BEA JHAAI srv ME J=A ?=HA J ?DA? JD=J JDA HAGKAIJ I=JEIBEAI JDA FAHEIIEI KJ
              EA@ E stat# JDAHMEIA wstat IDK@ J=A ?=HA J ABH?A FAHEIIEI MDAHA =FFHFHE
              =JA
        Flush   5AHLAHI JD=J =M=OI ?= respond >ABHA HAJKHEC BH JDA IAHLE?A BK?JEI AA@ J FH
                LE@A = flush EFAAJ=JE flush EI O A?AII=HO E FHCH=I JD=J =HH=CA BH respond
                J >A ?=A@ =IO?DHKIO Flush IDK@ ?=KIA JDA HAGKAIJ r−>oldreq J >A ?=?AA@ H
                DKHHEA@ =C 1B oldreq EI ?=?AA@ JDEI IDK@ >A IEC=A@ >O ?=EC respond  oldreq
                MEJD AHHH IJHEC interrupted  Flush KIJ HAIF@ J r MEJD = E AHHH IJHEC Flush
                =O HAIF@ J r >ABHA BH?EC = HAIFIA J r−>oldreq 1 JDEI ?=IA JDA E>H=HO ME
                @A=O IA@EC JDA Rflush AII=CA KJE JDA HAIFIA J r−>oldreq D=I >AA IAJ
        Destroyfid destroyreq =@ end =HA =KNEE=HO BK?JEI J ?=A@ E @EHA?J HAIFIA J '2
        HAGKAIJI
        Destroyfid
               9DA = Fid I HABAHA?A ?KJ @HFI J AH i.e., EJ D=I >AA ?KA@ =@ JDAHA =HA  KJ
               IJ=@EC HAGKAIJI HABAHHEC J EJ destroyfid EI ?=A@ J =M JDA FHCH= J @EIFIA B JDA
               fid−>aux FEJAH
        Destroyreq
               5EE=HO MDA = Req I HABAHA?A ?KJ @HFI J AH i.e. EJ D=I >AA D=@A@ LE= respond
               =@ JDAH KJIJ=@EC FEJAHI J EJ D=LA >AA ?IA@ destroyreq EI ?=A@ J =M JDA
               FHCH= J @EIFIA B JDA r−>aux FEJAH
        End     ?A JDA '2 IAHLE?A F D=I BEEIDA@ A@ B BEA >AA HA=?DA@  JDA IAHLE?A FEFA H = >=@
                AII=CA D=I >AA HA=@ end EI ?=A@ EB FHLE@A@ J =M =O BE= ?A=KF .H AN=FA
                EJ M=I KIA@ >O JDA 2= 2EJ IO?DHE=JE BEA IOIJA ALAH BEEIDA@ J CH=?ABKO JAH
                E=JA JDA IAHE= ?LAHI=JE ?A JDA BEA IOIJA D=@ >AA KKJA@ )BJAH ?=EC end
                JDA IAHLE?A F MDE?D HKI E = IAF=H=JA FH?AII BH EJI ?=AH JAHE=JAI KIEC _exits
                IAA exits 
        1B JDA chatty9p B=C EI =J A=IJ A = JH=I?HEFJ B JDA '2 IAIIE EI FHEJA@  IJ=@=H@ AHHH 1B
        JDA chatty9p B=C EI CHA=JAH JD= A =@@EJE= KIFA?EBEA@ @A>KCCEC KJFKJ EI CAAH=JA@ *O
        ?LAJE IAHLAHI MHEJJA KIEC JDEI E>H=HO =??AFJ JDA −D FJE J E?HAAJ chatty9p
EXAMPLES
     Archfs" cdfs" nntpfs" snap" =@ /sys/src/lib9p/ramfs.c =HA C@ AN=FAI B
     IEFA IECAJDHA=@A@ BEA IAHLAHI Webfs" =@ sshnet IAA ssh =HA C@ AN=FAI B KJE
     JDHA=@A@ BEA IAHLAHI
        1 CAAH= JDA File EJAHB=?A EI =FFHFHE=JA BH =EJ=EEC =H>EJH=HO BEA JHAAI =I E ramfs 6DA
        File EJAHB=?A EI >AIJ =LE@A@ MDA JDA JHAA IJHK?JKHA EI A=IEO CAAH=JA@ =I A?AII=HO JDEI EI
        JHKA MDA JDA JHAA EI DECDO IJHK?JKHA@ =I E cdfs =@ nntpfs H EI =EJ=EA@ AIAMDAHA
SOURCE
     /sys/src/lib9p




                                                        %$
'2                                                                                           '2 



SEE ALSO
      9pfid  9pfile  srv! intro#
BUGS
        6DA IMEJ?D J '2  M=I J=A =I = FFHJKEJO J JE@O K?D B JDA EJAHB=?A MA FHEIA J
        =LE@ IK?D CH=JKEJKI ?D=CA E JDA BKJKHA




                                                  %%
'2+,*7.                                                                                 '2+,*7. 




NAME
       +@>KB F=HIA?@ HAIF@?@AHHH KF?@       ?JH AII=CA F=HIEC
SYNOPSIS
     #include       <u.h>
     #include       <libc.h>
     #include       <fcall.h>
     #include       <thread.h>
     #include       <9p.h>
       typedef struct Cmdbuf
       {
           char    *buf;
           char    **f;
           int     nf;
       } Cmdbuf;

       typedef struct Cmdtab
       {
           int     index;
           char    *cmd;
           int     narg;
       };

       Cmdbuf           *parsecmd(char *p, int n)
       Cmdtab           *lookupcmd(Cmdbuf *cb, Cmdtab *tab, int ntab)
       void             respondcmderror(Req *r, Cmdbuf *cb, char *fmt, ...)
DESCRIPTION
      6DAIA @=J= IJHK?JKHAI =@ BK?JEI FHLE@A F=HIEC B JANJK= ?JH AII=CAI
       Parsecmd JHA=JI JDA n >OJAI =J p MDE?D AA@ J >A 7JAHE=JA@ =I = 76. IJHEC =@ IFEJI EJ
       KIEC tokenize IAA getfields  1J HAJKHI = Cmdbuf IJHK?JKHA D@EC FEJAHI J A=?D BEA@ E
       JDA AII=CA 1J EI JDA ?=AH I HAIFIE>EEJO J BHAA JDEI IJHK?JKHA MDA EJ EI  CAH AA@A@
       Lookupcmd M=I JDHKCD JDA =HH=O ctab MDE?D D=I ntab AJHEAI EC BH JDA BEHIJ Cmdtab
       JD=J =J?DAI JDA F=HIA@ ?=@ 1B JDA F=HIA@ ?=@ EI AFJO lookupcmd HAJKHI E
       EA@E=JAO ) Cmdtab =J?DAI JDA ?=@ EB cmd EI AGK= J cb−>f[0] H EB cmd EI *
       ?A = =J?DEC Cmdtab D=I >AA BK@ EB narg EI J AH JDA JDA F=HIA@ ?=@ KIJ
       D=LA AN=?JO narg BEA@I E?K@EC JDA ?=@ IJHEC EJIAB 1B JDA ?=@ D=I JDA MHC
       K>AH B =HCKAJI lookupcmd HAJKHI E JDAHMEIA EJ HAJKHI = FEJAH J JDA Cmdtab
       AJHO 1B lookupcmd @AI J BE@ = =J?DEC ?=@ =J = EJ HAJKHI E 9DAALAH lookupcmd
       HAJKHI E EJ IAJI JDA IOIJA AHHH IJHEC
       Respondcmderror HAIF@I J HAGKAIJ r MEJD = AHHH B JDA BH fmt: cmd MDAHA fmt EI JDA
       BH=JJA@ IJHEC =@ cmd EI = HA?IJHK?JE B JDA F=HIA@ ?=@ .J EI BJA IEFO %r .
EXAMPLES
     6DEI EJAHB=?A EI J KIA@ E =O @EIJHE>KJA@ '2 IAHLAHI 1J M=I EBJA@ BH JDA 2= ' AHA
     )IJ =O AHA @HELAH /sys/src/9/*/dev*.c EI = C@ AN=FA
SOURCE
     /sys/src/lib9p/parse.c
SEE ALSO
      9p 




                                                   %&
'2.1,                                                                                         '2.1, 




NAME
       .E@ .E@F =?BE@F BHAABE@F =?BE@ ?IABE@ KFBE@ HALABE@ 4AG 4AGF
       =?HAGF BHAAHAGF =?HAG ?IAHAG KFHAG HALAHAG '2 BE@ HAGKAIJ JH=?EC
SYNOPSIS
     #include       <u.h>
     #include       <libc.h>
     #include       <fcall.h>
     #include       <thread.h>
     #include       <9p.h>
       typedef struct Fid
       {
           ulong fid;
           char omode; /* −1 if not open */
           char *uid;
           Qid   qid;
           File *file;
           void *aux;
           ...
       } Fid;
       typedef struct Req
       {
           ulong tag;
           Fcall ifcall;
           Fcall ofcall;
           Req   *oldreq;
           void *aux;
           Fid   *fid;
           Fid   *afid;
           Fid   *newfid;
           ...
       } Req;
       Fidpool*     allocfidpool(void (*destroy)(Fid*))
       void         freefidpool(Fidpool *p)
       Fid*         allocfid(Fidpool *p, ulong fid)
       Fid*         lookupfid(Fidpool *p, ulong fid)
       Fid*         removefid(Fidpool *p, ulong fid);
       void         closefid(Fid *f)
       Reqpool*     allocreqpool(void (*destroy)(Req*))
       void         freereqpool(Reqpool *p)
       Req*         allocreq(Reqpool *p, ulong tag)
       Req*         lookupreq(Reqpool *p, ulong tag)
       Req*         removereq(Reqpool *p, ulong tag);
       void         closereq(Req *f)
DESCRIPTION
      6DAIA HKJEAI FHLE@A ==CAAJ B Fid =@ Req IJHK?JKHAI BH FidpoolI =@ ReqpoolI
      6DAO =HA FHE=HEO KIA@ >O JDA '2 IAHLAH F @AI?HE>A@ E 9p 
       Fid IJHK?JKHAI =HA EJA@A@ J HAFHAIAJ =?JELA BE@I E = '2 ?A?JE =I Chan IJHK?JKHAI @ E
       JDA 2= ' AHA 6DA fid AAAJ EI JDA EJACAH BE@ KIA@ E JDA '2 ?A?JE Omode EI JDA
       @A K@AH MDE?D JDA BE@ M=I FAA@ H −1 EB JDEI BE@ D=I J >AA FAA@ OAJ JA JD=J E
       =@@EJE J JDA L=KAI OREAD OWRITE =@ ORDWR omode ?= ?J=E JDA L=HEKI B=CI FAHEI
       IE>A E = FA ?= 6 ECHA JDA B=CI KIA omode&OMASK Omode IDK@ J >A ?D=CA@ >O
       JDA ?EAJ 6DA BE@ @AHELAI BH = IK??AIIBK =KJDAJE?=JE >O uid Qid ?J=EI JDA GE@
       HAJKHA@ E JDA =IJ IK??AIIBK walk H create JH=I=?JE ELLEC JDA BE@ 1 = BEA JHAA>=IA@
       IAHLAH JDA Fid I file AAAJ FEJI =J = File IJHK?JKHA IAA 9pfile  ?HHAIF@EC J JDA
       BE@ 6DA aux A>AH EI EJA@A@ BH KIA >O JDA ?EAJ J D@ EBH=JE IFA?EBE? J = F=HJE?K=H



                                                   %'
'2.1,                                                                                         '2.1, 



       Fid 9EJD JDA AN?AFJE B aux JDAIA AAAJI IDK@ >A JHA=JA@ =I HA=@O >O JDA ?EAJ
       Allocfidpool ?HA=JAI = AM Fidpool Freefidpool @AIJHOI IK?D = F Allocfid HAJKHI = AM
       Fid MDIA BE@ K>AH EI fid 6DAHA KIJ J =HA=@O >A = ANJ=J Fid MEJD JD=J K>AH E JDA
       F ?A = Fid D=I >AA =?=JA@ EJ ?= >A A@ KF >O BE@ K>AH KIEC lookupfid FidI
       =HA HABAHA?A ?KJA@ >JD allocfid =@ lookupfid E?HAAJ JDA HABAHA?A ?KJ  JDA Fid IJHK?
       JKHA >ABHA HAJKHEC 9DA = HABAHA?A J = Fid EI  CAH AA@A@ closefid IDK@ >A ?=A@ J
       JA JDA @AIJHK?JE B JDA HABAHA?A 9DA JDA =IJ HABAHA?A J = Fid EI HALA@ EB destroy
       IKFFEA@ MDA ?HA=JEC JDA BE@ F EI J AH EJ EI ?=A@ MEJD JDA Fid =I = F=H=AJAH 1J
       IDK@ FAHBH MD=JALAH ?A=KF EI A?AII=HO HAC=H@EC JDA aux AAAJ Removefid EI AGKEL=
       AJ J lookupfid >KJ =I HALAI JDA Fid BH JDA F JA JD=J @KA J ECAHEC HABAHA?AI
       JDA HAJKH B removefid =O J A= JD=J destroy D=I >AA ?=A@
       Allocreqpool freereqpool allocreq lookupreq closereq =@ removereq =HA ==CKI >KJ FAH=JA
        ReqpoolI =@ Req IJHK?JKHAI
SOURCE
     /sys/src/lib9p
SEE ALSO
      9p  9pfile 




                                                   &
'2.1-                                                                                             '2.1- 




NAME
       6HAA =?JHAA BHAAJHAA .EA ?HA=JABEA ?IABEA HALABEA M=BEA FA@EHBEA HA=@@EHBEA
       ?IA@EHBEA D=IFAH EAHO BEA DEAH=H?DO
SYNOPSIS
     #include        <u.h>
     #include        <libc.h>
     #include        <fcall.h>
     #include        <thread.h>
     #include        <9p.h>
       typedef struct File
       {
            Ref;
            Dir;
            void*aux;
            ...
       } File;
       typedef struct Tree
       {
            File *root;
            ...
       } Tree;
       Tree*    alloctree(char *uid, char *gid, ulong mode,
                      void (*destroy)(File*))
       void     freetree(Tree *tree)
       File*    createfile(File *dir, char *name, char *uid,
                      ulong mode, void *aux)
       int      removefile(File *file)
       void     closefile(File *file)
       File*    walkfile(File *dir, char *path)
       Readdir* opendirfile(File *dir)
       long     readdirfile(Readdir *rdir, uchar *buf, long n)
       void     closedirfile(Readdir *rdir)
       int      hasperm(File *file, char *uid, int p)
DESCRIPTION
      FileI =@ TreeI FHLE@A = EAHO BEA DEAH=H?DO EJA@A@ BH KIA E '2 BEA IAHLAHI
       Alloctree ?HA=JAI = AM JHAA B BEAI =@ freetree @AIJHOI EJ 6DA HJ B JDA JHAA =I JDA root
       AAAJ E JDA IJHK?JKHA ME D=LA @A mode =@ >A MA@ >O KIAH uid =@ CHKF gid Destroy EI
       KIA@ MDA BHAAEC File IJHK?JKHAI =@ EI @AI?HE>A@ =JAH
       FileI E?K@EC @EHA?JHEAI JDAH JD= JDA HJ =HA ?HA=JA@ KIEC createfile MDE?D =JJAFJI J
       ?HA=JA = BEA =A@ name E JDA @EHA?JHO dir 1B ?HA=JA@ JDA BEA ME D=LA MAH uid =@ D=LA =
       CHKF EDAHEJA@ BH JDA @EHA?JHO Mode =@ JDA FAHEIIEI B dir =HA KIA@ J ?=?K=JA JDA FAH
       EIIE >EJI BH JDA BEA =I @AI?HE>A@ E open# 1J EI FAHEIIE>A BH name J >A = I=IDIAF=H=JA@
       F=JD H=JDAH JD= = IECA AAAJ
       Removefile HALAI = BEA BH JDA BEA JHAA 6DA BEA ME J >A BHAA@ KJE JDA =IJ HABAHA?A J EJ
       D=I >AA HALA@ ,EHA?JHEAI =O O >A HALA@ MDA AFJO Removefile HAJKHI AH 
       IK??AII   AHHH 1J EI ?HHA?J J ?IE@AH removefile J >A closefile MEJD JDA IE@A ABBA?J B
       HALEC JDA BEA MDA FIIE>A
       Walkfile AL=K=JAI path HA=JELA J JDA @EHA?JHO dir HAJKHEC JDA HAIKJEC BEA H AH EB JDA
       =A@ BEA H =O EJAHA@E=JA AAAJ @AI J ANEIJ
       6DA File IJHK?JKHA I aux FEJAH =O >A KIA@ >O JDA ?EAJ BH FAHFile IJH=CA FileI =HA
       HABAHA?A?KJA@ EB J AH destroy IFA?EBEA@ E JDA ?= J alloctree ME >A ?=A@ BH A=?D BEA
       MDA EJI =IJ HABAHA?A EI HALA@ H MDA JDA JHAA EI BHAA@ Destroy IDK@ J=A ?=HA B =O A?
       AII=HO ?A=KF HA=JA@ J aux 9DA ?HA=JEC AM BEA HABAHA?AI >O ?FOEC FEJAHI ?= incref
       IAA lock  J KF@=JA JDA HABAHA?A ?KJ 6 JA JDA HAL= B = HABAHA?A J = BEA ?=



                                                      &
'2.1-                                                                                           '2.1- 



       closefile Createfile =@ walkfile HAJKH AM HABAHA?AI Removefile closefile =@ walkfile >KJ J
       createfile ?IKA JDA F=IIA@ HABAHA?A
       ,EHA?JHEAI =O >A HA=@ OEA@EC = @EHA?JHO AJHO IJHK?JKHA IAA stat# BH A=?D BEA E JDA @EHA?
       JHO 1 H@AH J =M ??KHHAJ HA=@EC B @EHA?JHEAI ?EAJI KIJ >J=E = Readdir IJHK?JKHA
       >O ?=EC opendirfile  = @EHA?JHO 5K>IAGKAJ ?=I J readdirfile ME A=?D OEA@ = EJACH=
       K>AH B =?DEAE@AFA@AJ IJ=J >KBBAHI KJE A@ B @EHA?JHO 9DA BEEIDA@ ?=
       closedirfile J BHAA JDA Readdir
       Hasperm @AI IEFEIJE? FAHEIIE ?DA?EC EJ =IIKAI O AKIAH CHKFI =A@ >O KE@ =@
       HAJKHI AH EB uid D=I FAHEIIE p = >EJMEIAH B AREAD AWRITE =@ AEXEC =??H@EC
       J file−>mode '2 IAHLAHI MHEJJA KIEC File JHAAI ME @ IJ=@=H@ FAHEIIE ?DA?I =KJ=JE
       ?=O hasperm =O >A ?=A@ ANFE?EJO J @ =@@EJE= ?DA?I ) '2 IAHLAH =O E =C=EIJ = @EB
       BAHAJ hasperm EFAAJ=JE J FHLE@A HA ?FAN CHKFI
EXAMPLE
     6DA BMEC ?@A ?HHA?JO D=@AI HABAHA?AI MDA AAAJMEIA M=EC = F=JD =@ ?HA=JEC =
     BEA
              f = tree−>root;
              incref(f);
              for(i=0; i<n && f!=nil; i++)
                       f = walkfile(f, elem[i]);
              if(f == nil)
                       return nil;
              nf = createfile(f, "foo", "nls", 0666, nil);
              closefile(f);
              return nf;
SOURCE
     /sys/src/lib9p/file.c
SEE ALSO
      9p 
BUGS
       6DA HABAHA?A ?KJEC EI ?K>AHIA




                                                     &
)*46                                                                                     )*46 




NAME
       =>HJ   CAAH=JA = B=KJ
SYNOPSIS
     #include <u.h>
     #include <libc.h>
       void abort(void)
DESCRIPTION
      Abort ?=KIAI = =??AII B=KJ ?=KIEC JDA ?KHHAJ FH?AII J AJAH JDA *HA IJ=JA 6DA FH?AII
      ?= JDA >A EIFA?JA@ >O = @A>KCCAH
SOURCE
     /sys/src/libc/9sys/abort.c




                                                  &!
)*5                                                                                            )*5 




NAME
         =>I =>I   EJACAH =>IKJA L=KAI
SYNOPSIS
     #include <u.h>
     #include <libc.h>
         int    abs(int a)
         long labs(long a)
DESCRIPTION
      Abs HAJKHI JDA =>IKJA L=KA B EJACAH a =@ labs @AI JDA I=A BH = C
SOURCE
     /sys/src/libc/port/abs.c
SEE ALSO
      floor  BH fabs
DIAGNOSTICS
     Abs =@ labs HAJKH JDA IJ AC=JELA EJACAH H C MDA JDA JHKA HAIKJ EI KHAFHAIAJ=>A




                                                   &"
)++-55                                                                                      )++-55 




NAME
       =??AII   @AJAHEA =??AIIE>EEJO B BEA
SYNOPSIS
     #include <u.h>
     #include <libc.h>
       int access(char *name, int mode)
DESCRIPTION
      Access AL=K=JAI JDA CELA BEA name BH =??AIIE>EEJO 1B mode&4 EI AH HA=@ FAHEIIE EI
      ANFA?JA@ EB mode&2 MHEJA FAHEIIE EB mode&1 ANA?KJA FAHEIIE 1B mode==0 JDA BEA
      AHAO AA@ ANEIJ 1 =O ?=IA = @EHA?JHEAI A=@EC J JDA BEA KIJ FAHEJ IA=H?DAI AH EI
      HAJKHA@ EB JDA @AIEHA@ =??AII EI FAHEJJA@  EB J
       O =??AII BH FA EI ?DA?A@ ) BEA =O  ANA?KJ=>A >KJ exec  ME B=E KAII EJ EI E
       FHFAH BH=J
       6DA E?K@A BEA @ABEAI AEXIST AEXEC AWRITE  =@ AREAD"
SOURCE
     /sys/src/libc/9sys/access.c
SEE ALSO
      stat 
DIAGNOSTICS
     5AJI errstr
BUGS
       5E?A BEA FAHEIIEI =HA ?DA?A@ >O JDA IAHLAH =@ CHKF EBH=JE EI J M J JDA ?EAJ
       access KIJ FA JDA BEA J ?DA? FAHEIIEI 1J ?=I stat  J ?DA? IEFA ANEIJA?A




                                                   &#
),,26                                                                                            ),,26 




NAME
       =@@FJ IK>FJ KFJ @ELFJ HA?J=@@FJ HA?JIK>FJ EIAJHA?J ?=HA?J AGFJ AGHA?J FJEHA?J HA?JE
       HA?J HA?J:HA?J HA?J?EF ?>EAHA?J ,N ,O 2J 4A?J 4FJ =HEJDAJE?  FEJI =@ HA?J=CAI
SYNOPSIS
     #include <u.h>
     #include <libc.h>
     #include <draw.h>
       Point          addpt(Point p, Point q)
       Point          subpt(Point p, Point q)
       Point          mulpt(Point p, int a)
       Point          divpt(Point p, int a)
       Rectangle rectaddpt(Rectangle r, Point p)
       Rectangle rectsubpt(Rectangle r, Point p)
       Rectangle insetrect(Rectangle r, int n)
       Rectangle canonrect(Rectangle r)
       int            eqpt(Point p, Point q)
       int            eqrect(Rectangle r, Rectangle s)
       int            ptinrect(Point p, Rectangle r)
       int            rectinrect(Rectangle r, Rectangle s)
       int            rectXrect(Rectangle r, Rectangle s)
       int            rectclip(Rectangle *rp, Rectangle b)
       void           combinerect(Rectangle *rp, Rectangle b)
       int            Dx(Rectangle r)
       int            Dy(Rectangle r)
       Point          Pt(int x, int y)
       Rectangle Rect(int x0, int y0, int x1, int y1)
       Rectangle Rpt(Point p, Point q)
DESCRIPTION
      6DA BK?JEI Pt Rect =@ Rpt ?IJHK?J CAAJHE?= @=J= JOFAI BH JDAEH ?FAJI
       Addpt HAJKHI JDA 2EJ IK B EJI =HCKAJI Pt(p.x+q.x, p.y+q.y) Subpt HAJKHI JDA
       2EJ @EBBAHA?A B EJI =HCKAJI Pt(p.x−q.x, p.y−q.y) Mulpt HAJKHI JDA 2EJ
       Pt(p.x*a, p.y*a) Divpt HAJKHI JDA 2EJ Pt(p.x/a, p.y/a)
       Rectaddpt HAJKHI JDA 4A?J=CA Rect(add(r.min, p) add(r.max, p)) rectsubpt HAJKHI
       JDA 4A?J=CA Rpt(sub(r.min, p), sub(r.max, p))
       Insetrect HAJKHI JDA 4A?J=CA Rect(r.min.x+n r.min.y+n r.max.x−n r.max.y−n)
       Canonrect HAJKHI = HA?J=CA MEJD JDA I=A ANJAJ =I r ?=E?=EA@ I JD=J min.x          max.x
       =@ min.y max.y
       Eqpt ?F=HAI EJI =HCKAJ 2EJI =@ HAJKHI  EB KAGK=  EB AGK= Eqrect @AI JDA I=A BH
       EJI =HCKAJ 4A?J=CAI
       Ptinrect HAJKHI  EB p EI = FEJ MEJDE r =@  JDAHMEIA
       Rectinrect HAJKHI  EB = JDA FENAI E r =HA =I E s =@  JDAHMEIA
       RectXrect HAJKHI  EB r =@ s ID=HA =O FEJ =@  JDAHMEIA
       Rectclip ?EFI E F=?A JDA 4A?J=CA FEJA@ J >O rp I JD=J EJ EI ?FAJAO ?J=EA@ MEJDE b
       6DA HAJKH L=KA EI  EB =O F=HJ B rp EI MEJDE b JDAHMEIA JDA HAJKH L=KA EI  =@ rp EI
       K?D=CA@




                                                       &$
),,26                                                                                     ),,26 



      Combinerect LAHMHEJAI *rp MEJD JDA I=AIJ HA?J=CA IKBBE?EAJ J ?LAH = JDA FENAI B *rp
      =@ b
      6DA BK?JEI Dx =@ Dy CELA JDA ME@JD  N =@ DAECDJ  O B = 4A?J=CA 6DAO =HA EFAAJA@
      =I =?HI
SOURCE
     /sys/src/libdraw
SEE ALSO
      graphics 




                                                 &%
)-5                                                                                            )-5 




NAME
         IAJKF)-5IJ=JA =AI+*+A?HOFJ =AI+*+@A?HOFJ =AI+64A?HOFJ =AI+64@A?HOFJ IAJKF)-5:+*+
         IJ=JA =AI:+*+=?  =@L=?A@ A?HOFJE IJ=@=H@ HE@=A
SYNOPSIS
     #include        <u.h>
     #include        <libc.h>
     #include        <mp.h>
     #include        <libsec.h>
         void aes_encrypt(ulong rk[], int Nr, uchar pt[16], uchar ct[16]);
         void aes_decrypt(ulong rk[], int Nr, uchar ct[16], uchar pt[16]);
         void setupAESstate(AESstate            *s,     uchar   key[],     int   keybytes,      uchar
         *ivec)
         void aesCBCencrypt(uchar *p, int len, AESstate *s)
         void aesCBCdecrypt(uchar *p, int len, AESstate *s)
         void aesCTRencrypt(uchar *p, int len, AESstate *s)
         void aesCTRdecrypt(uchar *p, int len, AESstate *s)
         void setupAESXCBCstate(AESstate *s)
         void aesXCBCmac(uchar *p, int len, AESstate *s)
DESCRIPTION
      )-5 == 4E@=A D=I HAF=?A@ ,-5 =I JDA FHABAHHA@ >? ?EFDAH Aes_encrypt =@ aes_decrypt
      =HA JDA >? ?EFDAHI ?HHAIF@EC J des  I block_cipher SetupAESstate aesCBCencrypt =@
      aesCBCdecrypt EFAAJ ?EFDAH>??D=EEC A?HOFJE AesCTRencrypt =@ aesCTRdecrypt
      EFAAJ ?KJAH @A FAH 4.+ !$&$ JDAO =HA E@AJE?= FAH=JEI setupAESXCBCstate =@
      aesXCBCmac EFAAJ )-5 :+*+ AII=CA =KJDAJE?=JE FAH 4.+ !#$$ ) ?EFDAHEC EI FAH
      BHA@ E F=?A Keybytes IDK@ >A $ " H !  6DA EEJE=E=JE LA?JH ivec B AESbsize >OJAI
      IDK@ >A H=@ AKCD J >A KEAO J >A HAKIA@ >KJ @AI J AA@ J >A ?HOFJCH=FDE?=O
      IJHCO KFHA@E?J=>A
SOURCE
     /sys/src/libsec
SEE ALSO
      aescbc E secstore mp  blowfish  des  dsa  elgamal  rc4  rsa  sechash 
      prime  rand 
      http://csrc.nist.gov/publications/fips/fips197/fips−197.pdf
BUGS
         6DA BK?JEI aes_encrypt aes_decrypt aesCTRencrypt aesCTRdecrypt setupAESXCBCstate =@
         aesXCBCmac D=LA J OAJ >AA LAHEBEA@ >O HKEC JAIJ LA?JHI JDHKCD JDA




                                                   &&
)+1)/-                                                                         )+1)/- 




NAME
       =?E=CA =?E=CAEN BHAAE=CA =AE=CA =A@E=CA IAJ=FD= =@E=CA ?=@E
       =CA K=@E=CA HA=@E=CA MHEJAE=CA >OJAIFAHEA MH@IFAHEA =?=JEC BHAAEC HA=@
       EC MHEJEC E=CAI
SYNOPSIS
     #include <u.h>
     #include <libc.h>
     #include <draw.h>
       Image *allocimage(Display *d, Rectangle r,
             ulong chan, int repl, int col)
       Image *allocimagemix(Display *d, ulong one, ulong three)
       void     freeimage(Image *i)
       int      nameimage(Image *i, char *name, int in)
       Image *namedimage(Display *d, char *name)
       ulong setalpha(ulong color, uchar alpha)
       int      loadimage(Image *i, Rectangle r, uchar *data, int ndata)
       int      cloadimage(Image *i, Rectangle r, uchar *data, int ndata)
       int      unloadimage(Image *i, Rectangle r, uchar *data, int ndata)
       Image *readimage(Display *d, int fd, int dolock)
       int      writeimage(int fd, Image *i, int dolock)
       int      bytesperline(Rectangle r, int d)
       int      wordsperline(Rectangle r, int d)
       enum
       {
          DOpaque                                =    0xFFFFFFFF,
          DTransparent                           =    0x00000000,
          DBlack                                 =    0x000000FF,
          DWhite                                 =    0xFFFFFFFF,
          DRed                                   =    0xFF0000FF,
          DGreen                                 =    0x00FF00FF,
          DBlue                                  =    0x0000FFFF,
          DCyan                                  =    0x00FFFFFF,
          DMagenta                               =    0xFF00FFFF,
          DYellow                                =    0xFFFF00FF,
          DPaleyellow                            =    0xFFFFAAFF,
          DDarkyellow                            =    0xEEEE9EFF,
          DDarkgreen                             =    0x448844FF,
          DPalegreen                             =    0xAAFFAAFF,
          DMedgreen                              =    0x88CC88FF,
          DDarkblue                              =    0x000055FF,
          DPalebluegreen                         =    0xAAFFFFFF,
          DPaleblue                              =    0x0000BBFF,
          DBluegreen                             =    0x008888FF,
          DGreygreen                             =    0x55AAAAFF,
          DPalegreygreen                         =    0x9EEEEEFF,
          DYellowgreen                           =    0x99994CFF,
          DMedblue                               =    0x000099FF,
          DGreyblue                              =    0x005DBBFF,
          DPalegreyblue                          =    0x4993DDFF,
          DPurpleblue                            =    0x8888CCFF,

          DNotacolor                             = 0xFFFFFF00,



                                                 &'
)+1)/-                                                                                   )+1)/- 



            DNofill                                    = DNotacolor,

       };
DESCRIPTION
      ) AM Image  Display d EI =?=JA@ MEJD allocimage EJ ME D=LA JDA HA?J=CA FENA
      ?D=A BH=J =@ HAFE?=JE B=C CELA >O EJI =HCKAJI +LAEAJ FENA ?D=AI EA
      GREY1 GREY2 CMAP8 RGB16 RGB24 =@ RGBA32 =HA FHA@ABEA@ ) JDA AM E=CA I FEN
      AI ME D=LA EEJE= L=KA col 1B col EI DNofill  EEJE=E=JE EI @A 4AFHAIAJ=JELA KIABK
      L=KAI B ?H =HA FHA@ABEA@ DBlack DWhite DRed =@ I  +HI =HA IFA?EBEA@ >O ! 
      >EJ K>AHI ?FHEIEC BH IJ J A=IJ IECEBE?=J >OJA &>EJ L=KAI BH HA@ CHAA >KA =@
      =FD= 6DA L=KAI ?HHAIF@ J EKE=JE I  EI >=? =@ ## EI MDEJA 5EE=HO BH =FD= 
      EI JH=IF=HAJ =@ ## EI F=GKA 6DA id BEA@ ME D=LA >AA IAJ J JDA E@AJEBOEC K>AH KIA@
      >O /dev/draw IAA draw! =@ JDA cache BEA@ ME >A AH 1B repl EI JHKA JDA ?EF HA?J=CA EI
      IAJ J = LAHO =HCA HACE EB B=IA EJ EI IAJ J r 6DA depth BEA@ ME >A IAJ J JDA K>AH B >EJI FAH
      FENA IFA?EBEA@ >O JDA ?D=A @AI?HEFJH IAA image$ Allocimage HAJKHI  EB JDA IAHLAH D=I HK
      KJ B E=CA AHO
       Allocimagemix EI KIA@ J =?=JA >=?CHK@ ?HI  &>EJ ?H=FFA@ @EIF=OI EJ HAJKHI =
             HAFE?=JA@ E=CA MEJD A FENA ?HA@ JDA ?H one =@ JDA JDAH JDHAA MEJD three 6DEI
       IEK=JAI = ME@AH H=CA B JAI JD= ?= >A HAFHAIAJA@ >O = IECA FENA L=KA  = ?H
       =FFA@ @EIF=O  JHKA ?H @EIF=OI EJ HAJKHI =   HAFE?=JA@ E=CA MDIA FENA EI JDA
       HAIKJ B ENEC JDA JM ?HI E = A J JDHAA H=JE
       Freeimage BHAAI JDA HAIKH?AI KIA@ >O EJI =HCKAJ E=CA
       Nameimage FK>EIDAI E JDA IAHLAH JDA E=CA i K@AH JDA CELA name 1B in EI AH JDA E=CA
       EI FK>EIDA@ JDAHMEIA i KIJ >A =HA=@O =A@ name =@ EJ EI MEJD@H=M BH FK>E?=JE
       Namedimage HAJKHI = HABAHA?A J JDA E=CA FK>EIDA@ K@AH JDA CELA name  Display d
       6DAIA HKJEAI FAHEJ KHA=JA@ =FFE?=JEI ID=HEC = @EIF=O J ID=HA = E=CA BH AN=FA JDAO
       FHLE@A JDA A?D=EI >ADE@ getwindow IAA graphics 
       6DA 4/* L=KAI E = ?H =HA premultiplied >O JDA =FD= L=KA BH AN=FA = # HA@ EI
       0x7F00007F J 0xFF00007F 6DA BK?JE setalpha FAHBHI JDA =FD= ?FKJ=JE  =
       CELA color ECHEC EJI EEJE= =FD= L=KA KJEFOEC JDA ?FAJI >O JDA IKFFEA@ alpha
       .H AN=FA J =A = # HA@ ?H L=KA A ?K@ ANA?KJA setalpha(DRed, 0x7F)
       6DA HA=EEC BK?JEI @A= MEJD LEC CHKFI B FENA L=KAI >AJMAA E=CA =@ KIAH IF=?A H
       ANJAH= BEAI 6DAHA EI = BENA@ BH=J BH JDA AN?D=CA =@ IJH=CA B E=CA @=J= IAA image$
       Unloadimage HA=@I = HA?J=CA B FENAI BH E=CA i EJ data MDIA ACJD EI IFA?EBEA@ >O
       ndata 1J EI = AHHH EB ndata EI J I= J =??@=JA JDA FENAI
       Loadimage HAF=?AI JDA IFA?EBEA@ HA?J=CA E E=CA i MEJD JDA ndata >OJAI B data
       6DA FENAI =HA FHAIAJA@ A DHEJ= EA =J = JEA IJ=HJEC MEJD JDA JFABJ FENA B r 1 JDA
       @=J= FH?AIIA@ >O JDAIA HKJEAI A=?D I?= EA IJ=HJI MEJD = AM >OJA E JDA =HH=O A=LEC JDA
       =IJ >OJA B JDA FHALEKI EA F=HJE=O AFJO EB A?AII=HO 2ENAI =HA F=?A@ =I JECDJO =I FIIE>A
       MEJDE data HAC=H@AII B JDA HA?J=CA >AEC ANJH=?JA@ *OJAI =HA BEA@ BH IJ J A=IJ IECEBE
       ?=J >EJ H@AH =I JDA x ?H@E=JA E?HA=IAI =ECA@ I x MK@ =FFA=H =I JDA ABJIJ FENA B
       EJI >OJA 6DKI BH depth  JDA FENA =J x BBIAJ $# MEJDE JDA HA?J=CA ME >A E = data >OJA =J
       >EJFIEJE 0x04 HAC=H@AII B JDA LAH= HA?J=CA $# @ & AGK=I # =@ 0x80 >> 5
       AGK=I 0x04
       Cloadimage @AI JDA I=A =I loadimage >KJ BH ndata >OJAI B ?FHAIIA@ E=CA data IAA
       image$  A=?D ?= J cloadimage, JDA data KIJ >A =J JDA >ACEEC B = ?FHAIIA@ @=J=
       >? E F=HJE?K=H EJ IDK@ IJ=HJ MEJD JDA y ?H@E=JA =@ @=J= ACJD BH JDA >?
       Loadimage  cloadimage =@ unloadimage HAJKH JDA K>AH B >OJAI ?FEA@
       Readimage ?HA=JAI = E=CA BH @=J= ?J=EA@ E = ANJAH= BEA IAA image$ BH JDA BEA BH
       =J fd EI = BEA @AI?HEFJH >J=EA@ >O FAEC IK?D = BEA BH HA=@EC 6DA HAJKHA@ E=CA EI =
       ?=JA@ KIEC allocimage 6DA dolock B=C IFA?EBEAI MDAJDAH JDA Display IDK@ >A IO?DHEA@
       BH KJEJDHA=@A@ =??AII IECAJDHA=@A@ FHCH=I ?= A=LA EJ AH
       Writeimage MHEJAI E=CA i J BEA @AI?HEFJH fd MDE?D IDK@ >A FA BH MHEJEC 6DA BH=J EI
       =I @AI?HE>A@ BH readimage



                                                       '
)+1)/-                                                                            )+1)/- 



       Readimage =@ writeimage @ J ?IA fd
       Bytesperline =@ wordsperline HAJKH JDA K>AH B >OJAI H MH@I ??KFEA@ E AHO >O A
       I?= EA B HA?J=CA r E = E=CA MEJD d >EJI FAH FENA
EXAMPLE
     6 =?=JA = IECAFENA HAFE?=JA@ E=CA JD=J =O >A KIA@ J F=EJ = HACE HA@
         red = allocimage(display, Rect(0, 0, 1, 1), RGB24, 1, DRed);
SOURCE
     /sys/src/libdraw
SEE ALSO
      graphics  draw  draw! image$
DIAGNOSTICS
     6DAIA BK?JEI HAJKH FEJAH  H EJACAH   B=EKHA KIK=O @KA J EIKBBE?EAJ AHO
       =O IAJ errstr
BUGS
       Depth KIJ >A = @ELEIH H KJEFA B &




                                                   '
)4/                                                                                             )4/ 




NAME
         )4/*-/1 )4/-, )4/+ )4/. -)4/.       FH?AII FJE AJJAHI BH =HCL
SYNOPSIS
     #include <u.h>
     #include <libc.h>
         ARGBEGIN {
         char *ARGF();
         char *EARGF(code);
         Rune ARGC();
         } ARGEND
         extern char *argv0;
DESCRIPTION
      6DAIA =?HI =IIKA JDA =AI argc =@ argv =HA E I?FA IAA exec  ARGBEGIN =@ ARGEND
      IKHHK@ ?@A BH FH?AIIEC FHCH= FJEI 6DA ?@A IDK@ >A JDA ?=IAI B = + IMEJ?D 
      FJE ?D=H=?JAHI EJ EI ANA?KJA@ ?A BH A=?D FJE ?D=H=?JAH FJEI A@ =BJAH = =HCKAJ
      −− >ABHA = =HCKAJ − H >ABHA = =HCKAJ JD=J @AI J >ACE MEJD −
         6DA BK?JE =?H ARGC HAJKHI JDA ?KHHAJ FJE ?D=H=?JAH =I = EJACAH
         6DA BK?JE =?H ARGF HAJKHI JDA ?KHHAJ FJE =HCKAJ = FEJAH J JDA HAIJ B JDA FJE
         IJHEC EB J AFJO H JDA ANJ =HCKAJ E argv EB =O H  ARGF KIJ >A ?=A@ KIJ ?A BH
         A=?D FJE =HCKAJ 6DA =?H EARGF EI EA ARGF >KJ EIJA=@ B HAJKHEC AH HKI code =@
         EB JD=J HAJKHI ?=I abort  ) JOFE?= L=KA BH code EI usage() =I E EARGF(usage())
         )BJAH ARGBEGIN argv0 EI = ?FO B argv[0] ?LAJE=O JDA =A B JDA FHCH=
         )BJAH ARGEND argv FEJI =J = AHJAHE=JA@ EIJ B JDA HA=EEC argc =HCKAJI
EXAMPLE
     6DEI + FHCH= ?= J=A FJE b =@ FJE f MDE?D HAGKEHAI = =HCKAJ
                #include <u.h>
                #include <libc.h>
                void
                main(int argc, char *argv[])
                {
                        char *f;
                        print("%s", argv[0]);
                        ARGBEGIN {
                        case ’b’:
                                print(" −b");
                                break;
                        case ’f’:
                                print(" −f(%s)", (f=ARGF())? f: "no arg");
                                break;
                        default:
                                print(" badflag(’%c’)", ARGC());
                        } ARGEND
                        print(" %d args:", argc);
                        while(*argv)
                                print(" ’%s’", *argv++);
                        print("\n");
                        exits(nil);
                }
         0AHA EI JDA KJFKJ BH HKEC JDA ?=@ prog −bffile1 −r −f file2 arg1
         arg2
                prog −b −f(file1) badflag(’r’) −f(file2) 2 args: ’arg1’ ’arg2’
SOURCE
     /sys/include/libc.h



                                                     '
)4/                    )4/ 



SEE ALSO
      getflags&




                    '!
)4160!                                                                                   )4160! 




NAME
       =@@! IK>! AC! @EL! K! AGFJ! ?IAFJ! @J! ?HII! A! @EIJ! KEJ! E@FJ! AHF!
       HABA?J! A=HIAC! F@EIJ! L@EL! LHA! F B! FFF B! BBB F! F@EL" =@@" IK>" FAH=JEI
        !@ FEJI =@ F=AI
SYNOPSIS
     #include <draw.h>
     #include <geometry.h>
       Point3 add3(Point3 a, Point3 b)
       Point3 sub3(Point3 a, Point3 b)
       Point3 neg3(Point3 a)
       Point3 div3(Point3 a, double b)
       Point3 mul3(Point3 a, double b)
       int eqpt3(Point3 p, Point3 q)
       int closept3(Point3 p, Point3 q, double eps)
       double dot3(Point3 p, Point3 q)
       Point3 cross3(Point3 p, Point3 q)
       double len3(Point3 p)
       double dist3(Point3 p, Point3 q)
       Point3 unit3(Point3 p)
       Point3 midpt3(Point3 p, Point3 q)
       Point3 lerp3(Point3 p, Point3 q, double alpha)
       Point3 reflect3(Point3 p, Point3 p0, Point3 p1)
       Point3 nearseg3(Point3 p0, Point3 p1, Point3 testp)
       double pldist3(Point3 p, Point3 p0, Point3 p1)
       double vdiv3(Point3 a, Point3 b)
       Point3 vrem3(Point3 a, Point3 b)
       Point3 pn2f3(Point3 p, Point3 n)
       Point3 ppp2f3(Point3 p0, Point3 p1, Point3 p2)
       Point3 fff2p3(Point3 f0, Point3 f1, Point3 f2)
       Point3 pdiv4(Point3 a)
       Point3 add4(Point3 a, Point3 b)
       Point3 sub4(Point3 a, Point3 b)
DESCRIPTION
      6DAIA HKJEAI @ =HEJDAJE?  FEJI =@ F=AI E =BBEA H FHA?JELA !IF=?A 6OFA Point3
      EI
              typedef struct Point3 Point3;
              struct Point3{
                  double x, y, z, w;
              };
       4KJEAI MDIA =AI A@ E 3 FAH=JA  LA?JHI H H@E=HO FEJI E =BBEA !IF=?A HAFHA
       IAJA@ >O JDAEH -K?E@A= (x,y,z) ?H@E=JAI 6DAO =IIKA w=1 E JDAEH =HCKAJI =@ IAJ
       w=1 E JDAEH HAIKJI
       =A          ,AI?HEFJE
       add3          )@@ JDA ?H@E=JAI B JM FEJI
       sub3          5K>JH=?J ?H@E=JAI B JM FEJI




                                                   '"
)4160!                                                                                     )4160! 



      neg3          AC=JA JDA ?H@E=JAI B = FEJ
      mul3          KJEFO ?H@E=JAI >O = I?==H
      div3          ,ELE@A ?H@E=JAI >O = I?==H
      eqpt3         6AIJ JM FEJI BH AN=?J AGK=EJO
      closept3      1I JDA @EIJ=?A >AJMAA JM FEJI I=AH JD= eps
      dot3          ,J FH@K?J
      cross3        +HII FH@K?J
      len3          ,EIJ=?A J JDA HECE
      dist3         ,EIJ=?A >AJMAA JM FEJI
      unit3         ) KEJ LA?JH F=H=A J p
      midpt3        6DA E@FEJ B EA IACAJ pq
      lerp3         EA=H EJAHF=JE >AJMAA p =@ q
      reflect3      6DA HABA?JE B FEJ p E JDA IACAJ EEC p0 =@ p1
      nearseg3      6DA ?IAIJ FEJ J testp  IACAJ p0 p1
      pldist3       6DA @EIJ=?A BH p J IACAJ p0 p1
      vdiv3         8A?JH @ELE@A      JDA ACJD B JDA ?FAJ B a F=H=A J b E KEJI B JDA
                    ACJD B b
      vrem3         8A?JH HA=E@AH       JDA ?FAJ B a FAHFA@E?K=H J b 1CHEC HK@BB MA
                    D=LA eqpt3(add3(mul3(b, vdiv3(a, b)), vrem3(a, b)), a)
      6DA BMEC HKJEAI ?LAHJ =CIJ L=HEKI HAFHAIAJ=JEI B FEJI =@ F=AI 2=AI =HA
      HAFHAIAJA@ E@AJE?=O J FEJI >O @K=EJO = FEJ p EI  = F=A q MDAALAH
      p.x*q.x+p.y*q.y+p.z*q.z+p.w*q.w=0 )JDKCD MDA @A=EC MEJD =BBEA FEJI MA
      =IIKA p.w=1 MA ?= J =A JDA I=A =IIKFJE BH F=AI 6DA =AI B JDAIA HKJEAI =HA
      ANJH=?HOFJE? 6DAO ?J=E = f BH B=?A  J E@E?=JA = F=A p BH = FEJ =@ n BH = H=
      LA?JH 6DA K>AH 2 =>>HALE=JAI JDA MH@ J 6DA K>AH 3 HAE@I KI =I >ABHA JD=J MA HA
      @A=EC MEJD =BBEA FEJI 6DKI pn2f3 J=AI = FEJ =@ = H= LA?JH =@ HAJKHI JDA ?HHA
      IF@EC F=A
      =A          ,AI?HEFJE
      pn2f3         +FKJA JDA F=A F=IIEC JDHKCD p MEJD H= n
      ppp2f3        +FKJA JDA F=A F=IIEC JDHKCD JDHAA FEJI
      fff2p3        +FKJA JDA EJAHIA?JE FEJ B JDHAA F=AI
      6DA =AI B JDA BMEC HKJEAI A@ E 4 >A?=KIA JDAO FAH=JA  FEJI E FHA?JELA "
      IF=?A HAFHAIAJA@ >O JDAEH DCAAKI ?H@E=JAI
      F@EL" 2AHIFA?JELA @ELEIE ,ELE@A p.w EJ p I ?H@E=JAI ?LAHJEC J =BBEA ?H@E=JAI 1B
            p.w EI AH JDA HAIKJ EI JDA I=A =I JDA =HCKAJ
      =@@"   )@@ JDA ?H@E=JAI B JM FEJI
      IK>"   5K>JH=?J JDA ?H@E=JAI B JM FEJI
SOURCE
     /sys/src/libgeometry
SEE ALSO
      matrix 




                                                   '#
)55-46                                                                                   )55-46 




NAME
       =IIAHJ   ?DA? FHCH= EL=HE=JI
SYNOPSIS
     #include <u.h>
     #include <libc.h>
       #define assert(cond) if(cond);else _assert("cond")
       void _assert(char* cond)
DESCRIPTION
      Assert EI = FHAFH?AIIH =?H JD=J LE= _assert FHEJI = AII=CA =@ ?=I abort MDA cond EI
      B=IA
SOURCE
     /sys/src/libc/port/_assert.c




                                                 '$
)6.                                                                                                     )6. 




NAME
       =JB =JE =J =J ?D=HIJ@ IJHJ@ IJHJ IJHJ IJHJK IJHJK   ?LAHJ JANJ J K>AHI
SYNOPSIS
     #include <u.h>
     #include <libc.h>
       double atof(char *nptr)
       int        atoi(char *nptr)
       long       atol(char *nptr)
       vlong      atoll(char *nptr)
       double charstod(int (*f)(void *), void *a)
       double strtod(char *nptr, char **rptr)
       long       strtol(char *nptr, char **rptr, int base)
       vlong      strtoll(char *nptr, char **rptr, int base)
       ulong      strtoul(char *nptr, char **rptr, int base)
       uvlong strtoull(char *nptr, char **rptr, int base)
DESCRIPTION
      Atof atoi atol =@ atoll ?LAHJ = IJHEC FEJA@ J >O nptr J B=JEC EJACAH C EJACAH =@
      C C EJACAH vlong HAFHAIAJ=JE HAIFA?JELAO 6DA BEHIJ KHA?CEA@ ?D=H=?JAH A@I JDA
      IJHEC A=@EC + AI?=FAI =HA K@AHIJ@ =I E strtol MEJD base AH @AI?HE>A@ >AM
       Atof HA?CEAI = FJE= IJHEC B J=>I =@ IF=?AI JDA = FJE= IEC JDA = IJHEC B @ECEJI
       FJE=O ?J=EEC = @A?E= FEJ JDA = FJE= e H E BMA@ >O = FJE=O IECA@
       EJACAH
       Atoi =@ atol HA?CEA = FJE= IJHEC B J=>I =@ IF=?AI JDA = FJE= IEC JDA = IJHEC
       B @A?E= @ECEJI
       Strtod strtol strtoll strtoul =@ strtoull >AD=LA IEE=HO J atof =@ atol =@ EB rptr EI J AH
       IAJ *rptr J FEJ J JDA EFKJ ?D=H=?JAH EA@E=JAO =BJAH JDA IJHEC ?LAHJA@
       Strtol strtoll strtoul =@ strtoull EJAHFHAJ JDA @ECEJ IJHEC E JDA IFA?EBEA@ base BH    J !$
       A=?D @ECEJ >AEC AII JD= JDA >=IA ,ECEJI MEJD L=KA LAH ' =HA HAFHAIAJA@ >O AJJAHI = H )
       1B base EI  JDA EFKJ EI EJAHFHAJA@ =I = EJACH= ?IJ=J E JDA IJOA B + MEJD  IKBBENA@ JOFA
       E@E?=JHI K>AHI =HA ?J= EB JDAO >ACE MEJD 0 DAN=@A?E= EB JDAO >ACE MEJD 0x H 0X JDAH
       MEIA @A?E=
       Charstod EJAHFHAJI B=JEC FEJ K>AHI E JDA =AH B atof >KJ CAJI IK??AIIELA ?D=H=?JAHI
       >O ?=EC (*f)(a) 6DA =IJ ?= J f JAHE=JAI JDA I?= I EJ KIJ D=LA HAJKHA@ = ?D=H=?JAH
       JD=J EI J = AC= ?JEK=JE B = K>AH 6DAHABHA EJ =O >A A?AII=HO J >=? KF JDA EFKJ
       IJHA= A ?D=H=?JAH =BJAH ?=EC charstod
SOURCE
     /sys/src/libc/port
SEE ALSO
      fscanf 
DIAGNOSTICS
     AH EI HAJKHA@ EB JDA >ACEEC B JDA EFKJ IJHEC EI J EJAHFHAJ=>A =I = K>AH ALA E JDEI
     ?=IA rptr ME >A KF@=JA@
BUGS
       Atoi, atol, =@ atoll =??AFJ ?J= =@ DAN=@A?E= K>AHI E JDA IJOA B + ?JH=HO J JDA )51
       IFA?EBE?=JE




                                                           '%
)6                                                                                             )6 




NAME
       =E? =@A? ?=I ?=IL ?=IF =@E IJHA?@ J=I   =JE? 49 FAH=JEI
SYNOPSIS
     #include <u.h>
     #include <libc.h>
       long ainc(long *addr);
       long adec(long *addr);
       int cas(int *addr, int ov, int nv);
       int casv(u64int *addr, u64int ov, u64int nv);
       int casp(void **addr, void *ov, void *nv);
       int _tas(ulong *addr);
       ulong loadlink(ulong*);
       int storecond(ulong*, ulong);
DESCRIPTION
      Ainc =JE?=O E?HAAJI JDA L=KA FEJA@ J >O addr =@ HAJKHI JDA AM L=KA
       Adec =JE?=O @A?HAAJI JDA L=KA FEJA@ J >O addr =@ HAJKHI JDA AM L=KA
       Cas casv =@ casp EFAAJ Compare−and−Swap  HAIFA?JELAO int vlong =@ void* L=KAI
       6DA =L=E=>EEJO B JDAIA BK?JEI @AFA@I  JDA +27 =H?DEJA?JKHA 2AJEK 111 =@ =JAH =I MA =I
       ),$" D=LA $">EJ +)5 EIJHK?JEI JDAH =H?DEJA?JKHAI @ J )4# FH?AIIHI =@ A=HEAH @
       J D=LA +)5 H D=LA JDAO Load−Linked H Store−Conditional 6DAIA EIJHK?JEI =HA DMALAH
       AK=JA@ >O JDA 2= ' AHA ) JDAH =H?DEJA?JKHAI D=LA ! >EJ +)5
       _tas EFAAJI Test−and−Set MDE?D EI =L=E=>A  = =H?DEJA?JKHAI =@ KIA@ BH JDA EFAA
       J=JE B AHA ?I IAA lock  =@ thread 
       Loadlink =@ storecond =??AII JDA load−linked =@ store−conditional EIJHK?JEI FHAIAJ  125
       5+ )4 5JHAN@HAN 2MAH2+ 9)4569+++ )FD= 8 8+ 6DAIA =HA J FHA
       IAJ  2AJEK H ),$"  JDA =H?DEJA?JKHAI JD=J D=LA load−linked =@ store−conditional
       JDAIA =HA KIA@ J EFAAJ compare−and−swap
SOURCE
     /sys/src/libc/*/atom.s
     /sys/src/libc/*/tas.s
SEE ALSO
      lock  semacquire  thread 
DIAGNOSTICS
     6DA +)5 BK?JEI _tas =@ storecond HAJKH  BH B=EKHA =@  BH IK??AII




                                                      '&
)760                                                                                          )760 




NAME
       =KJ AMI =@@I CE MH@ =KJDFHNO B=KJDFHNO =KJD=?HF? =KJDBHAAHF?
       =KJDHF? =KJDCAJAO =KJCAJAO =KJDBHAA)1 =KJD?DKE@ =KJD?D=ACA =KJDHAIFIA
       =KJDBHAA?D= =KJDHAIF@ =KJDKIAHF=IIM@ =KJDCAJKIAHF=IIM@ =KJDCAJEB    HKJEAI BH
       =KJDAJE?=JEC KIAHI
SYNOPSIS
     #include <u.h>
     #include <libc.h>
     #include <auth.h>
       int            newns(char *user, char *nsfile);
       int            addns(char *user, char *nsfile);
       int            amount(int fd, char *old, int flag, char *aname);
       int            login(char *user, char *password, char *namespace);
       int            noworld(char *user);
       AuthInfo* auth_proxy(int fd, AuthGetkey *getkey, char *fmt, ...);
       AuthInfo* fauth_proxy(int fd, AuthRpc *rpc, AuthGetkey *getkey,
                 char *params);
       AuthRpc*       auth_allocrpc(int afd);
       void           auth_freerpc(AuthRpc *rpc);
       uint           auth_rpc(AuthRpc *rpc, char *verb, void *a, int n);
       int            auth_getkey(char *proto, char *dom);
       int            (*amount_getkey)(char*, char*);
       void           auth_freeAI(AuthInfo *ai);
       int                auth_chuid(AuthInfo *ai, char *ns);
       Chalstate* auth_challenge(char *fmt, ...);
       AuthInfo* auth_response(Chalstate*);
       void           auth_freechal(Chalstate*);
       int          auth_respond(void *chal, uint nchal, char *user, uint
       nuser, void *resp, uint nresp, AuthGetkey *getkey, char *fmt, ...);
       AuthInfo* auth_userpasswd(char*user, char*password);
       UserPasswd*        auth_getuserpasswd(AuthGetkey                   *getkey,         char*fmt,
       ...);
       AuthInfo* auth_getinfo(int fd);
DESCRIPTION
      6DEI E>H=HO E ??AHJ MEJD factotum" EI KIA@ J =KJDAJE?=JA KIAHI 1J FHLE@AI JDA FHE=HO
      EJAHB=?A J factotum
       Newns >KE@I = =A IF=?A BH user 1J FAI JDA BEA nsfile /lib/namespace EI KIA@ EB nsfile EI
       K ?FEAI JDA @ ALEHAJ AH=IAI JDA ?KHHAJ =A IF=?A IAJI JDA ALEHAJ L=HE=>AI
       user =@ home =@ EJAHFHAJI JDA ?=@I E nsfile 6DA BH=J B nsfile EI @AI?HE>A@ E
       namespace$
       Addns =I EJAHFHAJI =@ ANA?KJAI JDA ?=@I E nsfile 7EA newns EJ =FFEAI JDA ?=@
       J JDA ?KHHAJ =A IF=?A H=JDAH JD= IJ=HJEC BH I?H=J?D
       Amount EI EA mount >KJ FAHBHI =O =KJDAJE?=JE HAGKEHA@ 1J IDK@ >A KIA@ EIJA=@ B
       mount MDAALAH JDA BEA IAHLAH >AEC KJA@ HAGKEHAI =KJDAJE?=JE 5AA bind  BH = @ABEEJE
       B JDA =HCKAJI J mount =@ amount
       Login ?D=CAI JDA KIAH E@ B JDA FH?AII user =@ HA?HA=JAI JDA =AIF=?A KIEC JDA BEA
       namespace @AB=KJ /lib/namespace 1J KIAI auth_userpasswd =@ auth_chuid



                                                   ''
)760                                                                                           )760 



     Noworld HAJKHI  EB JDA KIAH EI E JDA CHKF noworld E /adm/users JDAHMEIA EJ HAJKHI 
     Noworld EI KIA@ >O JAAJ@ =@ BJF@ J FHLE@A I=@>NA@ =??AII BH IA KIAHI
     6DA BMEC HKJEAI KIA JDA AuthInfo IJHK?JKHA HAJKHA@ =BJAH = IK??AIIBK =KJDAJE?=JE >O
     factotum"
            typedef struct
            {
               char *cuid;                /*   caller id */
               char *suid;                /*   server id */
               char *cap;                 /*   capability */
               int   nsecret;             /*   length of secret */
               uchar *secret;             /*   secret */
            } AuthInfo;
     6DA BEA@I cuid =@ suid FEJ J JDA =KJDAJE?=JA@ E@I B JDA ?EAJ =@ IAHLAH Cap EI = ?=F=
     >EEJO HAJKHA@ O J JDA IAHLAH 1J ?= >A F=IIA@ J JDA cap! @ALE?A J ?D=CA JDA KIAH E@ B JDA
     FH?AII Secret EI = nsecret>OJA ID=HA@ IA?HAJ JD=J ?= >A KIA@ >O JDA ?EAJ =@ IAHLAH J
     ?HA=JA A?HOFJE =@ D=IDEC AOI BH JDA HAIJ B JDA ?LAHI=JE
     Auth_proxy FHNEAI = =KJDAJE?=JE ?LAHI=JE >AJMAA = HAJA IAHLAH HA=@EC =@ MHEJEC fd
     =@ = factotum BEA 6DA factotum BEA KIA@ EI /mnt/factotum/rpc ) sprint IAA
     print  B fmt =@ JDA L=HE=>A =HC EIJ OEA@I = AO JAF=JA IAA factotum" IFA?EBOEC JDA AO
     J KIA 6DA JAF=JA KIJ IFA?EBO =J A=IJ JDA FHJ?  proto=xxx) =@ JDA HA AEJDAH
     role=client H role=server Auth_proxy AEJDAH HAJKHI = =?=JA@ AuthInfo IJHK?
     JKHA H IAJI JDA AHHH IJHEC =@ HAJKHI E
     Fauth_proxy ?= >A KIA@ EIJA=@ B auth_proxy EB = IECA ?A?JE J factotum ME >A KIA@ BH
     KJEFA =KJDAJE?=JEI 6DEI EI A?AII=HO BH AN=FA BH newns MDE?D KIJ FA JDA factotum
     BEA >ABHA MEFEC KJ JDA =AIF=?A Fauth_proxy J=AI =I = =HCKAJ = FEJAH J =
     AuthRPC IJHK?JKHA MDE?D ?J=EI = B@ BH = FA ?A?JE J factotum E =@@EJE J IJH
     =CA =@ IJ=JA EBH=JE BH JDA FHJ? ) AuthRPC IJHK?JKHA EI >J=EA@ >O ?=EC
     auth_allocrpc MEJD JDA B@ B = FA factotum ?A?JE 1J EI BHAA@ KIEC auth_freerpc 1@ELE@
     K= ?=@I ?= >A IAJ J factotum" >O ELEC auth_rpc
     *JD auth_proxy =@ fauth_proxy J=A = FEJAH J = HKJEA getkey J ELA IDK@ factotum
     J FIAII = AO BH JDA =KJDAJE?=JE 1B getkey EI E JDA =KJDAJE?=JE B=EI Getkey EI ?=A@
     MEJD = AO JAF=JA BH JDA @AIEHA@ AO 9A D=LA FHLE@A@ = CAAHE? HKJEA auth_getkey MDE?D
     GKAHEAI JDA KIAH BH JDA AO EBH=JE =@ F=IIAI EJ J factotum 6DEI EI JDA @AB=KJ BH JDA C
     >= L=HE=>A amount_getkey MDE?D D@I = FEJAH J JDA AO FHFJEC HKJEA KIA@ >O amount
     Auth_chuid KIAI JDA cuid =@ cap BEA@I B = AuthInfo IJHK?JKHA J ?D=CA JDA KIAH E@ B JDA
     ?KHHAJ FH?AII =@ KIAI ns @AB=KJ /lib/namespace J >KE@ EJ = AM =A IF=?A
     Auth_challenge =@ auth_response FAHBH ?D=ACAHAIFIA FHJ?I MEJD factotum 5J=JA
     >AJMAA JDA ?D=ACA =@ HAIFIA FD=IA =HA AFJ E JDA Chalstate IJHK?JKHA
            struct Chalstate
            {
               char *user;
               char chal[MAXCHLEN];
               int  nchal;
               void *resp;
               int  nresp;

            /* for implementation only */
               int   afd;
               AuthRpc *rpc;
               char userbuf[MAXNAMELEN];
               int   userinchal;
            };
     Auth_challenge HAGKEHAI = AO JAF=JA CAAH=JA@ >O = sprint B fmt =@ JDA L=HE=>A =HCK
     AJI 1J KIJ ?J=E JDA FHJ? proto=xxx =@ @AFA@EC  JDA FHJ? JDA KIAH =A
     user=xxx P9cr =@ vnc ANFA?J JDA KIAH IFA?EBEA@ =I = =JJHE>KJA E JDA AO JAF=JA =@



                                                  !
)760                                                                                        )760 



       apop cram =@ chap ANFA?J EJ E JDA user BEA@ B JDA =HC J auth_response .H = FHJ?I
       JDA HAIFIA EI HAJKHA@ J auth_response E JDA resp BEA@ B JDA Chalstate Chalstate.nresp
       KIJ >A JDA ACJD B JDA HAIFIA
       5KFFO J auth_respond = ?D=ACA IJHEC =@ JDA BJ =@ =HCI IFA?EBOEC = AO =@ EJ ME KIA
       factotum J HAJKH JDA FHFAH KIAH =@ HAIFIA
       Auth_userpasswd LAHEBEAI = IEFA KIAHF=IIMH@        F=EH   Auth_getuserpasswd   HAJHEALAI   =
       KIAHF=IIMH@ F=EH BH factotum EB FAHEJJA@
              typedef struct UserPasswd {
                 char *user;
                 char *passwd;
              } UserPasswd;
       Auth_getinfo HA=@I = AuthInfo AII=CA BH fd =@ ?LAHJI EJ EJ = IJHK?JKHA 1J EI O KIA@
       >O JDA JDAH HKJEAI E JDEI E>H=HO MDA ?KE?=JEC MEJD factotum
       Auth_freeAI EI KIA@ J BHAA = AuthInfo IJHK?JKHA HAJKHA@ >O A B JDAIA HKJEAI 5EE=HO
       auth_freechal BHAAI = ?D=ACAHAIFIA IJ=JA
SOURCE
     /sys/src/libauth
SEE ALSO
      factotum" authsrv  bind 
DIAGNOSTICS
     6DAIA HKJEAI IAJ errstr




                                                 !
)760548                                                                                    )760548 




NAME
       =KJD@E= F=IIJAO L?IK HA=@LH= ?L6  ?L 6 ?L64  ?L 64 ?L) 
       ?L ) ?L24  ?L 24 =ICAJJE?AJ =IH@HAIF     HKJEAI BH ?KE?=JEC MEJD
       =KJDAJE?=JE IAHLAHI
SYNOPSIS
     #include <u.h>
     #include <libc.h>
     #include <authsrv.h>
       int     authdial(char *netroot, char *ad);
       int     passtokey(char key[DESKEYLEN], char *password)
       uchar nvcsum(void *mem, int len)
       int     readnvram(Nvrsafe *nv, int flag);
       int     convT2M(Ticket *t, char *msg, char *key)
       void    convM2T(char *msg, Ticket *t, char *key)
       int     convA2M(Authenticator *a, char *msg, char *key)
       void    convM2A(char *msg, Authenticator *a, char *key)
       int     convTR2M(Ticketreq *tr, char *msg)
       void    convM2TR(char *msg, Ticketreq *tr)
       int     convPR2M(Passwordreq *pr, char *msg, char *key)
       void    convM2PR(char *msg, Passwordreq *pr, char *key)
       int     _asgetticket(int fd, char *trbuf, char *tbuf);
       int     _asrdresp(int fd, char *buf, int len);
DESCRIPTION
      Authdial @E=I = =KJDAJE?=JE IAHLAH LAH JDA AJMH HJA@ =J net @AB=KJ /net 6DA =KJDA
      JE?=JE @=E ad IFA?EBEAI MDE?D IAHLAH J ?= 1B ad EI E JDA ?A?JE IAHLAH cs IAA
      ndb& EI GKAHEA@ BH = AJHO MDE?D ?J=EI authdom=ad H dom=ad JDA BHAH D=LEC FHA?A
      @A?A =@ MDE?D =I ?J=EI = auth =JJHE>KJA 1B EJ BE@I AEJDAH EJ JHEAI p9auth.ad E ,5
      =I JDA =KJDAJE?=JE IAHLAH 6DA IJHEC @E=A@ EI JDA netrootserverJE?AJ MDAHA server EI JDA
      L=KA B JDA auth =JJHE>KJA 1B  AJHO EI BK@ JDA AHHH IJHEC EI IAJ J  =KJDAJE?=JE
      IAHLAH BK@ =@  EI HAJKHA@ 1B authdom EI E JDA IJHEC netroot!$auth!ticket EI KIA@ J
      =A JDA ?=
       Passtokey ?LAHJI password EJ = ,-5 AO =@ IJHAI JDA HAIKJ E key 1J HAJKHI  EB password
       ?K@ J >A ?LAHJA@ =@  JDAHMEIA
       Readnvram HA=@I =KJDAJE?=JE EBH=JE EJ JDA IJHK?JKHA
       struct Nvrsafe
       {
          char    machkey[DESKEYLEN];/* was file server’s authid’s des key */
          uchar   machsum;
          char    authkey[DESKEYLEN];/* authid’s des key from password */
          uchar   authsum;
          /*
           * file server config string of device holding full configuration;
           * secstore key on non−file−servers.
           */
          char    config[CONFIGLEN];
          uchar   configsum;
          char    authid[ANAMELEN];/* auth userid, e.g., bootes */
          uchar   authidsum;
          char    authdom[DOMLEN]; /* auth domain, e.g., cs.bell−labs.com */
          uchar   authdomsum;



                                                   !
)760548                                                                                      )760548 



       };
        5F=H? 125 =@ 5/1 =?DEAI JDEI EBH=JE EI E L=JEA H= =??AIIE>A E JDA BEA
       #r/nvram  N&$I =@ )FD=I readnvram IK??AIIELAO FAI JDA BMEC =HA=I IJFFEC MEJD
       JDA BEHIJ J IK??AA@
        JDA F=HJEJE =A@ >O JDA $nvram ALEHAJ L=HE=>A ?O IAJ LE= plan9.ini&
        JDA F=HJEJE #S/sdC0/nvram
        = BEA ?=A@ plan9.nvr E JDA F=HJEJE #S/sdC0/9fat
        JDA F=HJEJE #S/sd00/nvram
        = BEA ?=A@ plan9.nvr E JDA F=HJEJE #S/sd00/9fat
        = BEA ?=A@ plan9.nvr  = ,5 BFFO E @HELA 
        = BEA ?=A@ plan9.nvr  = ,5 BFFO E @HELA 
       6DA nvcsumI B JDA BEA@I machkey authid =@ authdom KIJ =J?D JDAEH HAIFA?JELA ?DA?
       IK H JD=J BEA@ EI AHA@ 1B flag EI NVwrite H =J A=IJ A ?DA?IK B=EI =@ flag EI
       NVwriteonerr readnvram ME FHFJ BH AM L=KAI  #c/cons =@ JDA MHEJA JDA >=?
       J JDA IJH=CA =HA= 1B flag EI NVwritemem readnvram ME MHEJA JDA L=KAI E *nv >=? J JDA
       IJH=CA =HA=
       ConvT2M convA2M convTR2M =@ convPR2M ?LAHJ JE?AJI =KJDAJE?=JHI JE?AJ HAGKAIJI =@
       F=IIMH@ ?D=CA HAGKAIJ IJHK?JKHAI EJ JH=IEJJ=>A AII=CAI ConvM2T convM2A convM2TR
       =@ convM2PR =HA KIA@ J ?LAHJ JDA >=? Key EI KIA@ BH A?HOFJEC JDA AII=CA >ABHA
       JH=IEIIE =@ @A?HOFJEC =BJAH HA?AFJE
       6DA HKJEA _asgetresp HA?AELAI AEJDAH = ?D=H=?JAH =HH=O H = AHHH IJHEC  AHHH EJ IAJI AHHIJH
       =@ HAJKHI  1B IK??AIIBK EJ HAJKHI JDA K>AH B >OJAI HA?AELA@
       6DA HKJEA _asgetticket IA@I = JE?AJ HAGKAIJ AII=CA =@ JDA KIAI _asgetresp J HA?EALA =
       =IMAH
SOURCE
     /sys/src/libauthsrv
SEE ALSO
      passwd cons! dial  authsrv$
DIAGNOSTICS
     6DAIA HKJEAI IAJ errstr 1JACAHL=KA@ BK?JEI HAJKH   AHHH




                                                   !!
)8                                                                                                  )8 




NAME
         =LJHAA EIAHJ=L KF=L @AAJA=L =LM= =LANJ =LFHAL A@M=  )8 JHAA HKJEAI
SYNOPSIS
     #include <u.h>
     #include <libc.h>
     #include <avl.h>
         typedef struct Avl Avl;
         struct Avl
         {
                 Avl     *p;                            /* parent */
                 Avl     *n[2];                         /* children */
                 int     bal;                           /* balance bits */
         };
         Avl        *avlnext(Avlwalk *walk);
         Avl        *avlprev(Avlwalk *walk);
         Avlwalk    *avlwalk(Avltree *tree);
         void       deleteavl(Avltree *tree, Avl *key, Avl **oldp);
         void       endwalk(Avlwalk *walk);
         void       insertavl(Avltree *tree, Avl *new, Avl **oldp);
         Avl        *lookupavl(Avltree *tree, Avl *key);
         Avl        *searchavl(Avltree *tree, Avl *key, int neighbor);
         Avltree    *mkavltree(int(*cmp)(Avl*, Avl*));
DESCRIPTION
      ) )8 JHAA EI = IAB>==?EC >E=HO IA=H?D JHAA 6DAIA HKJEAI =M ?HA=JE =@ =EJA=?A
      B EAHO )8 JHAAI
         ) AFJO )8 JHAA EI ?HA=JA@ >O ?=EC mkavltree MEJD = ?F=HEI BK?JE =I =HCKAJ 6DEI
         BK?JE IDK@ J=A JM FEJAHI J Avl >A?JI =@ HAJKH   H  =I JDA BEHIJ EI HAIFA?JELAO
         AII JD= AGK= J H CHA=JAH JD= JDA IA?@ Insertavl =@@I = new JHAA @A EJ tree 1B oldp EI
         E KF HAJKH EJ FEJI J IJH=CA BH = @ @A MEJD JDA I=A AO JD=J =O M >A BHAA@
         Lookupavl HAJKHI JDA tree @A JD=J =J?DAI key >O tree I ?F=HEI BK?JE H nil EB A
         Searchavl HAJKHI JDA tree @A JD=J =J?DAI key >O tree I ?F=HEI BK?JE EB EJ ANEIJI 1B EJ
         @AI J =@ neighbor EI FIEJELA EJ HAJKHI JDA A=HAIJ @A MDIA key EI CHA=JAH H nil EB JDAHA
         EI A =@ EB neighbor EI AC=JELA EJ HAJKHI JDA A=HAIJ @A MDIA key EI AII H nil EB JDAHA EI
         A 1J EI = AHHH J IAJ neighbor J L=KAI JDAH JD=   H 
         Deleteavl HALAI JDA @A =J?DEC key BH tree oldp EI D=@A@ =I FAH insertavl
         Avlwalk HAJKHI = FEJAH J = AMO=?=JA@ Avlwalk >A?J Endwalk BHAAI IK?D = >A?J
         Avlnext =@ avlprev M= JDA JHAA =II?E=JA@ MEJD walk HAJKHEC JDA ANJ HAIFA?JELAO FHALEKI
         JHAA @A E JDA ?F=HEI H@AH @ABEA@ >O JDA ?F=HEI BK?JE =II?E=JA@ MEJD JDA JHAA
         =II?E=JA@ MEJD walk
EXAMPLES
     1JA@A@ KI=CA IAAI J >A J =A = =OKI Avl JDA BEHIJ A>AH B JDA =FFE?=JE I
     JHAA@A IJHK?JKHA JDA F=II JDAIA HKJEAI JHAA@A FEJAHI EIJA=@ B Avl*I
                typedef struct Node {
                        Avl;
                        uchar   score[VtScoreSize];
                        int     type;
                } Node;
                Avltree *tree;
                Avl *res;
                Node *np;
                ...
                        res = lookupavl(tree, np);
SOURCE
     /sys/src/libavl


                                                      !"
)8                                                                                       )8 



SEE ALSO
      /  )@AI8AIO -  =@EI ) =CHEJD BH JDA HC=E=JE B EBH=JE  Soviet
      Mathematics 8 ! FF  #$  $!
DIAGNOSTICS
     .K?JEI HAJKHEC FEJAHI HAJKH nil  AHHH




                                                !#
*1                                                                                                  *1 




NAME
         >E=? >ECHM >EBHAA   CHKFA@ AHO =?=JE
SYNOPSIS
     #include <u.h>
     #include <libc.h>
     #include <bin.h>
         typedef struct BinBin;
         void     *binalloc(Bin **bp, ulong size, int clr);
         void     *bingrow(Bin **bp, void *op, ulong osize,
                  ulong size, int clr);
         void     binfree(Bin **bp);
DESCRIPTION
      6DAIA HKJEAI FHLE@A IEFA CHKFA@ AHO =?=JE =@ @A=?=JE 1JAI =?=JA@ MEJD
      binalloc =HA =@@A@ J JDA Bin FEJA@ J >O bp ) EJAI E = >E =O >A BHAA@ MEJD A ?= J
      binfree JDAHA EI  M=O J BHAA = IECA EJA
         Binalloc HAJKHI = FEJAH J = AM >? B =J A=IJ size >OJAI 6DA >? EI IKEJ=>O =ECA@ BH
         IJH=CA B =O JOFA B >A?J  JM =?JELA FEJAHI BH binalloc ME D=LA JDA I=A L=KA 6DA
         ?= binalloc(0) HAJKHI = L=E@ FEJAH H=JDAH JD= K 1B clr EI AH JDA =?=JA@ A
         HO EI IAJ J  JDAHMEIA JDA ?JAJI =HA K@ABEA@
         Bingrow EI KIA@ J ANJA@ JDA IEA B = >? B AHO HAJKHA@ >O binalloc Bp KIJ FEJ J JDA
         I=A >E CHKF KIA@ J =?=JA JDA HECE= >? =@ osize KIJ >A JDA =IJ IEA KIA@ J =?=JA
         H CHM JDA >? ) FEJAH J = >? B =J A=IJ size >OJAI EI HAJKHA@ MEJD JDA I=A ?JAJI E
         JDA BEHIJ osize ?=JEI 1B clr EI AH JDA HA=EEC >OJAI =HA IAJ J  =@ =HA K@ABEA@
         JDAHMEIA 1B op EI nil EJ =@ osize =HA ECHA@ =@ JDA HAIKJ EI JDA I=A =I ?=EC binalloc
         Binalloc =@ bingrow =?=JA =HCA ?DKI B AHO KIEC malloc  =@ HAJKH FEA?AI B JDAIA
         ?DKI 6DA ?DKI =HA free @ KF = ?= J binfree
SOURCE
     /sys/src/libbin
SEE ALSO
      malloc 
DIAGNOSTICS
     binalloc =@ bingrow HAJKH  EB JDAHA EI  =L=E=>A AHO




                                                     !$
*1,                                                                                              *1, 




NAME
       >E@ KJ KKJ     ?D=CA =A IF=?A
SYNOPSIS
     #include <u.h>
     #include <libc.h>
       int bind(char *name, char *old, int flag)
       int mount(int fd, int afd, char *old, int flag, char *aname)
       int unmount(char *name, char *old)
DESCRIPTION
      Bind =@ mount @EBO JDA BEA =A IF=?A B JDA ?KHHAJ FH?AII =@ JDAH FH?AIIAI E EJI =A
      IF=?A CHKF IAA fork  .H >JD ?=I old EI JDA =A B = ANEIJEC BEA H @EHA?JHO E JDA ?KH
      HAJ =A IF=?A MDAHA JDA @EBE?=JE EI J >A =@A 6DA =A old EI evaluated =I @AI?HE>A@ E
      intro  AN?AFJ JD=J  JH=I=JE B JDA BE= F=JD AAAJ EI @A
       .H bind name EI JDA =A B =JDAH H FIIE>O JDA I=A ANEIJEC BEA H @EHA?JHO E JDA ?KH
       HAJ =A IF=?A )BJAH = IK??AIIBK bind ?= JDA BEA =A old EI = =E=I BH JDA >A?J HECE=O
       =A@ >O name EB JDA @EBE?=JE @AI J DE@A EJ name ME =I IJE HABAH J EJI HECE= BEA
       6DA AL=K=JE B new D=FFAI =J JDA JEA B JDA bind J MDA JDA >E@EC EI =JAH KIA@
       6DA fd =HCKAJ J mount EI = BEA @AI?HEFJH B = FA AJMH ?A?JE H FEFA J = BEA
       IAHLAH MDEA afd EI = =KJDAJE?=JE BEA @AI?HEFJH =I ?HA=JA@ >O fauth  =@ IK>IAGKAJO =KJDA
       JE?=JA@ 1B =KJDAJE?=JE EI J HAGKEHA@ afd IDK@ >A  6DA old BEA KIJ >A = @EHA?JHO )BJAH
       = IK??AIIBK mount JDA BEA JHAA served IAA >AM >O fd ME >A LEIE>A MEJD EJI HJ @EHA?JHO D=L
       EC =A old
       6DA flag ?JHI @AJ=EI B JDA @EBE?=JE =@A J JDA =A IF=?A 1 JDA BMEC new HABAHI
       J JDA BEA =I @ABEA@ >O name H JDA HJ @EHA?JHO IAHLA@ >O fd -EJDAH >JD old =@ AM BEAI KIJ
       >A @EHA?JHEAI H >JD KIJ J >A @EHA?JHEAI Flag ?= >A A B
       MREPL        4AF=?A JDA old BEA >O JDA AM A 0A?ABHJD = AL=K=JE B old ME >A JH=I
                    =JA@ J JDA AM BEA 1B JDAO =HA @EHA?JHEAI BH mount JDEI ?@EJE EI JHKA >O @ABE
                    EJE old >A?AI = union directory ?IEIJEC B A @EHA?JHO JDA AM BEA
       MBEFORE      *JD JDA old =@ AM BEAI KIJ >A @EHA?JHEAI )@@ JDA ?IJEJKAJ BEAI B JDA AM
                    @EHA?JHO J JDA KE @EHA?JHO =J old I EJI ?JAJI =FFA=H BEHIJ E JDA KE )BJAH
                    = MBEFORE bind H mount JDA AM @EHA?JHO ME >A IA=H?DA@ BEHIJ MDA AL=K=JEC
                    BEA =AI E JDA KE @EHA?JHO
       MAFTER       EA MBEFORE >KJ JDA AM @EHA?JHO CAI =J JDA A@ B JDA KE
       6DA B=CI =HA @ABEA@ E <libc.h> 1 =@@EJE JDAHA EI = MCREATE B=C JD=J ?= >A 4 @ MEJD
       =O B JDA =>LA 9DA = create IOIJA ?= IAA open  =JJAFJI J ?HA=JA E = KE @EHA?JHO
       =@ JDA BEA @AI J ANEIJ JDA AAAJI B JDA KE =HA IA=H?DA@ E H@AH KJE A EI BK@ MEJD
       MCREATE IAJ 6DA BEA EI ?HA=JA@ E JD=J @EHA?JHO EB JD=J =JJAFJ B=EI JDA create B=EI
       .E=O JDA MCACHE B=C L=E@ BH mount O JKHI  ?=?DEC BH BEAI =@A =L=E=>A >O JDA
       KJ *O @AB=KJ BEA ?JAJI =HA =M=OI HAJHEALA@ BH JDA IAHLAH 9EJD ?=?DEC A=>A@ JDA
       AHA =O EIJA=@ KIA = ?= ?=?DA J I=JEIBO read# HAGKAIJI BH BEAI =??AIIE>A JDHKCD JDEI
       KJ FEJ 6DA ?KHHA?O B ?=?DA@ @=J= BH = BEA EI LAHEBEA@ =J A=?D open# B JDA BEA BH JDEI
       ?EAJ =?DEA
       9EJD mount JDA BEA @AI?HEFJH fd KIJ >A FA BH HA=@EC =@ MHEJEC =@ FHAF=HA@ J HAIF@
       J '2 AII=CAI IAA 5A?JE # )BJAH JDA mount JDA BEA JHAA IJ=HJEC =J old EI IAHLA@ >O = AHA
       mnt! @ALE?A 6D=J @ALE?A ME JKH FAH=JEI E JDA JHAA EJ AII=CAI  fd Aname IAA?JI
       =C @EBBAHAJ BEA JHAAI  JDA IAHLAH JDA K IJHEC ?DIAI JDA @AB=KJ JHAA
       6DA BEA @AI?HEFJH fd EI =KJ=JE?=O ?IA@ >O = IK??AIIBK mount ?=
       6DA ABBA?JI B bind =@ mount ?= >A K@A >O unmount 1B name EI AH ALAHOJDEC >K@ J H
       KJA@ KF old EI K>K@ H KKJA@ 1B name EI J AH EJ EI AL=K=JA@ =I @AI?HE>A@
       =>LA BH bind =@ JDA ABBA?J B >E@EC H KJEC JD=J F=HJE?K=H HAIKJ  old EI K@A
SOURCE
     /sys/src/libc/9syscall



                                                    !%
*1,                                                                                            *1, 



SEE ALSO
      bind intro  fcall  auth  F=HJE?K=HO amount intro# mnt! srv!
DIAGNOSTICS
     6DA HAJKH L=KA EI = FIEJELA EJACAH = KEGKA IAGKA?A K>AH BH IK??AII  BH B=EKHA
     6DAIA HKJEAI IAJ errstr
BUGS
       Mount ME J HAJKH KJE EJ D=I IK??AIIBKO =JJ=?DA@ J JDA BEA IAHLAH I JDA FH?AII @EC =
       mount ?=J >A JDA A IAHLEC




                                                    !&
*1                                                                                                  *1 




NAME
         *FA *EEJ *EEJI *H@EA *H@IJH *CAJ? *CAJHKA *CAJ@ *KCAJ? *KCAJHKA *HA=@ *IAA
         *BBIAJ *BE@AI *EAA *FKJ? *FKJHKA *FHEJ *LFHEJ *MHEJA *BKID *JAH *>KBBAHA@ >KB
         BAHA@ EFKJKJFKJ
SYNOPSIS
     #include <u.h>
     #include <libc.h>
     #include <bio.h>
         Biobuf* Bopen(char *file, int mode)
         int     Binit(Biobuf *bp, int fd, int mode)
         int     Binits(Biobufhdr *bp, int fd, int mode, uchar *buf, int size)
         int     Bterm(Biobufhdr *bp)
         int     Bprint(Biobufhdr *bp, char *format, ...)
         int     Bvprint(Biobufhdr *bp, char *format, va_list arglist);
         void* Brdline(Biobufhdr *bp, int delim)
         char* Brdstr(Biobufhdr *bp, int delim, int nulldelim)
         int     Blinelen(Biobufhdr *bp)
         vlong Boffset(Biobufhdr *bp)
         int     Bfildes(Biobufhdr *bp)
         int     Bgetc(Biobufhdr *bp)
         long    Bgetrune(Biobufhdr *bp)
         int     Bgetd(Biobufhdr *bp, double *d)
         int     Bungetc(Biobufhdr *bp)
         int     Bungetrune(Biobufhdr *bp)
         vlong Bseek(Biobufhdr *bp, vlong n, int type)
         int     Bputc(Biobufhdr *bp, int c)
         int     Bputrune(Biobufhdr *bp, long c)
         long    Bread(Biobufhdr *bp, void *addr, long nbytes)
         long    Bwrite(Biobufhdr *bp, void *addr, long nbytes)
         int     Bflush(Biobufhdr *bp)
         int     Bbuffered(Biobufhdr *bp)
DESCRIPTION
      6DAIA HKJEAI EFAAJ B=IJ >KBBAHA@ 1 1  @EBBAHAJ BEA @AI?HEFJHI EI E@AFA@AJ
         Bopen FAI file BH @A OREAD H ?HA=JAI BH @A OWRITE 1J ?=I malloc  J =?=JA =
         >KBBAH
         Binit EEJE=EAI = IJ=@=H@ IEA >KBBAH JOFA Biobuf MEJD JDA FA BEA @AI?HEFJH F=IIA@ E >O JDA
         KIAH Binits EEJE=EAI = IJ=@=H@ IEA >KBBAH JOFA Biobufhdr MEJD JDA FA BEA @AI?HEFJH
         >KBBAH =HA= =@ >KBBAH IEA F=IIA@ E >O JDA KIAH Biobuf =@ Biobufhdr =HA HA=JA@ >O JDA @A?=H=
         JE
                typedef struct Biobuf Biobuf;
                struct Biobuf
                {
                     Biobufhdr;
                     uchar b[Bungetsize+Bsize];
                };




                                                     !'
*1                                                                                                       *1 



         )HCKAJI B JOFAI FEJAH J *E>KB =@ FEJAH J *E>KBD@H ?= >A KIA@ EJAH?D=CA=>O E JDA
         BMEC HKJEAI
         Bopen Binit H Binits IDK@ >A ?=A@ >ABHA =O B JDA JDAH HKJEAI  JD=J >KBBAH Bfildes
         HAJKHI JDA EJACAH BEA @AI?HEFJH B JDA =II?E=JA@ FA BEA
         Bterm BKIDAI JDA >KBBAH BH bp =@ HAJKHI Bflush I HAJKH L=KA 1B JDA >KBBAH M=I =?=JA@ >O
         Bopen JDA >KBBAH EI freed =@ JDA BEA EI ?IA@
         Brdline HA=@I = IJHEC BH JDA BEA =II?E=JA@ MEJD bp KF J =@ E?K@EC JDA BEHIJ delim ?D=H=?JAH
         6DA @AEEJAH ?D=H=?JAH =J JDA A@ B JDA EA EI J =JAHA@ JDKI JDA HAJKHA@ IJHEC FH>=>O M J
         >A 7JAHE=JA@ Brdline HAJKHI = FEJAH J JDA IJ=HJ B JDA EA H 0  A@BBEA H HA=@
         AHHH Blinelen HAJKHI JDA ACJD E?K@EC JDA @AEEJAH B JDA IJ HA?AJ IJHEC HAJKHA@ >O
         Brdline
         Brdstr HAJKHI = malloc =?=JA@ >KBBAH ?J=EEC JDA ANJ EA B EFKJ @AEEJA@ >O delim
         JAHE=JA@ >O = 7  >OJA 7EA Brdline MDE?D HAJKHI MDA EJI >KBBAH EI BK ALA EB  @AE
         EJAH D=I >AA BK@ Brdstr ME HAJKH = =H>EJH=HEO C EA E = IECA ?= 1B nulldelim EI IAJ JDA
         JAHE= @AEEJAH ME >A LAHMHEJJA MEJD = 7 )BJAH = IK??AIIBK ?= J Brdstr JDA HAJKH L=KA
         B Blinelen ME >A JDA ACJD B JDA HAJKHA@ >KBBAH AN?K@EC JDA 7
         Bgetc HAJKHI JDA ANJ ?D=H=?JAH BH bp H = AC=JELA L=KA =J A@ B BEA Bungetc =O >A ?=A@
         EA@E=JAO =BJAH Bgetc J =M JDA I=A ?D=H=?JAH J >A HAHA=@
         Bgetrune ?=I Bgetc J HA=@ JDA >OJAI B JDA ANJ 76. IAGKA?A E JDA EFKJ IJHA= =@ HAJKHI JDA
         L=KA B JDA HKA HAFHAIAJA@ >O JDA IAGKA?A 1J HAJKHI = AC=JELA L=KA =J A@ B BEA
         Bungetrune =O >A ?=A@ EA@E=JAO =BJAH Bgetrune J =M JDA I=A 76. IAGKA?A J >A HAHA=@
         =I AEJDAH >OJAI H = HKA Bungetc =@ Bungetrune =O >=? KF = =NEK B BELA >OJAI
         Bgetd KIAI charstod IAA atof  =@ Bgetc J HA=@ JDA BH=JJA@ B=JECFEJ K>AH E JDA
         EFKJ IJHA= IEFFEC EEJE= >=I =@ J=>I 6DA L=KA EI IJHA@ E *d.
         Bread HA=@I nbytes B @=J= BH bp EJ AHO IJ=HJEC =J addr 6DA K>AH B >OJAI HA=@ EI
         HAJKHA@  IK??AII =@ = AC=JELA L=KA EI HAJKHA@ EB = HA=@ AHHH ??KHHA@
         Bseek =FFEAI seek  J bp 1J HAJKHI JDA AM BEA BBIAJ Boffset HAJKHI JDA BEA BBIAJ B JDA ANJ
         ?D=H=?JAH J >A FH?AIIA@
         Bputc KJFKJI JDA M H@AH & >EJI B c  bp 1B JDEI ?=KIAI = write J ??KH =@ JDAHA EI = AHHH
         = AC=JELA L=KA EI HAJKHA@ JDAHMEIA = AH EI HAJKHA@
         Bputrune ?=I Bputc J KJFKJ JDA M H@AH $ >EJI B c =I = HKA E 76. BH=J  JDA KJFKJ
         IJHA=
         Bprint EI = >KBBAHA@ EJAHB=?A J print  1B JDEI ?=KIAI = write J ??KH =@ JDAHA EI = AHHH = AC
         =JELA L=KA Beof EI HAJKHA@ JDAHMEIA Bprint HAJKHI JDA K>AH B >OJAI MHEJJA Bvprint
         @AI JDA I=A AN?AFJ EJ J=AI =I =HCKAJ = va_list F=H=AJAH I EJ ?= >A ?=A@ MEJDE =
         L=HE=@E? BK?JE
         Bwrite KJFKJI nbytes B @=J= IJ=HJEC =J addr J bp 1B JDEI ?=KIAI = write J ??KH =@ JDAHA EI =
         AHHH = AC=JELA L=KA EI HAJKHA@ JDAHMEIA JDA K>AH B >OJAI MHEJJA EI HAJKHA@
         Bflush ?=KIAI =O >KBBAHA@ KJFKJ =II?E=JA@ MEJD bp J >A MHEJJA 6DA HAJKH EI =I BH Bputc
         Bflush EI ?=A@  ANEJ BH ALAHO >KBBAH IJE FA BH MHEJEC
         Bbuffered HAJKHI JDA K>AH B >OJAI E JDA >KBBAH 9DA HA=@EC JDEI EI JDA K>AH B >OJAI
         IJE =L=E=>A BH JDA =IJ HA=@  JDA BEA MDA MHEJEC EJ EI JDA K>AH B >OJAI HA=@O J >A MHEJ
         JA
SOURCE
     /sys/src/libbio
SEE ALSO
      open  print  exits  utf$
DIAGNOSTICS
     Bio HKJEAI JD=J HAJKH EJACAHI OEA@ Beof EB bp EI J JDA @AI?HEFJH B = FA BEA Bopen
     HAJKHI AH EB JDA BEA ?=J >A FAA@ E JDA CELA @A ) HKJEAI IAJ errstr  AHHH
BUGS
         Brdline HAJKHI = AHHH  IJHECI CAH JD= JDA >KBBAH =II?E=JA@ MEJD JDA BEA =@ =I EB JDA



                                                        !
*1                                                                                                    *1 



         A@BBEA EI A?KJAHA@ >ABHA = @AEEJAH Blinelen ME JA DM =O ?D=H=?JAHI =HA =L=E=>A
         E JDAIA ?=IAI 1 JDA ?=IA B = JHKA A@BBEA Blinelen ME HAJKH AH )J JDA ?IJ B =?=JEC
         = >KBBAH Brdstr IE@AIJAFI JDAIA EIIKAI
         O JDA M >OJA B Brdstr I delim EI AN=EA@ I delim ?=J >A = =H>EJH=HO HKA
         6DA @=J= HAJKHA@ >O Brdline =O >A LAHMHEJJA >O ?=I J =O JDAH bio HKJEA  JDA I=A bp.




                                                      !
*9.150                                                                                   *9.150  




NAME
       IAJKF*.IJ=JA >B+*+A?HOFJ >B+*+@A?HOFJ >B-+*A?HOFJ >B-+*@A?HOFJ  >MBEID A?HOFJE
SYNOPSIS
     #include       <u.h>
     #include       <libc.h>
     #include       <mp.h>
     #include       <libsec.h>
       void      setupBFstate(BFstate              *s,      uchar      key[],       int      keybytes,
                          uchar *ivec)
       void bfCBCencrypt(uchar *data, int len, BFstate *s)
       void bfCBCdecrypt(uchar *data, int len, BFstate *s)
       void bfECBencrypt(uchar *data, int len, BFstate *s)
       void bfECBdecrypt(uchar *data, int len, BFstate *s)
DESCRIPTION
      *MBEID EI *HK?A 5?DAEAH I IOAJHE? >? ?EFDAH 1J IKFFHJI L=HE=>A ACJD AOI BH !      J
      ""& >EJI =@ D=I = >? IEA B $" >EJI *JD +*+ =@ -+* @AI =HA IKFFHJA@
       IAJKF*.IJ=JA J=AI = *.IJ=JA IJHK?JKHA = AO B =J IJ #$ >OJAI JDA ACJD B JDA AO E >OJAI
       =@ = EEJE=E=JE LA?JH B & >OJAI IAJ J = AHAI EB =HCKAJ EI E 6DA A?HOFJE =@
       @A?HOFJE BK?JEI J=A = *.IJ=JA IJHK?JKHA = @=J= >KBBAH =@ = ACJD MDE?D KIJ >A = KJEFA
       B AECDJ >OJAI =I F=@@EC EI ?KHHAJO KIKFFHJA@
SOURCE
     /sys/src/libsec
SEE ALSO
      mp  aes  des  dsa  elgamal  rc4  rsa  sechash  prime  rand 




                                                   !
*4                                                                                             *4 




NAME
         >H I>H   ?D=CA AHO =?=JE
SYNOPSIS
     #include <u.h>
     #include <libc.h>
         int     brk(void *addr)
         void* sbrk(ulong incr)
DESCRIPTION
      Brk IAJI JDA IOIJA I E@A= B JDA MAIJ >II ?=JE J KIA@ >O JDA FHCH= ?=A@ JDA >HA= J
      addr HK@A@ KF J JDA ANJ KJEFA B & >OJAI ?=JEI J AII JD= addr =@ >AM JDA IJ=?
      FEJAH =O ?=KIA = AHO LE=JE EB =??AIIA@
         1 JDA =JAH=JA BK?JE sbrk incr HA >OJAI =HA =@@A@ J JDA FHCH= I @=J= IF=?A =@ =
         FEJAH J JDA IJ=HJ B JDA AM =HA= EI HAJKHA@ 4K@EC ??KHI =I MEJD brk
         9DA = FHCH= >ACEI ANA?KJE LE= exec JDA >HA= EI IAJ =J JDA DECDAIJ ?=JE @ABEA@ >O JDA
         FHCH= =@ @=J= IJH=CA =HA=I H@E=HEO JDAHABHA O FHCH=I MEJD CHMEC @=J= =HA=I
         AA@ J KIA brk ) ?= J sbrk MEJD = AH =HCKAJ HAJKHI JDA MAIJ =@@HAII E JDA @O=E?
         IACAJ
SOURCE
     /sys/src/libc/9sys/sbrk.c
SEE ALSO
      intro  malloc  segattach  segbrk 
DIAGNOSTICS
     6DAIA BK?JEI IAJ errstr
         6DA AHHH HAJKH BH sbrk EI (void*)−1




                                                     !!
+)+0-+0)45                                                                               +)+0-+0)45 




NAME
       ?=?DA?D=HI =CABJ =@?D=H 5K>BJ .J?D=H .J     BJ KJEEJEAI
SYNOPSIS
     #include <u.h>
     #include <libc.h>
     #include <draw.h>
       int    cachechars(Font *f, char **s, Rune **r, ushort *c, int max,
                          int *widp, char **sfname)
       int    loadchar(Font *f, Rune r, Cacheinfo *c, int h,
                          int noclr, char **sfname)
       void agefont(Font *f)
DESCRIPTION
      ) Font =O ?J=E J =O ?D=H=?JAHI J D@ E AHO IEKJ=AKIO 6DA CH=FDE?I E>H=HO
      =@ @H=M @ALE?A IAA draw! ?FAH=JA J ILA JDEI FH>A >O =EJ=EEC = ?=?DA B HA?AJO
      KIA@ ?D=H=?JAH E=CAI 6DA @AJ=EI B JDEI ?FAH=JE AA@ J >A M >O IJ FHCH=I
      initdraw =@ EJI =II?E=JA@ font L=HE=>A openfont stringwidth string =@ freefont =HA IKBBE?EAJ
      BH IJ FKHFIAI 6DA HKJEAI @AI?HE>A@ >AM =HA KIA@ EJAH=O >O JDA CH=FDE?I E>H=HO J
      =EJ=E JDA BJ ?=?DA
       ) Subfont EI = IAJ B E=CAI BH = ?JECKKI H=CA B ?D=H=?JAHI IJHA@ =I = IECA E=CA MEJD
       JDA ?D=H=?JAHI F=?A@ IE@A>OIE@A  = ? >=IAEA 1J EI @AI?HE>A@ >O JDA BMEC @=J=
       IJHK?JKHAI
              typedef
              struct Fontchar {
                  int      x;                    /*   left edge of bits */
                  uchar    top;                  /*   first non−zero scan−line */
                  uchar    bottom;               /*   last non−zero scan−line */
                  char     left;                 /*   offset of baseline */
                  uchar    width;                /*   width of baseline */
              } Fontchar;

              typedef
              struct Subfont {
                  char     *name;
                  short    n;                    /*   number of chars in subfont */
                  uchar    height;               /*   height of image */
                  char     ascent;               /*   top of image to baseline */
                  Fontchar *info;                /*   n+1 Fontchars */
                  Image    *bits;                /*   of font */
              } Subfont;
       6DA E=CA BEI JDA HA?J=CA (0, 0, w, height) MDAHA w EI JDA IK B JDA DHEJ=
       ANJAJI B AH FENAI BH = ?D=H=?JAHI 6DA FENAI J >A @EIF=OA@ BH ?D=H=?JAH c =HA E JDA
       HA?J=CA (i−>x, i−>top, (i+1)−>x, i−>bottom) MDAHA i EI &subfont−>info[c]
       9DA = ?D=H=?JAH EI @EIF=OA@ =J Point p E = E=CA JDA ?D=H=?JAH HA?J=CA EI F=?A@ =J
       (p.x+i−>left, p.y) =@ JDA ANJ ?D=H=?JAH B JDA IJHEC EI @EIF=OA@ =J (p.x+i−>width,
       p.y) 6DA >=IAEA B JDA ?D=H=?JAHI EI ascent HMI @M BH JDA JF B JDA IK>BJ E=CA
       6DA info =HH=O D=I n+1 AAAJI A A=?D BH ?D=H=?JAHI  J n−1 FKI = =@@EJE= AJHO I
       JDA IEA B JDA =IJ ?D=H=?JAH ?= >A ?=?K=JA@ 6DKI JDA ME@JD w B JDA Image =II?E=JA@ MEJD =
       Subfont s EI s−>info[s−>n].x
       ) Font ?IEIJI B = LAH= DAECDJ =@ =I?AJ =@ = ?A?JE B IK>BJI JCAJDAH MEJD JDA
       H=CAI B HKAI IAA utf$ JDAO HAFHAIAJ .JI =HA @AI?HE>A@ >O JDA BMEC IJHK?JKHAI
              typedef
              struct Cachefont {
                  Rune      min;                   /* value of 0th char in subfont */



                                                    !"
+)+0-+0)45                                                                              +)+0-+0)45 



                Rune              max;      /* value+1 of last char in subfont */
                int               offset;   /* posn in subfont of char at min */
                char              *name;    /* stored in font */
                char              *subfontname;/* to access subfont */
            } Cachefont;

            typedef
            struct Cacheinfo {
                ushort    x;                     /*   left edge of bits */
                uchar     width;                 /*   width of baseline */
                schar     left;                  /*   offset of baseline */
                Rune      value;                 /*   of char at this slot in cache */
                ushort    age;
            } Cacheinfo;

            typedef
            struct Cachesubf {
                ulong     age;                   /* for replacement */
                Cachefont *cf;                   /* font info that owns us */
                Subfont   *f;                    /* attached subfont */
            } Cachesubf;

            typedef
            struct Font {
                char              *name;
                Display           *display;
                short             height;   /*        max ht of image;interline space*/
                short             ascent;   /*        top of image to baseline */
                short             width;    /*        widest so far; used in caching */
                short             nsub;     /*        number of subfonts */
                ulong             age;      /*        increasing counter; for LRU */
                int               ncache;   /*        size of cache */
                int               nsubf;    /*        size of subfont list */
                Cacheinfo         *cache;
                Cachesubf         *subf;
                Cachefont         **sub;    /*        as read from file */
                Image             *cacheimage;
            } Font;
     6DA height =@ ascent BEA@I B .J =HA @AI?HE>A@ E graphics  Sub ?J=EI nsub FEJ
     AHI J Cachefonts ) Cachefont ?A?JI HKAI min JDHKCD max E?KIELA J JDA IK>BJ
     MEJD BEA =A name EJ ?HHAIF@I J = EA B JDA BEA @AI?HE>EC JDA BJ
     6DA ?D=H=?JAHI =HA J=A BH JDA IK>BJ IJ=HJEC =J ?D=H=?JAH K>AH offset KIK=O AH E
     JDA IK>BJ FAHEJJEC IAA?JE B F=HJI B IK>BJI 6DKI JDA E=CA BH HKA r EI BK@ E FIE
     JE r−min+offset B JDA IK>BJ
     .H A=?D BJ JDA E>H=HO MEJD IKFFHJ BH JDA CH=FDE?I IAHLAH =EJ=EI = ?=?DA B IK>BJI
     =@ = ?=?DA B HA?AJO KIA@ ?D=H=?JAH E=CAI 6DA subf =@ cache BEA@I =HA KIA@ >O JDA
     E>H=HO J =EJ=E JDAIA ?=?DAI 6DA width B = BJ EI JDA =NEK B JDA DHEJ= ANJAJI
     B JDA ?D=H=?JAHI E JDA ?=?DA String @H=MI = IJHEC >O =@EC JDA ?=?DA =@ AEJJEC = IAGKA?A
     B ?=?DA E@E?AI J @H=M Cachechars CK=H=JAAI JDA E=CAI BH JDA ?D=H=?JAHI FEJA@ J >O *s H
     *r A B JDAIA KIJ >A E E A=?D ?= =HA E JDA ?=?DA B f 1J ?=I loadchar J FKJ EIIEC ?D=H
     =?JAHI EJ JDA ?=?DA Cachechars JH=I=JAI JDA ?D=H=?JAH IJHEC EJ = IAJ B ?=?DA E@E?AI MDE?D
     EJ =@I EJ JDA =HH=O c KF J = =NEK B n E@E?AI H JDA ACJD B JDA IJHEC Cachechars
     HAJKHI E c JDA K>AH B ?=?DA E@E?AI AEJJA@ KF@=JAI *s J FEJ J JDA ANJ ?D=H=?JAH J >A
     FH?AIIA@ =@ IAJI *widp J JDA JJ= ME@JD B JDA ?D=H=?JAHI FH?AIIA@ Cachechars =O HAJKH
     >ABHA JDA A@ B JDA IJHEC EB EJ ?=J FH?AA@ MEJDKJ @AIJHOEC =?JELA @=J= E JDA ?=?DAI 1B EJ
     AA@I J =@ = AM IK>BJ EJ ME BE *sfname MEJD JDA =A B JDA IK>BJ EJ AA@I =@ HAJKH
        1J ?= HAJKH AH EB EJ EI K=>A J =A FHCHAII >A?=KIA EJ ?=J HAIEA JDA ?=?DAI




                                                  !#
+)+0-+0)45                                                                               +)+0-+0)45 



       Loadchar =@I = ?D=H=?JAH E=CA EJ JDA ?D=H=?JAH ?=?DA 6DA EJ JAI JDA CH=FDE?I IAHLAH J
       ?FO JDA ?D=H=?JAH EJ FIEJE h E JDA ?D=H=?JAH ?=?DA 1B JDA ?KHHAJ BJ width EI I=AH JD=
       JDA DHEJ= ANJAJ B JDA ?D=H=?JAH >AEC =@A@ loadfont ?A=HI JDA ?=?DA =@ HAIAJI EJ J
       =??AFJ ?D=H=?JAHI MEJD JDA >ECCAH ME@JD KAII noclr EI IAJ E MDE?D ?=IA EJ KIJ HAJKHI  1B JDA
       ?D=H=?JAH @AI J ANEIJ E JDA BJ =J = loadfont HAJKHI  EB EJ EI K=>A J =@ JDA ?D=H=?JAH
       MEJDKJ @AIJHOEC ?=?DA@ EBH=JE EJ HAJKHI  KF@=JEC *sfname =I @AI?HE>A@ =>LA 1J
       HAJKHI  J E@E?=JA IK??AII
       6DA age BEA@I HA?H@ MDA IK>BJI =@ ?D=H=?JAHI D=LA >AA KIA@ 6DA BJ age EI E?HA=IA@
       ALAHO JEA JDA BJ EI KIA@ agefont @AI JDEI ) ?D=H=?JAH H IK>BJ age EI IAJ J JDA BJ =CA
       =J A=?D KIA 6DKI ?D=H=?JAHI H IK>BJI MEJD I= =CAI =HA JDA >AIJ ?=@E@=JAI BH HAF=?AAJ
       MDA JDA ?=?DA EI BK
SOURCE
     /sys/src/libdraw
SEE ALSO
      graphics  allocimage  draw  subfont  image$ font$
DIAGNOSTICS
     ) B JDA BK?JEI KIA JDA CH=FDE?I AHHH BK?JE IAA graphics 




                                                    !$
+0,14                                                                                          +0,14 




NAME
       ?D@EH   ?D=CA MHEC @EHA?JHO
SYNOPSIS
     #include <u.h>
     #include <libc.h>
       int chdir(char *dirname)
DESCRIPTION
      Chdir ?D=CAI JDA MHEC @EHA?JHO B JDA ELEC FH?AII J dirname 6DA MHEC @EHA?JHO EI
      JDA IJ=HJEC FEJ BH AL=K=JEC BEA =AI JD=J @ J >ACE MEJD / H # =I ANF=EA@ E intro 
      9DA 2= ' >JI JDA EEJE= FH?AII D=I / BH EJI MHEC @EHA?JHO
SOURCE
     /sys/src/libc/9syscall
SEE ALSO
      intro 
DIAGNOSTICS
     5AJI errstr




                                                   !%
+-))-                                                                               +-))- 




NAME
       ?A==A    ?A= = F=JD =A
SYNOPSIS
     #include <u.h>
     #include <libc.h>

       char*          cleanname(char *filename)
DESCRIPTION
      Cleanname J=AI = filename =@ >O ANE?= FH?AIIEC O HAJKHI JDA IDHJAIJ IJHEC JD=J =AI
      JDA I=A FIIE>O DOFJDAJE?= BEA 1J AEE=JAI KJEFA =@ JH=EEC I=IDAI =@ EJ ANE?=O
      EJAHFHAJI . =@ .. @EHA?JHO ?FAJI E JDA =A 6DA IJHEC EI LAHMHEJJA E F=?A
       6DA IDHJAIJ IJHEC cleanname ?= HAJKH EI JM >OJAI JDA KJAHE=JA@ IJHEC "." 6DAHABHA
       filename KIJ ?J=E H BH =J A=IJ JM >OJAI
SOURCE
     /sys/src/libc/port/cleanname.c
SEE ALSO
      cleanname




                                                   !&
+4                                                                                       +4 




NAME
       ?=F HC> ?=F HC>= HC> ?=F      ?HI =@ ?H =FI
SYNOPSIS
     #include <u.h>
     #include <libc.h>
     #include <draw.h>
       int    rgb2cmap(int red, int green, int blue)
       int    cmap2rgb(int col)
       int    cmap2rgba(int col)
DESCRIPTION
      6DAIA HKJEAI ?LAHJ >AJMAA JHKA ?H HA@CHAA>KA JHEFAI =@ JDA 2= ' ?H =F 5AA
      color$ BH = @AI?HEFJE B 4/*8 JDA IJ=@=H@ ?H =F
       Rgb2cmap J=AI = JHE B ?H L=KAI I?=A@ BH   EJAIEJO J ## BK EJAIEJO =@
       HAJKHI JDA E@AN B JDA ?H E 4/*8 ?IAIJ J JD=J HAFHAIAJA@ >O JDIA L=KAI
       Cmap2rgb @A?FIAI JDA ?H B 4/*8 E@AN col =@ HAJKHI = ">EJ EJACAH MEJD JDA M &
       >EJI HAFHAIAJEC JDA >KA L=KA JDA ANJ & HAFHAIAJEC CHAA =@ JDA ANJ & HAFHAIAJEC HA@
       Cmap2rgba @A?FIAI JDA ?H B 4/*8 E@AN col =@ HAJKHI = ! >EJ EJACAH MEJD JDA M &
       >EJI HAFHAIAJEC = =FD= L=KA @ABEA@ J >A ## =@ JDA ANJ & HAFHAIAJEC >KA JDA CHAA
       JDA HA@ =I BH cmap2rgba IDEBJA@ KF & >EJI 6DEI ! >EJ HAFHAIAJ=JE EI JDA BH=J KIA@ >O
       draw  =@ memdraw  E>H=HO HKJEAI JD=J J=A ?HI =I =HCKAJI
SOURCE
     /sys/src/libdraw
SEE ALSO
      graphics  allocimage  draw  image$ color$




                                                  !'
+2-6-                                                                                      +2-6- 




NAME
       ?FAJA    BEA =A ?FAJE
SYNOPSIS
     #include <u.h>
     #include <libc.h>
     #include <complete.h>
       typedef struct CompletionCompletion;
       struct Completion{
           uchar advance; /* whether forward progress has been made */
           uchar complete; /* whether the completion now represents a file or director
           char *string;   /* the string to advance, suffixed " " or "/" for file or d
           int nmatch;     /* number of files that matched */
           int nfile;      /* number of files returned */
           char **filename;/* their names */
       };

       Completion* complete(char *dir, char *s);
       void freecompletion(Completion *c);
DESCRIPTION
      6DA complete BK?JE EFAAJI BEA =A ?FAJE /ELA = @EHA?JHO dir =@ = IJHEC s EJ
      HAJKHI = ==OIEI B JDA BEA =AI E JD=J @EHA?JHO JD=J >ACE MEJD JDA IJHEC s 6DA BEA@I
      nmatch =@ nfile ME >A IAJ J JDA K>AH B BEAI JD=J =J?D JDA FHABEN =@ filename ME
      >A BEA@ E MEJD JDAEH =AI 1B JDA BEA =A@ EI = @EHA?JHO = I=ID ?D=H=?JAH ME >A =FFA@A@ J
      EJ
       1B  BEAI =J?D JDA IJHEC nmatch ME >A AH >KJ complete ME HAJKH JDA BK IAJ B BEAI E JDA
       @EHA?JHO MEJD nfile IAJ J JDAEH K>AH
       6DA B=C advance HAFHJI MDAJDAH JDA IJHEC s ?= >A ANJA@A@ MEJDKJ ?D=CEC JDA IAJ B BEAI
       JD=J =J?D 1B JHKA string ME >A IAJ J JDA ANJAIE JD=J EI JDA L=KA B string =O >A
       =FFA@A@ J s >O JDA ?=AH J ANJA@ JDA A>HOE? BEA =A K=>ECKKIO
       6DA B=C complete HAFHJI MDAJDAH JDA ANJA@A@ BEA =A KEGKAO E@AJEBEAI = BEA 1B JHKA
       string ME >A IKBBENA@ MEJD = >= H = I=ID =@ = >= @AFA@EC  MDAJDAH JDA HAIKJEC
       BEA =A E@AJEBEAI = F=E BEA H = @EHA?JHO
       6DA freecompletion BK?JE BHAAI = Completion IJHK?JKHA =@ EJI ?JAJI
       1 rio =@ acme BEA =A ?FAJE EI JHECCAHA@ >O = ?JH. ?D=H=?JAH H = 1IAHJ ?D=H
       =?JAH
SOURCE
     /sys/src/libcomplete
SEE ALSO
      rio acme
DIAGNOSTICS
     6DA complete BK?JE HAJKHI = K FEJAH =@ IAJI errstr EB JDA @EHA?JHO EI KHA=@=>A H JDAHA
     EI IA JDAH AHHH
BUGS
       6DA >AD=LEH B BEA =A ?FAJE IDK@ >A ?JHA@ >O JDA FK>AH




                                                     ! 
+64                                                                                           +64 




NAME
       +JH +JHIAJ =?JEL=JA ?IA?JH ?IA?JHIAJ ?JH?=A@ ?JHMEHA ?HA=JA>N
       ?HA=JA>N>N ?HA=JA>KJJ ?HA=JA?K ?HA=JAAJHO ?HA=JAAO>=H@ ?HA=JA=>A ?HA=JAAK
       ?HA=JAH=@E>KJJ ?HA=JAHM ?HA=JAI?HE>>A ?HA=JAIE@AH ?HA=JAIJ=? ?HA=JAJ=> ?HA=JAJANJ ?HA
       =JAJANJ>KJJ ?JAHHH ?J=? ?JHA=? ?JIJH@KF ?JFHEJ @A=?JEL=JA BHAA?JBJ BHAA?JE=CA
       EEJ?JHI =A?JBJ =A?JE=CA AM?JHIAJ HAIEA?JHIAJ             EJAH=?JELA CH=FDE?=
       ?JHI
SYNOPSIS
     #include        <u.h>
     #include        <libc.h>
     #include        <draw.h>
     #include        <thread.h>
     #include        <keyboard.h>
     #include        <mouse.h>
     #include        <control.h>
       typedef struct Control Control;
       typedef struct Controlset Controlset;
       struct Control
       {
          char    *name;
          Rectangle rect;            /*   area on screen          */
          Rectangle size;            /*   min/max Dx, Dy          (not a rect) */
          Channel *event;            /*   chan(char*) to          client */
          Channel *data;             /*   chan(char*) to          client */
          ...
       };
       struct Controlset
       {
          ...
          Channel     *ctl;
          Channel     *data;
          ...
          int   clicktotype;
          ...
       };
       void         initcontrols(void)
       Controlset*newcontrolset(Image *i, Channel *kc, Channel *mc, Channel *rc)
       void         closecontrolset(Controlset *cs)
       int          namectlfont(Font *font, char *name)
       int          freectlfont(char *name)
       int          namectlimage(Image *image, char *name)
       int          freectlimage(char *name)
       Control* createbox(Controlset *cs, char *name)
       Control* createboxbox(Controlset *cs, char *name)
       Control* createbutton(Controlset *cs, char *name)
       Control* createcolumn(Controlset*, char*)
       Control* createentry(Controlset *cs, char *name)
       Control* createkeyboard(Controlset *cs, char *name)
       Control* createlabel(Controlset *cs, char *name)
       Control* createmenu(Controlset *cs, char *name)
       Control* createradiobutton(Controlset *cs, char *name)
       Control* createrow(Controlset*, char*)


                                                      ! 
+64                                                                                       +64 



       Control* createscribble(Controlset *cs, char *name)
       Control* createslider(Controlset *cs, char *name)
       Control* createstack(Controlset*, char*)
       Control* createtab(Controlset*, char *)
       Control* createtext(Controlset *cs, char *name)
       Control* createtextbutton(Controlset *cs, char *name)
       void         closecontrol(Control *c)
       int          ctlprint(Control*, char*, ...);
       void         ctlerror(char *fmt, ...)
       Control* controlcalled(char *name)
       void         controlwire(Control *c, char *cname, Channel *ch)
       void         activate(Control *c)
       void         deactivate(Control *c)
       void         resizecontrolset(Controlset *cs)
       void*        ctlmalloc(uint n)
       void*        ctlrealloc(void *p, uint n)
       char*        ctlstrdup(char *s)
       int          ctldeletequits;
DESCRIPTION
      6DEI E>H=HO FHLE@AI = IAJ B EJAH=?JELA ?JHI BH CH=FDE?= @EIF=OI >KJJI IE@AHI JANJ AJHO
      >NAI =@ I  1J =I FHLE@AI =CCHAC=JH ControlI >NAI ?KI HMI =@ IJ=?I B
      ControlI ) IJ=? EI = ?A?JE B ??=JA@ ControlI B MDE?D A EI H=O LEIE>A )
      Controlset ?A?JI = CHKF B ControlI JD=J ID=HA KIA =@ AO>=H@ -=?D
      Controlset D=I = IAF=H=JA JDHA=@ B ?JH JD=J FH?AIIAI AO>=H@ =@ KIA ALAJI =I MA
      =I ?=@I J >A F=IIA@  J JDA ControlI 5E?A A=?D Controlset KIAI = JDHA=@ FH
      CH=I KIEC JDA ?JH E>H=HO KIJ >A EA@ MEJD JDA JDHA=@ E>H=HO thread 
       ControlI =HA =EFK=JA@ >O HA=@EC =@ MHEJEC J JDA ?JH ?D=A ctl B JDAEH
       Controlset ChannelI =HA @ABEA@ E thread  -=?D Control D=I JM KJFKJ ?D=AI
       Event @AELAHI AII=CAI =>KJ =?JEI MEJDE JDA ?JH IK?D =I = >KJJ FHAII =@ data
       @AELAHI EB HAGKAIJA@ >O = =FFHFHE=JA MHEJA J ctl ?JHIFA?EBE? @=J= IK?D =I JDA ?JAJI B
       = BEA@
       6DA E>H=HO FHLE@AI = IEFA A?D=EI BH =KJ=JE? =OKJ JDA EEK =@ =NEK IEAI
       B A=?D IEFA ?JH ?= >A IFA?EBEA@ Boxbox row column =@ stack ControlI JDA
       KIA JDAIA IEAI J =O KJ JDAEH ?IJEJKAJ ControlI MDA ?=A@ KF J @ I 5AA JDA @AI?HEF
       JE B JDAIA CHKFEC ControlI BH BKHJDAH @AJ=EI
   Message format
      ) AII=CAI =HA HAFHAIAJA@ =I 76.& JANJ K>AHI =HA BH=JJA@ E @A?E= =@ IJHECI =HA
      JH=IEJJA@ E JDA GKJA@ BH B quote 
       AII=CAI IAJ J = Controlset =HA B JDA BH
               sender destination verb argument  
       6DA IA@AH =@ JDA ? BMEC EJ =O >A EJJA@ .H AN=FA JDA EEJE= BEA@ B = JANJ
       AJHO ?JH ?=A@ entry ?K@ >A IAJ >O IA@EC JDA AII=CA
               entry value ’Hello, world!’
       J EJI Controlset I ctl BEA 6DEI AII=CA ?J=EI JDA LAH> value =@ JDA IECA =HCKAJ
       Hello, world!
       6 =A EJ A=IO J MHEJA AII=CAI JDA BK?JE chanprint IAA thread  ?= >A KIA@ J FHEJ BH
       =JJA@ JANJ J = Controlset I ?D=A
       6DA %q =@ %Q BH=JI =HA ?LAEAJ BH FHFAHO GKJEC IJHEC =HCKAJI =I E
               chanprint(e−>event, "value %q", "Don’t touch!");




                                                    !
+64                                                                                      +64 



      1J EI MEIA J KIA %q =M=OI EIJA=@ B %s MDA IA@EC AII=CAI =@ =LE@ @A=EC MEJD JDA GKJ
      EC ANFE?EJO 1 JDA JDAH @EHA?JE tokenize IAA getfields  F=HIAI JDAIA AII=CAI =@
      EJAHFHAJI JDA GKJAI ?HHA?JO
      6DA @AIJE=JE B = AII=CA ?= >A = =A@ ?JH H = IAJ B ?JHI E@AJEBEA@ >O =A H
      JOFA 6DA ?=@
             ’entry slider’ show
      JA JDA GKJ=JE IA@I JDA IDM ?=@ J JDA AJHO =A@ entry =@ = ?JHI B JOFA
      slider 1B JDAHA MAHA = ?JH MDIA =A M=I slider JD=J ?JH MK@ =I >A IDM
      Note that we are still experimenting with destination names. One proposal is that a destination of
      the form  =A =A  JOFA JOFA  selects all controls of the named types in the control
      hierarchies (of columns, rows and stacks) whose names precede the types.
      AII=CAI IAJ >O = ?JH  EJI event ?D=A =HA B JDA BH
             sender: event
      6DA sender EI JDA =A B JDA ?JH IA@EC JDA AII=CA JDA event @AI?HE>AI JDA ALAJ 1JI BH
      =J ?= BJA >A ?JHA@ >O IAJJEC JDA Control I format string .H AN=FA MDA JDA KIAH
      JOFAI = AMEA =J = JANJ AJHO Control =A@ entry, JDA ?JH IA@I JDA AII=CA
             entry: value ’Hello again!’  EJI event ?D=A
  Initialization and Control sets
       )BJAH initdraw IAA graphics  EI ?=A@ JDA BK?JE initcontrols IDK@ >A ?=A@ J EEJE=EA
       JDA E>H=HO 1J ?=I quotefmtinstall J EIJ= JDA %q =@ %Q BH=JI IAA quote 
      -=?D ?JH EI HAFHAIAJA@ >O = Control @=J= IJHK?JKHA =@ EI =II?E=JA@ MEJD = Controlset
      JD=J CHKFI = IAJ B ?JHI ID=HEC KIA AO>=H@ =@ @EIF=O IJ =FFE?=JEI ME AA@
      O A Controlset O JDIA MEJD KJEFA ME@MI H KKIK= ?BECKH=JEI ME AA@
      HA JD= A 6DA BK?JE newcontrolset ?HA=JAI = Controlset 1JI =HCKAJI =HA JDA E=CA
      KIK=O = ME@M  MDE?D EJI ?JHI ME =FFA=H JOFE?=O JDA screen L=HE=>A E JDA @H=M
      E>H=HO =@ JDHAA ?D=AI kc = ?D=A B Runes BH JDA AO>=H@ mc = ?D=A B Mouse
      IJHK?JKHAI BH JDA KIA =@ rc = ?D=A B int JD=J E@E?=JAI MDA JDA ME@M D=I >AA
      HAIEA@ )O B JDA ?D=AI =O >A E E MDE?D ?=IA newcontrolset ME ?= initkeyboard
      =@H initmouse IAA keyboard   =@ mouse  J EEJE=EA JDA AO>=H@ =@ KIA =@
      ?A?J JDA J JDA ?JH IAJ 6DA KIA =@ HAIEA ?D=AI KIJ >JD >A E H >JD >A 
      E
      6DA BK?JE closecontrolset BHAAI = JDA ?JHI E JDA ?JH IAJ =@ JA=HI @M = JDA =II?E
      =JA@ JDHA=@I 1J @AI J ?IA JDA KIA =@ AO>=H@
      6DA FK>E? AAAJI B = Controlset =HA JDA B=C clicktotype =@ JDA ctl =@ data ?D=
      AI
      Clicktotype EI AH >O @AB=KJ 1B EJ EI IAJ J AH JDA ?JHI E JDA IAJ ME =?GKEHA B?KI >O
      JDA ?E?JJOFA F=H=@EC JDAHMEIA B?KI EI =M=OI CELA J JDA ?JH K@AH JDA KIA
      +=@I BH ?JHI =HA IAJ JDHKCD JDA Controlset I ctl ?D=A A IFA?E= ?=@
      EI HA?CEA@ >O JDA Controlset EJIAB 5A@EC JDA IJHEC sync J JDA ctl ?D=A ?=KIAI JD=
      IJHEC J >A A?DA@ J JDA Controlset I data ?D=A MDA = ?=@I KF J JDA sync ?
      =@ D=LA >AA FH?AIIA@ 6DA IJHEC EI =?=JA@ =@ KIJ >A BHAA@ IAA malloc  5O?DH
      E=JE EI A?AII=HO >AJMAA IA@EC = ?=@ BH AN=FA J HAIEA = ?JHI =@ KIEC
      JDAEH rect BEA@I
      6DA BK?JE resizecontrolset KIJ >A FHLE@A@ >O JDA KIAH 9DA JDA =II?E=JA@ ME@M EI
      HAIEA@ JDA E>H=HO ME ?= resizecontrolset MEJD JDA =BBA?JA@ Controlset JDA BK?JE IDK@
      HA?A?J J =@ HA@H=M JDA ME@M
      1B = ME@MI =HA HC=EA@ E = DEAH=?DO B boxboxes columns rows =@ stacks =@ EEK
      =@ =NEK IEAI D=LA =HA=@O >AA IKFFEA@ O JDA JF ?JH AA@I J >A HAIEA@ IAA JDA
      rect ?=@ >AM
  Fonts and images
      .JI =@ E=CAI KIJ >A CELA =AI I JDAO =O >A HABAHA?A@ E AII=CAI 6DA BK?JEI
      namectlfont =@ namectlimage =II?E=JA = KEGKA =A MEJD JDA IFA?EBEA@ BJ H E=CA 6DA
      =II?E=JE EI HALA@ >O freectlfont =@ freectlimage 6DA BJ H E=CA EI J BHAA@ >O JDAIA


                                                   ! !
+64                                                                                       +64 



      BK?JEI DMALAH
      6DA BK?JE initcontrols AIJ=>EIDAI =A >E@ECI BH = JDA ?HI AJEA@ E <draw.h>
      IK?D =I black white red yellow AJ? =I MA =I =II transparent =@ opaque 1J
      =I IAJI JDA =A font J HABAH J JDA @AB=KJ font L=HE=>A IAJ KF >O initdraw
  Creation
      -=?D JOFA B ?JH D=I = =II?E=JA@ ?HA=JE BK?JE createbutton createentry AJ? MDIA
      =HCKAJI =HA JDA Controlset J =JJ=?D EJ J =@ = C>=O KEGKA =A BH EJ ) ?JH =O
      >A @AIJHOA@ >O ?=EC closecontrol
      6DA BK?JE controlcalled HAJKHI = FEJAH J JDA Control MEJD JDA CELA name H E EB  IK?D
      ?JH ANEIJI
  Configuration
     )BJAH = ?JH EI ?HA=JA@ EJ KIJ >A ?BECKHA@ KIEC JDA ?JHIFA?EBE? ?=@I @?KAJA@
     >AM +=@I =HA IAJ J JDA ctl ?D=A B JDA Controlset KJEFA ?=@I =O >A
     IAJ E = IECA AII=CA AMEA ?D=H=?JAHI IAF=H=JA ?=@I .H = AN=FA IAA JDA EFA
     AJ=JE B resizecontrolset E JDA EXAMPLES IA?JE JA JD=J AMEA EI = IAF=H=JH J =
     JAHE=JH JDA BE= ?=@ @AI J AA@ = AMEA
      AII=CAI IAJ J JDA ctl ?D=A =HA @AELAHA@ J = ?JHI JD=J =J?D JDA destination BEA@ 6DEI
      BEA@ EI = IAJ B =AI IAF=H=JA@ >O IF=?AI J=>I H AMEAI ) ?JH =J?DAI JDA @AIJE=JE EB
      EJI =A H EJI JOFA EI =C JDA IAJ
      6DA HA?EFEAJ B = AII=CA ECHAI JDA EEJE= sender: BEA@ B JDA AII=CA EB FHAIAJ =EC EJ
      FIIE>A J IA@ AII=CAI CAAH=JA@  = event ?D=A @EHA?JO J =JDAH ?JH I ctl
      ?D=A
  Activation
      9DA JDAO =HA ?HA=JA@ ?JHI =HA @EI=>A@ JDAO @ J HAIF@ J KIAH EFKJ J = ?JHI
      AA@ J >A HAIFIELA BH AN=FA =>AI =HA IJ=JE? =@ = JANJ @EIF=O ECDJ IDM = C B AI
      I=CAI >KJ J >A KIABK J A@EJ *KJ >KJJI AJHO >NAI =@ JDAH JANJ @EIF=OI IDK@ >A =?JELA
      6 A=>A = ?JH ?= JDA activate BK?JE MDE?D IFA?EBEAI JD=J JDA Control c IDK@ HAIF@
      J KIA =@ AO>=H@ ALAJI deactivate JKHI EJ BB =C=E
      +JHI ?= >A AEJDAH revealed @AB=KJ H hidden 9DA = ?JH EI DE@@A EJ ME J HA?AELA
      KIA H AO>=H@ ALAJI =@ IJ=JA ?D=CAI H show ?=@I ME >A ECHA@ KJE JDA ?JH
      EI ?A =C=E revealed  +JH DE@EC EI F=HJE?K=HO KIABK MDA @EBBAHAJ ?JHI =HA LAH=OA@
      HALA=EC O JDA JF A
      6DA BK?JE controlwire FAHEJI HA=HH=CAAJ B JDA ?D=AI =II?E=JA@ MEJD = Control 6DA
      ?D=A cname A B "data" H "event" B Control c EI HA=IIECA@ J JDA ?D=A ch
      6DAHA =HA IALAH= KIAI BH JDEI FAH=JE A =O HA=IIEC = JDA event ?D=AI J = IECA
      ?D=A E ABBA?J KJEFANEC = JDA ALAJI J = IECA ?D=A H ?A?J JDA event ?D=A
      B = IE@AH J JDA ctl ?D=A BH @AELAHO J = JANJ @EIF=O =BJAH IAJJEC JDA BH=J BH JDA IE@AH I
      AII=CAI J =A JDA @AIJE=JE ?JH =@ JDA =FFHFHE=JA IOJ=N BH JDA HAIJ B JDA ?=@
      J AJ JDA IE@AH =?J =I = I?H >=H BH JDA JANJ MEJDKJ HAHKJEC JDA AII=CAI ANFE?EJO
  Controls
     6DA BMEC IA?JEI @?KAJ JDA E@ELE@K= ?JHI E =FD=>AJE?= H@AH 6DA =OKJ B A=?D
     IA?JE EI = >HEAB @AI?HEFJE B JDA ?JH I >AD=LEH BMA@ >O JDA AII=CAI EJ IA@I 
     event BMA@ >O JDA AII=CAI EJ =??AFJI LE= JDA ctl ?D=A 6DA event AII=CAI =HA JHEC
     CAHA@ only >O KIA H AO>=H@ =?JE AII=CAI J JDA ctl BEA @ J ?=KIA ALAJI J >A CA
     AH=JA@
      ) ?JHI =??AFJ JDA BMEC AII=CAI
      rect minx miny maxx maxy
                5AJ JDA >K@EC HA?J=CA BH JDA ?JH  JDA @EIF=O 6DA IOJ=N CAAH=JA@ >O JDA
                %R FHEJ BH=J B JDA @H=M E>H=HO EI =I =??AFJ=>A BH JDA ?H@E=JAI
      size  min x min y max x max y 
                5AJ JDA EEK =@ =NEK IEA BH =KJ=JE? =OKJ E columns rows =@ stacks
                9EJDKJ EJI BKH =HCKAJI JDEI ?=@ EI ECHA@ >O FHEEJELA ?JHI =@ KIA@ >O
                CHKFEC ?JHI J ?=?K=JA JDAEH EEK =@ =NEK IEAI >O AN=EEC JDIA
                B JDAEH ?IJEJKAJ A>AHI 1B = FHEEJELA ?JHI D=LA >AA =IIECA@ = IEA =



                                                    ! "
+64                                                                                    +64 



                   IECA IEA HAGKAIJ =@@HAIIA@ J JDA JF B = =OKJ DEAH=H?DO ME =IIEC IEAI J =
                   CHKFEC ControlI
        hide       ,EI=>A @H=MEC B JDA ?JH =@ ECHA KIA =@ AO>=H@ ALAJI KJE JDA ?JH
                   EI ?A =C=E HALA=A@ /HKFEC ControlI column row =@ stack F=II JDA
                   HAGKAIJ @M J JDAEH ?IJEJKAJ ControlI
        reveal     6DEI EI JDA FFIEJA B hide JDA Control EI @EIF=OA@ =@ KIA =@ AO>=H@
                   FAH=JEI HAIKA /HKFEC ControlI column row =@ stack F=II JDA HAGKAIJ
                   @M J JDAEH ?IJEJKAJ ControlI 6DA reveal ?=@ BH stacks J=AI =
                   FJE= =HCKAJ =EC JDA Control J >A HALA=A@ = JDAH ControlI ME >A
                   DE@@A
        show       ,EIF=O JDA Control  EJI I?HAA EB J DE@@A 5A =?JEI ME =I ?=KIA JDA
                   ControlI J IDM JDAIALAI =KJ=JE?=O >KJ ALAH MDA JDA control EI DE@
                   @A /HKFEC ControlI column row =@ stack F=II JDA HAGKAIJ @M J JDAEH
                   ?IJEJKAJ ControlI
        =O AII=CAI =HA ? >AJMAA KJEFA ControlI 5K?D AII=CAI =HA @AI?HE>A@ E @AJ=E
        DAHA J =LE@ HAFAJEJE 1 JDA E@ELE@K= @AI?HEFJEI O JDA IOJ=N EI FHAIAJA@
        align n      5FA?EBO JDA =ECAJ B IA F=HJ B JDA Control I @EIF=O MEJDE EJI HA?J=
                     CA .H JANJK= controlI JDA =ECAJ IFA?EBEAI MDAHA JDA JANJ IDK@
                     =FFA=H .H KJEEA JANJ JDA =ECAJ HABAHI J A=?D EA MEJDE EJI >N =@
                     O JDA DHEJ= F=HJ EI DHA@ .H JDAH ControlI JDA =ECAJ =BBA?JI
                     JDA =FFA=H=?A B JDA @EIF=O E = HA=I=>A M=O 6DA L=E@ =ECAJI =HA
                     MH@I     MEJD    >LEKI     EJAHFHAJ=JEI upperleft         uppercenter
                     upperright centerleft center centerright lowerleft,
                     lowercenter =@ lowerright
        border n     1IAJ JDA Control H IAF=H=JA ?IJEJKAJ ControlI E boxbox column =@
                     row ControlI =BJAH JDA ANJ rect ?=@ MEJDE EJI HA?J=CA >O n FENAI
                     @AB=KJ AH
        bordercolor name
                     2=EJ JDA >H@AH B JDA ?JH MEJD JDA =A@ ?H @AB=KJ >=?
        focus n      6DA Control M D=I EB n EI AH H @AI J D=LA  EB n EI AH B?KI
                     IJ ControlI ECHA JDA AII=CA JDAHA =HA F=I J =A JDA HA=?J
        format fmt   5AJ JDA BH=J B L=KA AII=CAI IAJ  JDA event ?D=A *O @AB=KJ JDA
                     BH=J EI "%q: value %q" BH IJHECL=KA@ ControlI "%q: value
                     %d" BH EJACAHL=KA@ Control s IK?D =I >KJJI =@ "%q: value
                     0x%x" BH JDA AO>=H@ =@ I?HE>>A ControlI 6DA %q FHEJI JDA =A B
                     JDA Control JDA HAIJ JDA L=KA )O IKFFEA@ BH=J IJHEC KIJ >A JOFA
                     AGKEL=AJ J JDA @AB=KJ BH JD=J Control
        image name
        light name
        mask name    =O ?JHI IAJ = >=?CHK@ E=CA H ?H BH @EIF=O 6DA image AII=CA
                     IAJI JDA E=CA 6DA mask =@ light E=CAI JCAJDAH IFA?EBO DM JDA
                     Control IDMI EJ EI A=>A@ JDA light EI FHEJA@ JDHKCD JDA mask MDA
                     JDA IJ=JA EI  H FHAIIA@  JDAHMEIA JDA E=CA =FFA=HI K@EBEA@ 6DA
                     @AB=KJ E=CA EI MDEJA =I F=GKA ECDJ OAM
        font name
        textcolor name
                     6DAIA ?=@I IAJ JDA BJ =@ ?H BH @EIF=OEC JANJ 6DA @AB=KJI =HA JDA
                     @AB=KJ font IAJ KF >O JDA @H=M E>H=HO =@ >=?
        value v      5AJ JDA L=KA B JDA Control 6ANJK= E=CAI =??AFJ = =H>EJH=HO IJHEC JDAHI
                     = EJACH= L=KA
  Box
        ) >N EI = JHELE= ?JH JD=J @AI JDEC HA JD= F=II AO>=H@ KIA =@ B?KI AII=CAI
        >=?  EJI event ?D=A AO>=H@ ?D=H=?JAHI =HA IAJ E JDA BH=J
               boxname: key 0xnn
        MDAHA nn EI JDA DAN=@A?E= L=KA B JDA ?D=H=?JAH KIA AII=CAI =HA IAJ E JDA BH=J
               boxname: mouse [x y] but msec




                                                  ! #
+64                                                                                    +64 



      MDAHA x y but =@ msec =HA JDA L=HEKI BEA@I B JDA Mouse IJHK?JKHA 6DA B?KI AII=CA EI
      KIJ
             boxname: focus n
      MDAHA n EI  EB JDA >N D=I IJ B?KI  EB EJ D=I =?GKEHA@ EJ
      6DA >N @EIF=OI MEJDE EJI HA?J=CA = E=CA K@AH =I MEJD IFA?EBEA@ =ECAJ 6DA ?JH
      AII=CAI EJ =??AFJI =HA
      align a    +JHI JDA F=?AAJ B JDA E=CA E JDA HA?J=CA KEFAAJA@
      border b
      bordercolor name
      focus n
      hide
      image name
      rect minx miny maxx maxy
      reveal
      show
      size min x min y max x max y
  Boxbox
     ) boxbox =MI = IAJ B ?JHI  >NAI  J >A @EIF=OA@ E HMI =@ ?KI MEJDE JDA HA?J
     =CA B JDA boxbox 6DA =NEK B JDA EEK DAECDJI B JDA ?IJEJKAJ ?JHI @AJAHEAI
     JDA K>AH B HMI J >A @EIF=OA@ 6DA K>AH B ?KI EI JDA EEK JD=J =MI =
     ControlI J >A @EIF=OA@ 6DEI =CCHAC=JH MHI MA BH ?A?JEI B >KJJI =>AI H
     JANJ>KJJI JD=J = D=LA = BENA@ DAECDJ
      add name ...          =@@I JDA =A@ ?JH J JDA >N B ?JHI 6DA @EIF=O H@AH EI @AJAH
                            EA@ >O JDA H@AH B =@@EC 6DA BEHIJ =A@ ?JH EI JF ABJ JDA IA?@
                            CAI >AM EJ AJ? 1J EI FIIE>A J =@@ A ?JH J KJEFA CHKFEC ?
                            JHI >KJ JDA =OKJ B JDA HAIKJ ME >A GKEJA KFHA@E?J=>A
      border width
      bordercolor color
      hide             6DEI ?=@ EI F=IIA@  J JDA A>AH ?JHI
      image ?H      *=?CHK@ ?H @EIF=OA@ >AJMAA A>AH ?JHI
      reveal           6DEI ?=@ EI F=IIA@  J JDA A>AH ?JHI
      separation width
                       5AJ JDA IAF=H=JE >AJMAA A>AH ?JHI J n FENAI
      rect minx miny maxx maxy
                       6DA A>AH ?JHI =HA =OA@ KJ MEJDE JDA CELA HA?J=CA =??H@EC J JDA
                       EEK =@ =NEK IEAI CELA 1B JDA HA?J=CA EI J =HCA AKCD BH
                       JDA EEK = B=J= AHHH EI ?KHHAJO CAAH=JA@ 1B JDA ?JHI =J JDAEH =NE
                       K IEA =HA J >EC AKCD J BEJ JDAO =HA JFABJ KIJEBEA@ =J JDAEH =NE
                       K IEA E JDA IF=?A CELA JDAHMEIA ?JHI ME CAJ JDAEH EEK IEA
                       =@ >A A=HCA@ FHFHJE= J JDA ANJH= IEA CELA >O JDA =NEK KJE
                       JDAO BEJ CELA HA?J=CA 6DA A>AHI =HA IAF=H=JA@ >O >H@AHI B JDA ME@JD
                       AIJ=>EIDA@ >O borderwidth
      remove name      4ALA JDA =A@ ?JH BH JDA >N
      show             6DEI ?=@ EI F=IIA@  J JDA A>AH ?JHI 5DM =I HA@EIF=OI
                       >=?CHK@ =@ >H@AHI
      size min x min y max x max y
  Button
      ) >KJJ EI = IEFA ?JH JD=J JCCAI EJI IJ=JA MDA KIA >KJJ  EI FHAIIA@  EJI HA?J=CA
      -=?D IJ=JA ?D=CA JHECCAHI = ALAJ AII=CA
             buttonname: value n
             MDAHA n A?@AI JDA KIA >KJJI KIA@ J =A JDA IAA?JE
      6DA >KJJ @EIF=OI = E=CA MDE?D =O B ?KHIA >A = IEFA ?H =@ EKE=JAI E JDA IJ=
      @=H@ M=O MDA EJ EI   6DA ?JH AII=CAI EJ =??AFJI =HA
      align a        +JHI JDA F=?AAJ B JDA E=CA E JDA HA?J=CA KEFAAJA@




                                                     ! $
+64                                                                                   +64 



      border b
      bordercolor name
      focus n
      format fmt
      hide
      image name
      light name
      mask name
      rect minx miny maxx maxy
      reveal
      show
      size min x min y max x max y
      value n     5AJ JDA >KJJ J  EB n EI AH H BB EB n EI AH
  Column
      ) ?K EI = CHKFEC ?JH MDE?D =OI KJ EJI A>AHI LAHJE?=O BH JF J >JJ +KH
      HAJO ?KI ECHA KIA =@ AO>=H@ ALAJI >KJ JDAHA =HA F=I J =M @H=CCEC JDA >H
      @AHI MDA JDAO D=LA AH ME@JD >AJMAA ?IJEJKAJ A>AHI
      add name ...    =@@I JDA =A@ ?JH J JDA ?K B ?JHI 6DA LAHJE?= H@AH EI @AJAH
                      EA@ >O JDA H@AH B =@@EC 6DA BEHIJ =A@ ?JH CAI =J JDA JF 1J EI
                      FIIE>A J =@@ A ?JH J KJEFA CHKFEC ?JHI >KJ JDA =OKJ B JDA
                      HAIKJ ME >A GKEJA KFHA@E?J=>A
      border width    5AJ JDA >H@AH >AJMAA A>AHI J JDA ME@JD CELA
      bordercolor color
      hide
      image ?H     *=?CHK@ ?H @EIF=OA@ >AJMAA A>AH ?JHI
      reveal
      separation width
                      5AJ JDA IAF=H=JE >AJMAA A>AH ?JHI J n FENAI
      show            6DAIA JDHAA ?=@I =HA F=IIA@  J JDA A>AH ?JHI 5DM =I
                      HA@EIF=OI JDA >H@AHI >AJMAA A>AHI
      rect minx miny maxx maxy
                      6DA A>AH ?JHI =HA =OA@ KJ MEJDE JDA CELA HA?J=CA =??H@EC J JDA
                      EEK =@ =NEK IEAI CELA 1B JDA HA?J=CA EI J =HCA AKCD BH
                      JDA EEK = B=J= AHHH EI ?KHHAJO CAAH=JA@ 0MALAH IAA JDA AN=FA =J
                      JDA A@ B JDEI = F=CA 1B JDA ?JHI =J JDAEH =NEK IEA =HA J >EC
                      AKCD J BEJ JDAO =HA ?AJAHA@ =J JDAEH =NEK IEA E JDA IF=?A CELA JD
                      AHMEIA ?JHI ME CAJ JDAEH EEK IEA =@ >A A=HCA@ FHFHJE= J JDA
                      ANJH= IEA CELA >O JDA =NEK KJE JDAO BEJ CELA HA?J=CA 6DA A>AHI
                      =HA IAF=H=JA@ >O >H@AHI B JDA ME@JD AIJ=>EIDA@ >O borderwidth
      remove name     4ALA JDA =A@ ?JH BH JDA ?K
      size  min x min y max x max y 
                      9EJDKJ =HCKAJI JDEI ?=@ ?FKJAI JDA EEK =@ =NEK IEA
                      B = ?K >O =@@EC JDA EEK =@ =NEK DAECDJI J IAJ min y =@
                      max y =@ EJ BE@I JDA =HCAIJ EEK =@ =NEK ME@JDI J IAJ min y
                      =@ max y 9DA ?=A@ MEJD =HCKAJI EJ IEFO IAJI JDA EEK =@ =NE
                      K IEAI J JDIA CELA
  Entry
      6DA AJHO ?JH ==CAI = IECA EA B A@EJ=>A JANJ 9DA JDA KIAH DEJI = ?=HHE=CA HAJKH =O
      MDAHA E JDA JANJ JDA ?JH CAAH=JAI JDA ALAJ AII=CA
             entryname: value s
      MEJD s JDA ?FAJA JANJ B JDA AJHO >N
      6DA ?KHIH ?= >A LA@ >O ?E?EC >KJJ  =J JDA AJ JDAHA EI  M=O J IAA?J ?D=H=?JAHI
      O = JOFEC FIEJE 5A ?JH ?D=H=?JAHI D=LA IFA?E= =?JEI ?JH0 >=?IF=?A
      @AAJAI JDA ?D=H=?JAH >ABHA JDA ?KHIH ?JH7 ?A=HI JDA EA =@ ?JH8 F=IJAI JDA I=HB
      >KBBAH =J JDA JOFEC FIEJE IJ EFHJ=J ?=HHE=CA HAJKH IA@I JDA JANJ J JDA ALAJ ?D=A
      6 AJAH F=IIMH@I =@ JDAH IA?HAJ JANJ MEJDKJ @EIF=OEC JDA ?JAJI IAJ JDA BJ J A E
      MDE?D = ?D=H=?JAHI =HA JDA I=A 6DA A=IEAIJ M=O J @ JDEI EI J =A = BJ ?J=EEC O A


                                                   ! %
+64                                                                                     +64 



      ?D=H=?JAH =J FIEJE  7 IE?A JD=J FIEJE EI KIA@ J HA@AH = ?D=H=?JAHI J JDAHMEIA
      @ABEA@ E JDA BJ IAA draw  6DA BEA /lib/font/bit/lucm/passwd.9.font @ABEAI
      IK?D = BJ
      6DA ?JH AII=CAI JDA AJHO ?JH =??AFJI =HA
      align a     +JHI JDA F=?AAJ B JDA JANJ E JDA HA?J=CA
      border b
      bordercolor name
      data        )BJAH HA?AELEC JDEI AII=CA JDA AJHO ME IA@ EJI L=KA J EJI data ?D=A =I =
                  K=@HA@ KGKJA@ IJHEC
      focus n     9DA EJ HA?AELAI B?KI JDA AJHO >N @EIF=OI = JOFEC ?KHIH 9DA EJ @AI J
                  D=LA B?KI JDA ?KHIH EI J @EIF=OA@
      font name
      format fmt
      hide
      image name
      rect minx miny maxx maxy
      reveal
      show
      size min x min y max x max y
      textcolor name
      value s     5AJ JDA IJHEC @EIF=OA@ E JDA AJHO >N
  Keyboard
     6DA AO>=H@ ?JH EFAAJI = IEK=JA@ AO>=H@ KIABK  F=JF @ALE?AI AOIJHAI
     CAAH=JA@ >O KIA >KJJ   JDA IEK=JA@ AOI =HA IAJ =I ALAJ AII=CAI
             keyboardname: value 0xnn
      MDAHA nn EI JDA DAN=@A?E= 7E?@A L=KA B JDA ?D=H=?JAH 5DEBJ ?JH =@ ?=FI ? =HA D=
      @A@ >O JDA AO>=H@ ?JH EJIAB IDEBJ =@ ?JH =BBA?J O JDA ANJ HACK=H AOIJHA 6DA )J
      AO EI KEFAAJA@ EJ ME >A?A AGKEL=AJ J JDA IJ=@=H@ 2= ' AO BH IOJDAIEEC 
      )5+11 ?D=H=?JAHI
      6DAHA =HA JM IFA?E= AOI Scrib =@ Menu MDE?D HAJKH L=KAI 0x10000 =@ 0x10001
      6DA E=CA =I ECDJ HKAI =HA KIA@ J E@E?=JA JD=J = AO EI FHAIIA@ >KJ J =E@ ?KIO BECAHI
      JDA AOIJHA EI J CAAH=JA@ KJE JDA AO EI HAA=IA@ I EJ EI FIIE>A J IE@A JDA FEJAH J =
      @EBBAHAJ AO J ?HHA?J BH >=@ =E
      6DA ?JH AII=CAI JDA AO>=H@ =??AFJI =HA
      border b
      bordercolor name
      focus n
      font name1 name2
             5AJI JDA BJ BH JDA AOI 1B O A BJ EI =A@ EJ EI KIA@ BH = AOI 1B JM =HA
             =A@ JDA IA?@ EI KIA@ BH AO ?=FI MEJD IFA?E= =AI IK?D =I 5DEBJ =@ -JAH
             /@               ?DE?AI                            JDA           *EJIO           =HA
             /lib/font/bit/lucidasans/boldlatin1.6.font                         BH    JDA  BEHIJ  =@
             /lib/font/bit/lucidasans/unicode.6.font BH JDA IA?@ =HCKAJ 1B
             AEJDAH EI IFA?EBEA@ >JD ME >A IAJ J JDA @AB=KJ C>= BJ
      format fmt
      hide
      image name
      light name
      mask name
      rect minx miny maxx maxy
      reveal
      show
      size minx miny maxx maxy
  Label
     ) =>A EI EA = JANJ>KJJ q.v. JD=J @AI J HA=?J >KJ MDIA L=KA EI JDA JANJ EJ @EIF=OI 6DA



                                                   ! &
+64                                                                                   +64 



      ?JH AII=CAI EJ =??AFJI =HA
      align a    +JHI JDA F=?AAJ B JDA E=CA E JDA HA?J=CA
      border b
      bordercolor name
      focus n
      font name
      hide
      image name
      rect minx miny maxx maxy
      reveal
      show
      size minx miny maxx maxy
      textcolor name
      value s    6DA L=KA EI = IJHEC JD=J ?= >A @EBEA@ O >O IA@EC JDEI AII=CA J JDA ctl
                 BEA
  Menu
     ) AK EI = FFKF ME@M ?J=EEC = IAJ B JANJK= IAA?JEI 9DA = IAA?JE EI =@A EJ
     HALAI EJIAB BH JDA I?HAA =@ HAFHJI JDA IAA?JE >O L=KA
             menuname: value n
      1B  IAA?JE EI =@A  AII=CA EI HAFHJA@ *A?=KIA EJ ?HA=JAI = ME@M FHCH=I KIEC =
      AK KIJ D=LA JDAEH screen L=HE=>A IAA graphics  =@ window  IAJ KF J >A HABHAIDA@
      FHFAHO 6DA A=IEAIJ M=O J @ JDEI EI J ?= getwindow MEJD HABHAID =HCKAJ Refbackup
      IAA graphics  IJ FHCH=I KIA Refnone
      6DA ?JH AII=CAI =??AFJA@ >O = AK =HA
      add text    )@@ = EA B text J JDA A@ B JDA AK
      align a     +JHI JDA ABJHECDJ F=?AAJ B JDA JANJ E EJI HA?J=CA
      border b
      bordercolor name
      focus n
      font name
      format fmt
      hide
      image name
      rect minx miny maxx maxy
      reveal
      size minx miny maxx maxy
                  O JDA HECE B JDA HA?J=CA EI IECEBE?=J AKI ?=?K=JA JDA =FFHFHE=JA IEA
      selectcolor name
                  5AJ JDA ?H E MDE?D J DECDECDJ IAA?JA@ EAI @AB=KJ OAM
      selecttextcolor name
                  5AJ JDA ?H E MDE?D J @H=M JDA JANJ E IAA?JA@ EAI @AB=KJ >=?
      show        ,EIF=O JDA AK J KIK=O AA@A@ KAII JDA AK EI ?D=CA@ MDEA LEIE>A KIA
                  window EIJA=@
      window
      window n    9EJD  =HCKAJI JCCA JDA AK I LEIE>EEJO JDAHMEIA =A EJ LEIE>A  H
                  ELEIE>A  9DA JDA IAA?JE EI =@A JDA AK ME HALA EJI ME@M =KJ=J
                  E?=O
  Radiobutton
     6DA H=@E>KJJ =IIA>AI = CHKF B >KJJI H JANJ>KJJI EJ = IECA ?JH MEJD = KAHE?
     L=KA 1JI L=KA EI  EB A B JDA ?IJEJKAJ >KJJI EI FHAIIA@ JDAHMEIA EJ EI JDA E@AN IJ=HJ
     EC =J AH B JDA >KJJ JD=J EI FHAIIA@ O A >KJJ =O >A FHAIIA@ JDA H=@E>KJJ
     =EFK=JAI EJI >KJJI J CK=H=JAA JDEI 5J=JA ?D=CAI JHECCAH = ALAJ AII=CA
             radiobuttonname: value n
      *KJJI =HA =@@A@ J JDA H=@E >KJJ KIEC JDA add AII=CA JDAHA EI  M=O J HALA JDA
      =JDKCD JDAO =O >A JKHA@ BB E@AFA@AJO KIEC deactivate 6DA E@AN HAFHJA@ E JDA L=KA
      EI @ABEA@ >O JDA H@AH E MDE?D JDA >KJJI =HA =@@A@ 6DA ?IJEJKAJ >KJJI IDK@ >A



                                                  ! '
+64                                                                                   +64 



      ?BECKHA@ =@ =OA@ KJ E JDA KIK= M=O JDA HA?J=CA B JDA H=@E>KJJ EI KIA@ O J ?=J?D
      KIA ALAJI =@ IDK@ =IJ =M=OI ?HHAIF@ J JDA >K@EC >N B JDA ?IJEJKAJ >KJ
      JI 1 JDAH MH@I JDA CAAJHO EI J =EJ=EA@ =KJ=JE?=O
      6DA ?JH AII=CAI JDA H=@E>KJJ =??AFJI =HA
      add name    )@@ JDA ?JH MEJD JDA IFA?EBEA@ name J JDA H=@E>KJJ
      focus n
      format fmt
      hide
      rect minx miny maxx maxy
      reveal
      size minx miny maxx maxy
      show
      value n
  Row
     ) HM CHKFI = K>AH B A>AH ?JHI ABJ J HECDJ E = HA?J=CA 4MI >AD=LA AN=?JO EA
     ?KI MEJD JDA HAI B x =@ y EJAH?D=CA@
      6DA ?JH AII=CAI EJ =??AFJI =HA
      add name ...
      border width
      bordercolor color
      hide
      image ?H
      rect minx miny maxx maxy
      remove name
      reveal
      separation width
      show
      size  min x min y max x max y 
  Scribble
      6DA I?HE>>A ?JH FHLE@AI = HACE E MDE?D IJHAI @H=M MEJD KIA >KJJ  =HA EJAHFHAJA@
      =I ?D=H=?JAHI E JDA =AH B scribble  1 IJ HAIFA?JI E?K@EC JDA BH=J B EJI ALAJ AI
      I=CAI EJ EI AGKEL=AJ J = AO>=H@ ?JH
      6DA ?JH AII=CAI EJ =??AFJI =HA
      align a                 +JHI JDA F=?AAJ B JDA E=CA E JDA HA?J=CA KEFAAJA@
      border b
      bordercolor name
      focus n
      font name               7IA@ J @EIF=O JDA E@E?E=
      hide
      image name
      linecolor name          6DA ?H E MDE?D J @H=M JDA IJHAI @AB=KJ >=?
      rect minx miny maxx     maxy
      reveal
      size minx miny maxx     maxy
      show
  Stack
      ) IJ=? CHKFI = K>AH B A>AH ?JHI E JDA I=A ID=HA@ HA?J=CA O A B JDAIA
      ?JHI ME >A LEIE>A HALA=A@ JDA JDAHI =HA DE@@A
      6DA ?JH AII=CAI EJ =??AFJI =HA
      hide
      rect minx miny maxx maxy
      remove name
      reveal  n    9EJDKJ =HCKAJ reveal EI JDA FFIEJA B hide EJ =AI EJI IAA?JA@ ?
                     JH LEIE>A =BJAH EJ M=I DE@@A 9EJD = =HCKAJ EJ =AI JDA n JD =@@A@ ?
                     JH LEIE>A DE@EC = JDAHI



                                                  !!
+64                                                                                     +64 



        show
        size  min x min y max x max y 
                       9EJDKJ =HCKAJ size ?FKJAI JDA =NEK B JDA EEK =@ =NEK
                       IEAI B EJI ?IJEJKAJ ?JHI 9EJD =HCKAJI EJ IAJI JDA IEA J JDA CELA L=
                       KAI
  Slider
      ) IE@AH ?JHI = EJACAH L=KA >O @H=CCEC JDA KIA MEJD = >KJJ +BECKHA@ =FFHFHE=JAO
      EJ ?= IAHLA =I = I?H >=H MEJD JDA IJ=@=H@ 2= ' >AD=LEH 9DA JDA L=KA ?D=CAI = ALAJ
      AII=CA EI IAJ
               slidername: value n
        6DA IE@AH EI = C@ ?=@E@=JA BH ?A?JEC J =JDAH ?JH >O IAJJEC EJI BH=J =@ HAMEHEC
        EJI event ?D=A J JDA JDAH I ctl ?D=A
        6DA CAAJHO B JDA IE@AH EI @ABEA@ >O JDHAA K>AHI max EI = K>AH HAFHAIAJEC JDA H=CA
        B JDA IE@AH vis EI = K>AH HAFHAIAJEC DM K?D B MD=J EI >AEC ?JHA@ EI LEIE>A =@
        value EI = K>AH HAFHAIAJEC JDA L=KA B JDA IE@AH MEJDE EJI H=CA .H AN=FA EB JDA IE@AH
        EI ==CEC = JANJK= @EIF=O B  EAI MEJD & LEIE>A =@ JDA BEHIJ LEIE>A EA K>AHA@
        IJ=HJEC BH  EI !" max ME >A  vis ME >A & =@ value ME >A !" 6DA indicator
        EI JDA LEIK= HAFHAIAJ=JE B JDA vis FHJE B JDA ?JHA@ >A?J
        6DA ?JH AII=CAI JDA IE@AH =??AFJI =HA
        absolute n       1B n EI AH JDA IE@AH >AD=LAI EA = 2= ' I?H >=H >KJJ  IAJI =>IKJA
                         FIEJE >KJJ  @A?HA=IAI JDA L=KA =@ >KJJ ! E?HA=IAI EJ 1B n EI 
                         AH = >KJJI >AD=LA EA >KJJ  IAJJEC JDA =>IKJA L=KA
        border b
        bordercolor name
        clamp end n    6DA end EI AEJDAH JDA MH@ high H low n IAJI MDAJDAH JD=J A@ EI ?=FA@ H
                       J 1B EJ EI ?=FA@ JD=J A@ B JDA E@E?=JH EI =M=OI =J EJI IKFHAK ) IJ=
                       @=H@ I?H >=H D=I AEJDAH A@ ?=FA@ = LKA IE@AH MK@ D=LA EJI M A@
                       ?=FA@ 1B JDA M A@ EI ?=FA@ JDA L=KA B JDA IE@AH EI HAFHAIAJA@ >O JDA
                       DECD A@ B JDA E@E?=JH JDAHMEIA EJ EI HAFHAIAJA@ >O JDA M A@
        focus n
        format fmt
        hide
        image name
        indicatorcolor name
                       5AJ JDA ?H E MDE?D J @H=M JDA E@E?=JH @AB=KJ >=?
        max n          5AJ JDA =NEK L=KA B JDA H=CA ?LAHA@ >O JDA IE@AH
        orient dir     6DA IJHEC dir >ACEI AEJDAH hor H ver J IFA?EBO JDA HEAJ=JE B JDA IE@AH
                       6DA @AB=KJ EI LAHJE?= 6DA L=KA =M=OI E?HA=IAI J JDA HECDJ BH DHEJ= IE@
                       AHI =@ @MM=H@I BH LAHJE?= IE@AHI
        rect minx miny maxx maxy
        reveal
        size minx miny maxx maxy
        show
        value n
        vis n          5AJ JDA LEIE>A =HA= IDM >O JDA E@E?=JH
  Tab
        ) J=> ?JH ?>EAI H=@E>JJKI MEJD = IJ=? B ME@MI CELEC JDA =FFA=H=?A B J=>>A@ ?
        JHI +KHHAJO JDA J=>I =HA FIEJEA@ =J JDA JF B JDA IJ=? 6DA H=@E>KJJ ?IEIJI B
        JANJ>KJJI JDA IJ=? ?= >A ?FIA@ B =O JOFA B ?JH
        +JH AII=CAI =HA
        add button control button control ...
                        )@@I = >KJJ J JDA H=@E>KJJ =@ = =II?E=JA@ ?JH J JDA IJ=? *KJ
                        JI =@ ?JHI =HA K>AHA@ E JDA H@AH B =@@EJE 6DAHA EI  HALA
                        FAH=JE
        border b




                                                   !!
+64                                                                                    +64 



      bordercolor color
      focus n
      format fmt   9DA = BH=J IJHEC EI @ABEA@ JDA J=> ?JH HAFHJI MDE?D J=> EI IAA?JA@
                   KIEC JDA BH=J IJHEC MDE?D KIJ FHEJ = char* =@ = int
      image color  +H >AJMAA A>AH ?JHI
      separation n 5F=?EC >AJMAA >KJJI E JDA H=@E>KJJ =@ >AJMAA JDA HM B >KJJI =@
                   JDA IJ=? >AM EJ
      rect n n n n
      hide
      reveal
      size n n n n
      show
      value n      8=KA KIJ >A = EJACAH E@E?=JEC MDE?D J=> J >HEC J JDA JF
  Text
      ) JANJ ?JH FHAIAJI = IAJ B EAI B JANJ 6DA JANJ ?=J >A A@EJA@ MEJD JDA AO>=H@ >KJ ?=
      >A ?D=CA@ >O ?JH AII=CAI ) HA EJAH=?JELA JANJ ?JH ME >A ?HA=JA@ ALAJK=O 6DA
      KIA ?= >A KIA@ J IAA?J EAI B JANJ 6DA O ALAJ AII=CA HAFHJI = IJ=JA ?D=CA E JDA
      IAA?JE B = EA
             textname: select n s
      IJ=JAI JD=J EA n D=I ?D=CA@ EJI IAA?JE IJ=JA J s AEJDAH AH KIAA?JA@ H AH
      IAA?JA@ 6DA AH L=KA A?@AI JDA KIA >KJJI JD=J MAHA @M MDA JDA IAA?JE
      ??KHHA@
      6DA ?JH AII=CAI JDA JANJ ?JH =??AFJI =HA
      accumulate s
      accumulate n s
      add s
      add n s               9EJD A =HCKAJ =FFA@ JDA IJHEC s =I = AM =IJ EA B JDA ?JH EB n
                            EI IFA?EBEA@ =@@ JDA EA before JDA ?KHHAJ EA n =EC JDA AM EA K
                            >AH n. 6DA EAI =HA AH E@ANA@ =@ n ?= >A  CHA=JAH JD= JDA ?KHHAJ
                            K>AH B EAI Add HABHAIDAI JDA @EIF=O >KJ accumulate @AI J J
                            =LE@ IGK=HA@ >AD=LEH MDA =IIA>EC = FEA?A B JANJ
      align a               +JHI JDA F=?AAJ B A=?D EA B JANJ ABJJHECDJ E EJI HA?J=CA 8AH
                            JE?=O EAI =HA JECDJO F=?A@ MEJD IAF=H=JE IAJ >O JDA BJ I EJAHEA
                            IF=?EC
      border b
      bordercolor name
      clear             ,AAJA = JANJ
      delete n          ,AAJA EA n
      focus n
      font name
      image name
      rect minx miny maxx maxy
      replace n s       4AF=?A EA n >O JDA IJHEC s
      reveal
      scroll n          1B n EI AH JDA JANJ ME =KJ=JE?=O I?H I JDA =IJ EA EI =M=OI LEI
                        E>A MDA AM JANJ EI =@@A@
      select n m        5AJ JDA IAA?JE IJ=JA B EA n J m
      selectcolor name
                        5AJ JDA ?H E MDE?D J DECDECDJ IAA?JA@ EAI @AB=KJ OAM
      selectmode s      6DA IJHEC s EI AEJDAH single H multi 1B single JDA @AB=KJ O A
                        EA =O >A IAA?JA@ =J = JEA MDA = EA EI IAA?JA@ JDAH EAI =HA KIA
                        A?JA@ 1B multi JDA IAA?JE IJ=JA B E@ELE@K= EAI ?= >A JCCA@ E@A
                        FA@AJO
      size minx miny maxx maxy
      show
      textcolor name




                                                  !!
+64                                                                                        +64 



      topline n             5?H JDA JANJ I JDA JF LEIE>A EA EI K>AH n
      value s               ,AAJA = JDA JANJ E JDA ?JH =@ JDA =@@ JDA IECA EA s
  Textbutton
      ) JANJ>KJJ EI = JANJK= L=HE=J B = F=E >KJJ -=?D IJ=JA ?D=CA JHECCAHI = ALAJ AII=CA
             textbuttonname: value n
      MDAHA n A?@AI JDA KIA >KJJI KIA@ J =A JDA IAA?JE
      EA = HACK=H >KJJ JDA L=KA B = JANJ>KJJ EI = EJACAH JDA text EI JDA IJHEC JD=J =FFA=HI E
      JDA >KJJ 1J KIAI JDA E=CA ECDJ =I AJD@ B E@E?=JEC EJI IJ=JA HALAH JDA ?H B
      JDA JANJ ?= >A IAJ J ?D=CA MDA JDA >KJJ EI FHAIIA@ 6DA ?JH AII=CAI EJ =??AFJI =HA
      align a    +JHI JDA F=?AAJ B JDA JANJ E JDA HA?J=CA
      border b
      bordercolor name
      focus n
      font name
      format fmt
      hide
      image name
      light name
      mask name
      pressedtextcolor name
                 5AJ JDA ?H E MDE?D J @EIF=O JANJ MDA JDA JANJ>KJJ EI FHAIIA@
      rect minx miny maxx maxy
      reveal
      size minx miny maxx maxy
      show
      text s     5AJ JDA JANJ @EIF=OA@ E JDA >KJJ
      textcolor name
      value n    5AJ JDA >KJJ J  EB n EI AH H BB EB n EI AH
  Helper functions
      6DA BK?JE ctlerror EI ?=A@ MDA JDA E>H=HO A?KJAHI = AHHH 1J FHEJI JDA BH=JJA@ AI
      I=CA =@ ANEJI JDA FHCH=
      6DA BK?JEI ctlmalloc ctlrealloc ctlstrdup =@ ctlrunestrdup =HA F=?=CECI B JDA ?HHAIF@
      EC + E>H=HO BK?JEI 6DAO ?= ctlerror EB JDAO B=E J =?=JA AHO =@ ctlmalloc AHI JDA
      AHO EJ HAJKHI
      .E=O BH @A>KCCEC EB JDA C>= L=HE=>A ctldeletequits EI IAJ J = AH L=KA JOFEC = ,-
      ME ?=KIA JDA FHCH= J ?=
             ctlerror("delete");
  Caveat
     6DEI E>H=HO EI LAHO AM =@ EI IJE EIIEC = K>AH B EFHJ=J BA=JKHAI 6DA @AJ=EI =HA = IK>
     A?J J ?D=CA )JDAH ALA B E>H=HO JD=J D=@AI CAAJHO =@ D=I IAIE>A @AB=KJ =FFA=H
     =?AI BH JDA ?JHI MK@ >A KIABK
      A KKIK= @AIEC C= B JDEI E>H=HO M=I J =A JDA ?JHI JDAIALAI A=IO J EFAAJ
      6DA HA=@AH EI A?KH=CA@ J ?HA=JA AM ?JHI >O =@=FJEC JDA IKH?A J ANEIJEC AI
EXAMPLES
     6DEI AN=FA ?HA=JAI JM AJHO >NAI top =@ bot =@ ?FEAI JDA ?JAJI B A J JDA JDAH
     MDAALAH = AMEA EI JOFA@
      #include     <u.h>
      #include     <libc.h>
      #include     <thread.h>
      #include     <draw.h>
      #include     <mouse.h>
      #include     <keyboard.h>
      #include     <control.h>
      Controlset *cs;



                                                   !!!
+64                                                                                      +64 



     int ctldeletequits = 1;
     void
     resizecontrolset(Controlset*)
     {
        int i;
        Rectangle r, r1, r2;
         if(getwindow(display, Refnone) < 0)
            sysfatal("resize failed: %r");
         r = insetrect(screen−>r, 10);
         r1 = r;
         r2 = r;
         r1.max.y = r1.min.y+1+font−>height+1;
         r2.min.y = r1.max.y+10;
         r2.max.y = r2.min.y+1+font−>height+1;
         chanprint(cs−>ctl, "top rect %R\ntop show", r1);
         chanprint(cs−>ctl, "bot rect %R\nbot show", r2);
     }
     void
     threadmain(int argc, char *argv[])
     {
        char *s, *args[3];
        Channel *c;
        Control *top, *bot;
        int n;
         initdraw(0, 0, "example");
         initcontrols();
         cs = newcontrolset(screen, nil, nil, nil);
         cs−>clicktotype = 1;
         top = createentry(cs, "top");
         chanprint(cs−>ctl, "top image paleyellow");
         chanprint(cs−>ctl, "top border 1");
         bot = createentry(cs, "bot");
         chanprint(cs−>ctl, "bot image paleyellow");
         chanprint(cs−>ctl, "bot border 1");
         c = chancreate(sizeof(char*), 0);
         controlwire(top, "event", c);
         controlwire(bot, "event", c);
         activate(top);
         activate(bot);
         resizecontrolset(cs);
         for(;;){
            s = recvp(c);
            n = tokenize(s, args, nelem(args));
            if(n==3 && strcmp(args[1], "value")==0){
               if(strcmp(args[0], "top:") == 0)
                  chanprint(cs−>ctl, "bot value %q", args[2]);
               else
                  chanprint(cs−>ctl, "top value %q", args[2]);
            }
         }
         threadexitsall(nil);
     }
     ) HE?DAH L=HE=J ?KFAI = JANJ AJHO >N J = IE@AH 5E?A JDA L=KA B = IE@AH EI EJI KAHE?= IAJ
     JEC =I = @A?E= K>AH = JD=J AA@I ?D=CEC EI JDA IAJKF B bot




                                                  !!"
+64                                                                                     +64 



           bot = createslider(cs, "bot");
           chanprint(cs−>ctl, "bot border 1");
           chanprint(cs−>ctl, "bot image paleyellow");
           chanprint(cs−>ctl, "bot indicatorcolor red");
           chanprint(cs−>ctl, "bot max 100");
           chanprint(cs−>ctl, "bot clamp low 1");
           chanprint(cs−>ctl, "bot orient horizontal");
       6DA HAIJ EI JDA I=A B ?KHIA JDA L=KA B JDA AJHO >N EI O A=ECBK J JDA IE@AH EB EJ EI
       =I = @A?E= K>AH
       .E=O MA ?= =LE@ FH?AIIEC ALAJI =JCAJDAH >O ?HII?KFEC JDA ?JHI 4AF=?A JDA HAIJ
       B threadmain MEJD JDEI
           chanprint(cs−>ctl, "bot format %q", "%q: top value %q");
           chanprint(cs−>ctl, "top format %q", "%q: bot value %q");
           controlwire(top, "event", cs−>ctl);
           controlwire(bot, "event", cs−>ctl);
           activate(top);
           activate(bot);
           resizecontrolset(cs);
           for(;;)
              yield();
           threadexitsall(nil);
SOURCE
     /sys/src/libcontrol
SEE ALSO
      draw  frame  graphics  quote  thread 
BUGS
       6DA E>H=HO EI IJHE?J =>KJ =JJAHI B BH=JJEC =HCKAJ ?KJ E AII=CAI AJ? =@ ?=I
       ctlerror E IEJK=JEI MDAHA EJ =O >A BEA J ECHA JDA AHHH =@ ?JEKA




                                                   !!#
+2761-                                                                                      +2761- 




NAME
       ?FKJEA JEAI ?O?AI   ?FK JEA E JDEI FH?AII =@ ?DE@HA
SYNOPSIS
     #include <u.h>
     #include <libc.h>
       int       times(long t[4])
       double cputime(void)
       void      cycles(vlong *cyclep)
DESCRIPTION
      1B t EI K times BEI EJ E MEJD JDA K>AH B EEIA?@I IFAJ E KIAH ?@A IOIJA ?=I
      ?DE@ FH?AIIAI E KIAH ?@A =@ ?DE@ FH?AIIAI E IOIJA ?=I Cputime HAJKHI JDA IK B
      JDIA I=A JEAI ?LAHJA@ J IA?@I Times HAJKHI JDA A=FIA@ HA= JEA E EEIA?@I JD=J
      JDA FH?AII D=I >AA HKEC
       6DAIA BK?JEI HA=@ /dev/cputime FAEC JD=J BEA MDA JDAO =HA BEHIJ ?=A@
       Cycles HA=@I JDA FH?AIIH I JEAIJ=F ?KJAH B ?O?AI IE?A HAIAJ EB =O =@ IJHAI EJ LE=
       cyclep +KHHAJO IKFFHJA@ =H?DEJA?JKHAI =HA 386 amd64 =@ power  = JDAHI cycles ME
       IJHA AH
SOURCE
     /sys/src/libc/9sys
     /sys/src/libc/*/cycles.[cs]
SEE ALSO
      exec  cons!
BUGS
       O 386 FH?AIIHI IJ=HJEC MEJD JDA 2AJEK D=LA JEAIJ=F ?KJAHI ?=EC cycles  A=HEAH
       FH?AIIHI =O ANA?KJA = EAC= EIJHK?JE




                                                   !!$
+61-                                                                                           +61- 




NAME
       ?JEA ?=JEA CJEA =I?JEA J IA? JEAA     ?LAHJ @=JA =@ JEA
SYNOPSIS
     #include <u.h>
     #include <libc.h>
       char* ctime(long clock)
       Tm*      localtime(long clock)
       Tm*      gmtime(long clock)
       char* asctime(Tm *tm)
       long     tm2sec(Tm *tm)
       /env/timezone
DESCRIPTION
      Ctime ?LAHJI = JEA clock IK?D =I HAJKHA@ >O time  EJ )5+11 IE? =@ HAJKHI = FEJAH J =
      !>OJA IJHEC E JDA BMEC BH ) JDA BEA@I D=LA ?IJ=J ME@JD
                Wed Aug       5 01:07:47 EST 1973\n\0
       Localtime =@ gmtime HAJKH FEJAHI J IJHK?JKHAI ?J=EEC JDA >HA@M JEA Localtime
       ?HHA?JI BH JDA JEA A =@ FIIE>A @=OECDJ I=LECI JEA gmtime ?LAHJI @EHA?JO J /6
       Asctime ?LAHJI = >HA@M JEA J )5+11 =@ HAJKHI = FEJAH J = !>OJA IJHEC
               typedef
               struct {
                   int      sec;              /*   seconds (range 0..59) */
                   int      min;              /*   minutes (0..59) */
                   int      hour;             /*   hours (0..23) */
                   int      mday;             /*   day of the month (1..31) */
                   int      mon;              /*   month of the year (0..11) */
                   int      year;             /*   year A.D.   1900 */
                   int      wday;             /*   day of week (0..6, Sunday = 0) */
                   int      yday;             /*   day of year (0..365) */
                   char     zone[4];          /*   time zone name */
                   int      tzoff;            /*   time zone delta from GMT */
               } Tm;
       Tm2sec ?LAHJI = >HA@M JEA J IA?@I IE?A JDA IJ=HJ B JDA AF?D 1J ECHAI wday
       =@ =IIKAI JDA ?= JEA A EB zone EI J GMT
       9DA ?= JEA EI BEHIJ HAGKAIJA@ JDA FHCH= ?IKJI JDA timezone ALEHAJ L=HE=>A J
       @AJAHEA JDA JEA A =@ ?LAHJI =??H@ECO 6DEI L=HE=>A EI IAJ =J IOIJA >J JEA >O
       init& 6DA timezone L=HE=>A ?J=EI JDA H= JEA A =A =@ EJI @EBBAHA?A BH /6
       E IA?@I BMA@ >O = =JAH=JA @=OECDJ JEA A =A =@ EJI @EBBAHA?A BMA@ >O =
       AMEA 6DA HA=E@AH EI = EIJ B F=EHI B JEAI IA?@I F=IJ JDA IJ=HJ B '% E JDA BEHIJ JEA
       A MDA JDA =JAH=JA JEA A =FFEAI .H AN=FA
               EST −18000 EDT −14400
                9943200 25664400 41392800 57718800 ...
       /HAAME?D A= 6EA EI HAFHAIAJA@ >O
               GMT 0
SOURCE
     /sys/src/libc/9sys
SEE ALSO
      date time  init&
BUGS
       6DA HAJKH L=KAI FEJ J IJ=JE? @=J= MDIA ?JAJ EI LAHMHEJJA >O A=?D ?=
       ,=OECDJ 5=LECI 6EA EI H= E JDA 5KJDAH DAEIFDAHA



                                                   !!%
+61-                                                                                      +61- 



      6DAIA HKJEAI =HA J AGKEFFA@ J D=@A )5+11 JANJ =@ =HA FHLE?E= =OM=O




                                                 !!&
+6;2-                                                                                                 +6;2- 




NAME
       EI=FD= EIKFFAH EIMAH EI@ECEJ EIN@ECEJ EI=K EIIF=?A EIFK?J EIFHEJ EICH=FD EI?JH EI=I?EE
       J=I?EE JKFFAH JMAH JKFFAH JMAH )5+11 ?D=H=?JAH ?=IIEBE?=JE
SYNOPSIS
     #include <u.h>
     #include <libc.h>
     #include <ctype.h>
       isalpha(c)                                                isgraph(c)
       isupper(c)                                                iscntrl(c)
       islower(c)                                                isascii(c)
       isdigit(c)                                                _toupper(c)
       isxdigit(c)                                               _tolower(c)
       isalnum(c)                                                toupper(c)
       isspace(c)                                                tolower(c)
       ispunct(c)                                                toascii(c)
       isprint(c)
DESCRIPTION
      6DAIA =?HI ?=IIEBO )5+11?@A@ EJACAH L=KAI >O J=>A KF -=?D EI = FHA@E?=JA HAJKHEC
      AH BH JHKA AH BH B=IA Isascii EI @ABEA@  = EJACAH L=KAI JDA HAIJ =HA @ABEA@ O
      MDAHA isascii EI JHKA =@  JDA IECA )5+11 L=KA EOF IAA fopen 
       isalpha c EI = AJJAH =  H ) 
       isupper c EI = KFFAH ?=IA AJJAH ) 
       islower   c EI = MAH ?=IA AJJAH = 
       isdigit   c EI = @ECEJ  '
       isxdigit c EI = DAN=@A?E= @ECEJ  ' H = B H ) .
       isalnum c EI = =FD=KAHE? ?D=H=?JAH =  H )  H  '
       isspace c EI = IF=?A DHEJ= J=> AMEA LAHJE?= J=> BHBAA@ H ?=HHE=CA HAJKH N  N'
               N) N* N+ N,
       ispunct c EI = FK?JK=JE ?D=H=?JAH A B !"#$%&’()*+,−./:;<=>?@[\]^_‘{|}~
       isprint   c EI = FHEJEC ?D=H=?JAH N  IF=?A JDHKCD N%- JE@A
       isgraph c EI = LEIE>A FHEJEC ?D=H=?JAH N  AN?==JE JDHKCD N%- JE@A
       iscntrl   c EI = @AAJA ?D=H=?JAH N%. H H@E=HO ?JH ?D=H=?JAH N JDHKCD N.
       isascii   c EI = )5+11 ?D=H=?JAH N JDHKCD N%.
       Toascii EI J = ?=IIEBE?=JE =?H EJ ?LAHJI EJI =HCKAJ J )5+11 H=CA >O andEC MEJD N%.
       1B c EI = KFFAH ?=IA AJJAH tolower HAJKHI JDA MAH ?=IA LAHIE B JDA ?D=H=?JAH JDAHMEIA EJ
       HAJKHI JDA HECE= ?D=H=?JAH Toupper EI IEE=H HAJKHEC JDA KFFAH ?=IA LAHIE B = ?D=H=?JAH
       H JDA HECE= ?D=H=?JAH Tolower =@ toupper =HA BK?JEI _tolower =@ _toupper =HA ?HHA
       IF@EC =?HI MDE?D IDK@ O >A KIA@ MDA EJ EI M JD=J JDA =HCKAJ EI KFFAH ?=IA H
       MAH ?=IA HAIFA?JELAO
SOURCE
     /sys/include/ctype.h                           BH JDA =?HI
     /sys/src/libc/port/ctype.c                     BH JDA J=>AI
SEE ALSO
      isalpharune 
BUGS
       6DAIA =?HI =HA )5+11?AJHE?




                                                      !!'
,-*7//-4                                                                                   ,-*7//-4 




NAME
       ?EI?JH=?A HEI?JH=?A ?EI?BH=A HEI?BH=A ?==@@H IOBB BFBH=J >AEAAA&BJI >AEAAAIBJI
       >AEAAA@BJI AEAAA&BJI AEAAAIBJI AEAAA@BJI EAAAIBJI EAAA@BJI    =?DEAE@AFA@AJ
       @A>KCCAH BK?JEI
SYNOPSIS
     #include       <u.h>
     #include       <libc.h>
     #include       <bio.h>
     #include       <mach.h>
       int cisctrace(Map *map, ulong pc, ulong sp, ulong link,
                     Tracer trace)
       int risctrace(Map *map, ulong pc, ulong sp, ulong link,
                     Tracer trace)
       ulong ciscframe(Map *map, ulong addr, ulong pc, ulong sp,
                       ulong link)
       ulong riscframe(Map *map, ulong addr, ulong pc, ulong sp,
                       ulong link)
       int localaddr(Map *map, char *fn, char *var, long *ret,
                     Rgetter rget)
       int symoff(char *buf, int n, long addr, int type)
       int fpformat(Map *map, Reglist *rp, char *buf, int n, int code)
       int beieee80ftos(char *buf, int n, void *fp)
       int beieeesftos(char *buf, int n, void *fp)
       int beieeedftos(char *buf, int n, void *fp)
       int leieee80ftos(char *buf, int n, void *fp)
       int leieeesftos(char *buf, int n, void *fp)
       int leieeedftos(char *buf, int n, void *fp)
       int ieeesftos(char *buf, int n, ulong f)
       int ieeedftos(char *buf, int n, ulong high, ulong low)
       extern Machdata *machdata;
DESCRIPTION
      6DAIA BK?JEI FHLE@A =?DEAE@AFA@AJ EFAAJ=JEI B ? @A>KCCAH BK?JEI
      =O B JDA BK?JEI =IIKA JD=J C>= L=HE=>AI mach =@ machdata FEJ J JDA Mach =@
      Machdata @=J= IJHK?JKHAI @AI?HE>EC JDA J=HCAJ =H?DEJA?JKHA 6DA BHAH ?J=EI =?DEA F=H=
      AJAHI =@ = @AI?HEFJE B JDA HACEIJAH IAJ EJ EI KIK=O IAJ >O ELEC crackhdr IAA mach  J
      EJAHFHAJ JDA DA=@AH B = ANA?KJ=>A 6DA Machdata IJHK?JKHA EI FHE=HEO = KF J=>A IFA?EBOEC
      BK?JEI =FFHFHE=JA BH FH?AIIEC = ANA?KJ=>A E=CA BH = CELA =H?DEJA?JKHA -=?D =FFE?=
      JE EI HAIFIE>A BH IAJJEC machdata J JDA =@@HAII B JDA Machdata IJHK?JKHA BH JDA J=HCAJ
      =H?DEJA?JKHA =O B JDA BK?JEI @AI?HE>A@ DAHA =HA J ?=A@ @EHA?JO EIJA=@ JDAO =HA ELA@
      E@EHA?JO JDHKCD JDA Machdata KF J=>A
       6DAIA BK?JEI KIJ HAJHEALA @=J= =@ HACEIJAH ?JAJI BH = ANA?KJEC E=CA 6DA Map IAA
       mach  @=J= IJHK?JKHA IKFFHJI JDA ?IEIJAJ HAJHEAL= B @=J= >KJ  KEBH =??AII A?D=
       EI ANEIJI BH HACEIJAHI 6DA =FFE?=JE F=IIAI JDA =@@HAII B = HACEIJAH HAJHEAL= BK?JE =I =
       =HCKAJ J JDIA BK?JEI HAGKEHEC HACEIJAH L=KAI 6DEI BK?JE ?=A@ = Rgetter EI B JDA
       BH
              ulong rget(Map *map, char *name);
       1J HAJKHI JDA ?JAJI B = HACEIJAH MDA CELA JDA =@@HAII B = Map =II?E=JA@ MEJD = ANA?KJEC
       E=CA =@ JDA =A B JDA HACEIJAH




                                                   !"
,-*7//-4                                                                                    ,-*7//-4 



     Cisctrace =@ risctrace KME@ JDA IJ=? BH KF J " ALAI H KJE JDA BH=A BH main EI BK@
     6DAO HAJKH JDA ?KJ B JDA K>AH B ALAI KMK@ 6DAIA BK?JEI FH?AII IJ=?I ?BH
     EC J JDA CAAHE? ?FEAH @A BH 415+ =@ +15+ =H?DEJA?JKHAI HAIFA?JELAO Map EI JDA =@@HAII
     B = Map @=J= IJHK?JKHA =II?E=JA@ MEJD JDA E=CA B = ANA?KJEC FH?AII Sp pc =@ link =HA
     IJ=HJEC L=KAI BH JDA IJ=? FEJAH FHCH= ?KJAH =@ E HACEIJAH BH MDE?D JDA KME@EC
     EI J J=A F=?A H=O JDAO =HA JDA ?KHHAJ ?JAJI B JDA =FFHFHE=JA HACEIJAHI >KJ JDAO ?=
     >A =O L=KAI @ABEEC = ACEJE=JA FH?AII ?JANJ BH AN=FA = =JAH=JA IJ=? E = KJE
     JDHA=@A@ FH?AII Trace EI JDA =@@HAII B = =FFE?=JEIKFFEA@ BK?JE J >A ?=A@  A=?D
     EJAH=JE =I JDA BH=A KME@I 6DA FHJJOFA B JDEI BK?JE EI
              void tracer(Map *map, ulong pc, ulong fp, Symbol *s);
     MDAHA Map EI JDA Map FEJAH F=IIA@ J cisctrace H risctrace =@ pc =@ fp =HA JDA FHCH=
     ?KJAH =@ BH=A FEJAH S EI JDA =@@HAII B = Symbol IJHK?JKHA =I @ABEA@ E symbol  ?
     J=EEC JDA IO> J=>A EBH=JE BH JDA BK?JE MEC JDA BH=A EA JDA BK?JE JD=J
     ?=KIA@ JDA BH=A J >A EIJ=JE=JA@
     Ciscframe =@ riscframe ?=?K=JA JDA BH=A FEJAH =II?E=JA@ MEJD = BK?JE 6DAO =HA IKEJ=>A
     BH FHCH=I ?BHEC J JDA +15+ =@ 415+ IJ=? @AI Map EI JDA =@@HAII B = Map =II?E
     =JA@ MEJD JDA AHO E=CA B = ANA?KJEC FH?AII Addr EI JDA AJHO FEJ B JDA @AIEHA@ BK?
     JE Pc sp =@ link =HA JDA FHCH= ?KJAH IJ=? FEJAH =@ E HACEIJAH B = ANA?KJE ?
     JANJ )I MEJD JDA IJ=? JH=?A BK?JEI JDAIA ?= >A JDA ?KHHAJ L=KAI B JDA HACEIJAHI H =O
     ACEJE=JA ANA?KJE ?JANJ 6DA L=KA B JDA BH=A FEJAH EI HAJKHA@ ) HAJKH L=KA B AH
     E@E?=JAI = AHHH
     Localaddr BEI JDA ?=JE FEJA@ J >O ret MEJD JDA =@@HAII B = ?= L=HE=>A Map EI JDA
     =@@HAII B = Map =II?E=JA@ MEJD = ANA?KJEC AHO E=CA Fn =@ var =HA FEJAHI J JDA
     =AI B JDA BK?JE =@ L=HE=>A B EJAHAIJ Rget EI JDA =@@HAII B = HACEIJAH HAJHEAL= BK?JE
     1B >JD fn =@ var =HA AH JDA BH=A BH BK?JE fn EI ?=?K=JA@ =@ JDA =@@HAII B JDA
     =KJ=JE? H =HCKAJ =A@ var E JD=J BH=A EI HAJKHA@ 1B var EI AH JDA =@@HAII B JDA
     BH=A BH BK?JE fn EI HAJKHA@ 1 = ?=IAI JDA BH=A BH JDA BK?JE =A@ fn KIJ >A EIJ=
     JE=JA@ IAMDAHA  JDA ?KHHAJ IJ=? 1B JDAHA =HA KJEFA BH=AI BH JDA BK?JE JD=J EI EB EJ EI
     HA?KHIELA JDA IJ HA?AJ BH=A EI KIA@ 6DA IA=H?D IJ=HJI BH JDA ?JANJ @ABEA@ >O JDA ?KH
     HAJ L=KA B JDA FHCH= ?KJAH =@ IJ=? FEJAH 1B = L=E@ =@@HAII EI BK@ localaddr HAJKHI
      ) AC=JELA HAJKH E@E?=JAI = AHHH E HAILEC JDA =@@HAII
     Symoff ?LAHJI = LEHJK= =@@HAII J = IO>E? HABAHA?A 6DA IJHEC ?J=EEC JD=J HABAHA?A EI
     B JDA BH =ABBIAJ  MDAHA =A EI JDA =A B JDA A=HAIJ IO> MEJD = =@@HAII AII
     JD= H AGK= J JDA J=HCAJ =@@HAII =@ BBIAJ EI JDA DAN=@A?E= BBIAJ >AO@ JD=J IO> 1B
      BBIAJ EI AH O JDA =A B JDA IO> EI FHEJA@ 1B  IO> EI BK@ MEJDE "'$ >OJAI
     B JDA =@@HAII JDA =@@HAII EI BH=JJA@ =I = DAN=@A?E= =@@HAII Buf EI JDA =@@HAII B = >KBBAH
     B n ?D=H=?JAHI J HA?AELA JDA BH=JJA@ IJHEC Addr EI JDA =@@HAII J >A ?LAHJA@ Type EI JDA
     JOFA ?@A B JDA IA=H?D IF=?A CTEXT CDATA H CANY Symoff HAJKHI JDA ACJD B JDA BH=J
     JA@ IJHEC ?J=EA@ E buf
     Fpformat ?LAHJI JDA ?JAJI B = B=JEC FEJ HACEIJAH J = IJHEC Map EI JDA =@@HAII B =
     Map =II?E=JA@ MEJD = ANA?KJEC FH?AII Rp EI JDA =@@HAII B = Reglist @=J= IJHK?JKHA @AI?HE>EC
     JDA @AIEHA@ HACEIJAH Buf EI JDA =@@HAII B = >KBBAH B n ?D=H=?JAHI J D@ JDA HAIKJEC IJHEC
     Code KIJ >A AEJDAH F H f, IAA?JEC @K>A H IECA FHA?EIE HAIFA?JELAO 1B code EI F JDA
     ?JAJI B JDA IFA?EBEA@ HACEIJAH =@ JDA BMEC HACEIJAH =HA EJAHFHAJA@ =I = @K>A FHA?EIE
     B=JEC FEJ K>AH JDEI EI O A=ECBK BH =H?DEJA?JKHAI JD=J EFAAJ @K>A FHA?EIE
     B=JI >O ?>EEC =@=?AJ IECA FHA?EIE HACEIJAHI .H code f JDA IFA?EBEA@ HACEIJAH EI BH
     =JJA@ =I = IECA FHA?EIE B=J Fpformat HAJKHI  EB JDA K>AH EI IK??AIIBKO ?LAHJA@ H
       E JDA ?=IA B = AHHH
     Beieee80ftos beieeesftos =@ beieeedftos ?LAHJ >ECA@E= &>EJ ANJA@A@ ! >EJ IECA FHA?E
     IE =@ $">EJ @K>A FHA?EIE B=JEC FEJ L=KAI J = IJHEC Leieee80ftos leieeesftos =@
     leieeedftos =HA JDA EJJAA@E= ?KJAHF=HJI Buf EI JDA =@@HAII B = >KBBAH B n ?D=H=?JAHI J
     HA?AELA JDA BH=JJA@ IJHEC Fp EI JDA =@@HAII B JDA B=JEC FEJ L=KA J >A ?LAHJA@ 6DAIA
     BK?JEI HAJKH JDA ACJD B JDA HAIKJEC IJHEC
     Ieeesftos ?LAHJI JDA ! >EJ IECA FHA?EIE B=JEC FEJ L=KA f J = IJHEC E buf = >KBBAH B n
     >OJAI 1J HAJKHI JDA ACJD B JDA HAIKJEC IJHEC




                                                   !"
,-*7//-4                                                                                  ,-*7//-4 



       Ieeedftos ?LAHJI = $">EJ @K>A FHA?EIE B=JEC FEJ L=KA J = ?D=H=?JAH IJHEC Buf EI JDA
       =@@HAII B = >KBBAH B n ?D=H=?JAHI J D@ JDA HAIKJEC IJHEC High =@ low ?J=E JDA IJ =@
       A=IJ IECEBE?=J ! >EJI B JDA B=JEC FEJ L=KA HAIFA?JELAO Ieeedftos HAJKHI JDA K>AH B
       ?D=H=?JAHI E JDA HAIKJEC IJHEC
SOURCE
     /sys/src/libmach
SEE ALSO
      mach  symbol  errstr 
DIAGNOSTICS
     5AJ errstr




                                                  !"
,-5                                                                                                  ,-5 




NAME
         IAJKF,-5IJ=JA @AIAOIAJKF >??EFDAH @AI+*+A?HOFJ @AI+*+@A?HOFJ @AI-+*A?HOFJ
         @AI-+*@A?HOFJ @AI!+*+A?HOFJ @AI!+*+@A?HOFJ @AI!-+*A?HOFJ @AI!-+*@A?HOFJ AOIAJKF
         @AI#$J$" @AI$"J#$ IAJKF,-5!IJ=JA JHEFA>??EFDAH  IECA =@ JHEFA @ECEJ= A?HOFJE
         IJ=@=H@
SYNOPSIS
     #include         <u.h>
     #include         <libc.h>
     #include         <mp.h>
     #include         <libsec.h>
         void des_key_setup(uchar key[8], ulong schedule[32])
         void block_cipher(ulong *schedule, uchar *data, int decrypting)
         void setupDESstate(DESstate *s, uchar key[8], uchar *ivec)
         void desCBCencrypt(uchar *p, int len, DESstate *s)
         void desCBCdecrypt(uchar *p, int len, DESstate *s)
         void desECBencrypt(uchar *p, int len, DESstate *s)
         void desECBdecrypt(uchar *p, int len, DESstate *s)
         void triple_block_cipher(ulong expanded_key[3][32], uchar text[8],
               int ende)
         void setupDES3state(DES3state *s, uchar key[3][8], uchar *ivec)
         void des3CBCencrypt(uchar *p, int len, DES3state *s)
         void des3CBCdecrypt(uchar *p, int len, DES3state *s)
         void des3ECBencrypt(uchar *p, int len, DES3state *s)
         void des3ECBdecrypt(uchar *p, int len, DES3state *s)
         void key_setup(uchar[7], ulong[32])
         void des56to64(uchar *k56, uchar *k64)
         void des64to56(uchar *k64, uchar *k56)
DESCRIPTION
      6DA ,ECEJ= -?HOFJE 5J=@=H@ ,-5 EI = ID=HA@AO H IOAJHE? A?HOFJE =CHEJD KIEC
      AEJDAH = #$>EJ AO BH IECA ,-5 H JDHAA #$>EJ AOI BH JHEFA ,-5 6DA AOI =HA A?@A@ EJ
      $" >EJI MDAHA ALAHO AECDJ >EJ EI F=HEJO
         6DA >=IE? ,-5 BK?JE block_cipher MHI  = >? B & >OJAI ?LAHJEC JDA E F=?A 1J
         J=AI = AO I?DA@KA = FEJAH J JDA >? =@ = B=C E@E?=JEC A?HOFJEC  H @A?HOFJEC 
         6DA AO I?DA@KA EI ?HA=JA@ BH JDA AO KIEC des_key_setup 
         5E?A EJ EI = >EJ =MM=H@ block_cipher EI H=HAO ?=A@ @EHA?JO 1IJA=@ A H=O KIAI HKJEAI
         JD=J A?HOFJ =HCAH >KBBAHI B @=J= =@ MDE?D =O ?D=E JDA A?HOFJE IJ=JA BH A >KBBAH J JDA
         ANJ 6DAIA HKJEAI AAF JH=? B JDA IJ=JA B JDA A?HOFJE KIEC = DESstate IJHK?JKHA JD=J
         ?J=EI JDA AO I?DA@KA =@ =O ?D=EA@ IJ=JA SetupDESstate IAJI KF JDA DESstate IJHK?JKHA
         KIEC JDA AO =@ = &>OJA EEJE=E=JE LA?JH
         -A?JHE? ?@A > KIEC desECBencrypt =@ desECBdecrypt EI JDA AII IA?KHA @A 6DA
         A?HOFJE B A=?D & >OJAI @AI J @AFA@  JDA A?HOFJE B =O JDAH 0A?A JDA A?HOFJE
         EI = IK>IJEJKJE ?EFDAH KIEC $" >EJ ?D=H=?JAHI
         +EFDAH >? ?D=EEC @A KIEC desCBCencrypt =@ desCBCdecrypt EI HA IA?KHA -LAHO
         >? A?HOFJA@ @AFA@I  JDA EEJE=E=JE LA?JH =@ = >?I A?HOFJA@ >ABHA EJ
         .H >JD +*+ =@ -+* @AI = IJHA= B @=J= ?= >A A?HOFJA@ =I KJEFA >KBBAHI 0MALAH =
         >KBBAHI AN?AFJ JDA =IJ KIJ >A = KJEFA B & >OJAI J AIKHA IK??AIIBK @A?HOFJE B JDA IJHA=
         6DAHA =HA AGKEL=AJ JHEFA,-5 ,-5!-,- BK?JEI BH A=?D B JDA ,-5 BK?JEI




                                                      !"!
,-5                                                                                                  ,-5 



         1 JDA F=IJ 2= ' KIA@ = #$>EJ H %>OJA BH=J BH ,-5 AOI 6 >A ?F=JE>A MEJD JDA HAIJ B
         JDA MH@ MA LA =>=@A@ JDEI BH=J 6DAHA =HA JM BK?JEI des56to64 =@ des64to56 J
         ?LAHJ >=? =@ BHJD >AJMAA JDA JM BH=JI )I = AO I?DA@KA ?= >A IAJ KF BH JDA %
         >OJA BH=J KIEC key_setup
SOURCE
     /sys/src/libsec
SEE ALSO
      mp  aes  blowfish  dsa  elgamal  rc4  rsa  sechash  prime  rand 
      Breaking DES -A?JHE? .HJEAH .K@=JE  4AEO ''&
BUGS
         5ECA ,-5 ?= >A HA=EIJE?=O >HA >O >HKJABH?A EJI #$>EJ AO EI KIJ J IDHJ 1J IDK@ J
         >A KIA@ E AM ?@A MDE?D IDK@ FH>=>O KIA aes  EIJA=@ H =J A=IJ JHEFA ,-5




                                                      !""
,1)                                                                                              ,1) 




NAME
       @E= D=CKF =K?A EIJA =??AFJ HAA?J AJ=@@H IAJAJJFJ CAJAJ?EB BHAAAJ?
       EB =A =@ >HA= AJMH ?A?JEI
SYNOPSIS
     #include <u.h>
     #include <libc.h>
       int      dial(char *addr, char *local, char *dir, int *cfdp)
       int      hangup(int ctl)
       int      announce(char *addr, char *dir)
       int      listen(char *dir, char *newdir)
       int      accept(int ctl, char *dir)
       int      reject(int ctl, char *dir, char *cause)
       char* netmkaddr(char *addr, char *defnet, char *defservice)
       void     setnetmtpt(char *to, int tolen, char *from)
       NetConnInfo*         getnetconninfo(char *conndir, int fd)
       void freenetconninfo(NetConnInfo*)
DESCRIPTION
      .H JDAIA HKJEAI addr EI = AJMH =@@HAII B JDA BH network!netaddr!service
      network!netaddr H IEFO netaddr Network EI =O @EHA?JHO EIJA@ E /net H JDA IFA?E= JA
      net Net EI = BHAA L=HE=>A JD=J IJ=@I BH =O AJMH E ? >AJMAA JDA IKH?A =@ JDA
      DIJ netaddr Netaddr ?= >A = DIJ =A = @=E =A = AJMH =@@HAII H = AJ==A B
      JDA BH $attribute MDE?D EI HAF=?A@ >O value BH JDA L=KA=JJHE>KJA F=EH attribute=value IJ
      ?IAO =II?E=JA@ MEJD JDA IKH?A DIJ E JDA AJMH @=J= >=IA IAA ndb$
       1B = ?A?JE =JJAFJ EI IK??AIIBK =@ dir EI AH JDA F=JD =A B = line directory JD=J
       D=I BEAI BH =??AIIEC JDA ?A?JE EI ?FEA@ EJ dir 6DA F=JD =A EI CK=H=JAA@ J >A AII
       JD= " >OJAI C A EA @EHA?JHO ANEIJI BH A=?D FIIE>A ?A?JE 6DA data BEA E JDA
       EA @EHA?JHO IDK@ >A KIA@ J ?KE?=JA MEJD JDA @AIJE=JE 6DA ctl BEA E JDA EA @EHA?
       JHO ?= >A KIA@ J IA@ ?=@I J JDA EA 5AA ip! BH AII=CAI JD=J ?= >A MHEJJA J JDA
       ctl BEA 6DA =IJ ?IA B JDA data H ctl BEA ME ?IA JDA ?A?JE
       Dial =AI = ?= J @AIJE=JE addr  = KJEFANA@ AJMH 1B JDA AJMH E addr EI net dial
       ME JHO E IK??AIIE = AJMHI E ? >AJMAA IKH?A =@ @AIJE=JE KJE = ?= IK??AA@I
       1J HAJKHI = BEA @AI?HEFJH FA BH HA=@EC =@ MHEJEC JDA data BEA E JDA EA @EHA?JHO 6DA
       addr BEA E JDA EA @EHA?JHO ?J=EI JDA =@@HAII ?=A@ 1B JDA AJMH =MI JDA ?= =@@HAII
       J >A IAJ =I EI JDA ?=IA MEJD 7,2 =@ 6+2 FHJ K>AHI =@ local EI AH JDA ?= =@@HAII
       ME >A IAJ J local 1B cfdp EI AH *cfdp EI IAJ J = BEA @AI?HEFJH FA BH HA=@EC =@ MHEJ
       EC JDA ?JH BEA
       Hangup EI = A=I B BH?EC = ?A?JE J D=C KF MEJDKJ ?IEC JDA ctl =@ data BEAI
       Announce =@ listen =HA JDA ?FAAJI B dial Announce AIJ=>EIDAI = AJMH =A J MDE?D
       ?=I ?= >A =@A EA dial announce HAJKHI = FA ctl BEA 6DA netaddr KIA@ E =K?A
       =O >A = ?= =@@HAII H = =IJAHEI J E@E?=JA = ?= =@@HAIIAI AC tcp!*!echo 6DA
       listen HKJEA J=AI =I EJI BEHIJ =HCKAJ JDA dir B = FHALEKI announce 9DA = ?= EI HA?AELA@
       listen HAJKHI = FA ctl BEA BH JDA EA JDA ?= M=I HA?AELA@  1J IAJI newdir J JDA F=JD
       =A B JDA AM EA @EHA?JHO Accept =??AFJI = ?= HA?AELA@ >O listen MDEA reject HABKIAI JDA
       ?= >A?=KIA B cause Accept HAJKHI = BEA @AI?HEFJH BH JDA @=J= BEA FAA@ ORDWR
       Netmkaddr =AI = =@@HAII IKEJ=>A BH @E=EC H =K?EC 1J J=AI = =@@HAII =C MEJD =
       @AB=KJ AJMH =@ IAHLE?A J KIA EB JDAO =HA J IFA?EBEA@ E JDA =@@HAII 1J HAJKHI = FEJAH J
       IJ=JE? @=J= D@EC JDA =?JK= =@@HAII J KIA
       Getnetconninfo HAJKHI = IJHK?JKHA ?J=EEC EBH=JE =>KJ = AJMH ?A?JE 6DA IJHK?
       JKHA EI
          typedef struct NetConnInfo NetConnInfo;
          struct NetConnInfo



                                                    !"#
,1)                                                                                             ,1) 



          {
               char   *dir;                    /*   connection directory */
               char   *root;                   /*   network root */
               char   *spec;                   /*   binding spec */
               char   *lsys;                   /*   local system */
               char   *lserv;                  /*   local service */
               char   *rsys;                   /*   remote system */
               char   *rserv;                  /*   remote service */
               char   *laddr;                  /*   local address */
               char   *raddr;                  /*   remote address */
          };
       6DA EBH=JE EI >J=EA@ BH JDA ?A?JE @EHA?JHO conndir 1B conndir EI E JDA @EHA?JHO
       EI >J=EA@ >O FAHBHEC fd2path   fd Getnetconninfo HAJKHI AEJDAH = ?FAJAO IFA?EBEA@
       IJHK?JKHA H E EB AEJDAH JDA IJHK?JKHA ?= J >A =?=JA@ H JDA AJMH @EHA?JHO ?= J >A @AJAH
       EA@ 6DA IJHK?JKHA EI BHAA@ KIEC freenetconninfo
       Setnetmtpt ?FEAI JDA =A B JDA AJMH KJ FEJ EJ JDA >KBBAH to MDIA ACJD EI tolen 1J
       ANEIJI J AHCA JM FHAANEIJEC ?LAJEI BH IFA?EBOEC JDA KJ FEJ +=@I JD=J J=A
       = AJMH KJ FEJ =I = F=H=AJAH IK?D =I dns cs IAA ndb& =@ ipconfig& IDK@ M
       ?= setnetmtpt 1B from EI nil JDA KJ FEJ EI IAJ J JDA @AB=KJ /net 1B from FEJI J =
       IJHEC IJ=HJEC MEJD = I=ID JDA KJ FEJ EI JD=J F=JD JDAHMEIA JDA KJ FEJ EI JDA IJHEC
       FEJA@ J >O from =FFA@A@ J JDA IJHEC /net 6DA =IJ BH EI >IAJA =@ EI IDK@ >A
       =LE@A@ 1J ANEIJI O J =E@ E ?LAHIE
EXAMPLES
     =A = ?= =@ HAJKH = FA BEA @AI?HEFJH J KIA BH ?KE?=JEI
               int callkremvax(void)
               {
                    return dial("kremvax", 0, 0, 0);
               }
       += JDA ?= =KJDAJE?=JE IAHLAH
               int dialauth(char *service)
               {
                    return dial(netmkaddr("$auth", 0, service), 0, 0, 0);
               }
       )K?A =I kremvax  6+212 =@ F BHALAH HA?AELEC ?=I =@ A?DEC >=? J JDA ?=AH
       =OJDEC IAJ
               int
               bekremvax(void)
               {
                    int dfd, acfd, lcfd;
                    char adir[40], ldir[40];
                    int n;
                    char buf[256];

                      acfd = announce("tcp!*!7", adir);
                      if(acfd < 0)
                           return −1;
                      for(;;){
                           /* listen for a call */
                           lcfd = listen(adir, ldir);
                           if(lcfd < 0)
                                return −1;
                           /* fork a process to echo */
                           switch(fork()){
                           case −1:
                                perror("forking");
                                close(lcfd);



                                                     !"$
,1)                                                                                       ,1) 



                                    break;
                               case 0:
                                    /* accept the call and open the data file */
                                    dfd = accept(lcfd, ldir);
                                    if(dfd < 0)
                                         return −1;

                                    /* echo until EOF */
                                    while((n = read(dfd, buf, sizeof(buf))) > 0)
                                         write(dfd, buf, n);
                                    exits(0);
                               default:
                                    close(lcfd);
                                    break;
                               }
                      }
              }
SOURCE
     /sys/src/libc/9sys /sys/src/libc/port
SEE ALSO
      auth  ip! ndb&
DIAGNOSTICS
     Dial announce =@ listen HAJKH  EB JDAO B=E Hangup HAJKHI AH EB EJ B=EI




                                                   !"%
,144-),                                                                                     ,144-), 




NAME
       @EHHA=@ @EHHA=@=   HA=@ @EHA?JHO
SYNOPSIS
     #include <u.h>
     #include <libc.h>
       long dirread(int fd, Dir **buf)
       long dirreadall(int fd, Dir **buf)
       #define        STATMAX         65535U
       #define        DIRMAX          (sizeof(Dir)+STATMAX)
DESCRIPTION
      6DA @=J= HAJKHA@ >O = read   = @EHA?JHO EI = IAJ B ?FAJA @EHA?JHO AJHEAI E = =?DEA
      E@AFA@AJ BH=J AN=?JO AGKEL=AJ J JDA HAIKJ B = stat   A=?D BEA H IK>@EHA?JHO E JDA
      @EHA?JHO Dirread @A?@AI JDA @EHA?JHO AJHEAI EJ = =?DEA@AFA@AJ BH 1J HA=@I BH fd
      =@ KF=?I JDA @=J= EJ = =HH=O B Dir IJHK?JKHAI MDIA =@@HAII EI HAJKHA@ E *buf IAA
      stat  BH JDA =OKJ B = Dir 6DA =HH=O EI =?=JA@ MEJD malloc  A=?D JEA dirread EI ?=A@
       Dirreadall EI EA dirread >KJ HA=@I E JDA AJEHA @EHA?JHO >O ?JH=IJ dirread IJAFI JDHKCD =
       @EHA?JHO A read  =J = JEA
       ,EHA?JHO AJHEAI D=LA L=HE=>A ACJD ) IK??AIIBK read B = @EHA?JHO =M=OI HAJKHI = EJACH=
       K>AH B ?FAJA @EHA?JHO AJHEAI dirread =M=OI HAJKHI ?FAJA Dir IJHK?JKHAI 5AA
       read# BH HA EBH=JE
       6DA ?IJ=J STATMAX EI JDA =NEK IEA JD=J = @EHA?JHO AJHO ?= ??KFO 6DA ?IJ=J
       DIRMAX EI = KFFAH EEJ  JDA IEA A?AII=HO J D@ = Dir IJHK?JKHA =@ = JDA =II?E=JA@
       @=J=
       Dirread =@ dirreadall HAJKH JDA K>AH B Dir IJHK?JKHAI BEA@ E buf 6DA BEA BBIAJ EI
       =@L=?A@ >O JDA K>AH B >OJAI =?JK=O HA=@
SOURCE
     /sys/src/libc/9sys/dirread.c
SEE ALSO
      intro  open  read 
DIAGNOSTICS
     Dirread =@ Dirreadall HAJKH AH BH A@ B BEA =@ = AC=JELA L=KA BH AHHH 1 AEJDAH ?=IA
     *buf EI IAJ J nil I JDA FEJAH ?= =M=OI >A BHAA@ MEJD EFKEJO
       6DAIA BK?JEI IAJ errstr




                                                   !"&
,15                                                                                                   ,15 




NAME
       FA@EI ,EI    CAAHE? @EI @ALE?A EJAHB=?A
SYNOPSIS
     #include <u.h>
     #include <libc.h>
     #include <disk.h>
       typedef struct Disk {
            char *prefix;
            char part[NAMELEN];
            int fd, wfd, ctlfd, rdonly;
            int type;
            vlong secs, secsize, size, offset;
            int c, h, s;
       } Disk;
       Disk* opendisk(char *file, int rdonly, int noctl)
DESCRIPTION
      6DAIA HKJEAI FHLE@A = IEFA M=O J C=JDAH =@ KIA EBH=JE =>KJ floppy! =@ sd! @EII
      =@ @EI F=HJEJEI =I MA =I F=E BEAI
       Opendisk FAI file BH HA=@EC =@ IJHAI JDA BEA @AI?HEFJH E JDA fd BEA@ B JDA Disk IJHK?JKHA
       1B rdonly EI J IAJ opendisk =I FAI file BH MHEJEC =@ IJHAI JD=J BEA @AI?HEFJH E wfd 6DA
       JM BEA @AI?HEFJHI =HA AFJ IAF=H=JA J DAF FHALAJ =??E@AJI
       1B noctl EI J IAJ opendisk I BH = ctl BEA E JDA I=A @EHA?JHO =I JDA @EI BEA EB EJ BE@I A
       EJ @A?=HAI JDA @EI J >A = sd @ALE?A IAJJEC JDA type BEA@ E JDA Disk IJHK?JKHA J Tsd 1B JDA
       F=IIA@ file EI =A@ fdndisk EJ I BH = BEA fdnctl =@ EB EJ BE@I JD=J @A?=HAI JDA @EI
       J >A = BFFO @EI B JOFA Tfloppy 1B AEJDAH ?JH BEA EI BK@ EJ EI FAA@ BH HA=@EC =@
       MHEJEC =@ JDA HAIKJEC BEA @AI?HEFJH EI I=LA@ =I ctlfd JDAHMEIA JDA HAJKHA@ @EI D=I JOFA
       Tfile
       Opendisk JDA IJ=JI JDA BEA =@ IJHAI EJI ACJD E size 1B JDA @EI EI = sd F=HJEJE opendisk
       HA=@I JDA IA?JH IEA BH JDA ?JH BEA =@ IJHAI EJ E secsize JDAHMEIA JDA IA?JH IEA EI
       =IIKA@ J >A #  =I EI JDA ?=IA BH BFFO @EII Opendisk JDA IJHAI JDA @EI IEA A=IKHA@
       E IA?JHI E secs
       1B JDA @EI EI = sd F=HJEJE opendisk F=HIAI JDA ?JH BEA J BE@ JDA F=HJEJE I BBIAJ MEJDE EJI
       @EI JDAHMEIA EJ IAJI offset J AH 1B JDA @EI EI = )6) @EI opendisk HA=@I JDA @EI CAA
       JHO K>AH B ?OE@AHI DA=@I =@ IA?JHI BH JDA geometry EA E JDA sd ?JH BEA JDAH
       MEIA EJ IAJI JDAIA J AH =I MA Name EI EEJE=EA@ MEJD JDA >=IA =A B JDA @EI F=HJEJE =@
       EI KIABK BH BHEC AII=CAI J JDA sd ?JH BEA Prefix EI IAJ J JDA F=IIA@ BEA=A MEJD
       KJ JDA name IKBBEN
       6DA 1* 2+ *15 EJAHB=?A =?=JAI  >EJI BH JDA K>AH B ?OE@AHI & BH JDA K>AH B DA=@I
       =@ $ BH JDA K>AH B IA?JHI FAH JH=? ,EI CAAJHEAI =HA J GKEJA I IEFA =OHA >KJ
       J AAF JDA EJAHB=?A KIABK @AH @EII =@ *15AI FHAIAJ CAAJHEAI JD=J IJE BEJ MEJDE JDAIA
       ?IJH=EJI 6DAIA K>AHI =HA IJE KIA@ MDA F=HJEJEEC =@ BH=JJEC @EII Opendisk
       AFOI = K>AH B DAKHEIJE?I J @EI?LAH JDEI IKFFIA@ CAAJHO =@ IJHA EJ E JDA c h =@ s
       BEA@I ,EI BBIAJI E F=HJEJE J=>AI =@ E .)6 @AI?HEFJHI =HA IJHA@ E = BH @AFA@AJ KF
       JDAIA K>AHI I opendisk MHI D=H@ J HAFHJ K>AHI JD=J =CHAA MEJD JDIA KIA@ >O JDAH
       FAH=JEC IOIJAI JDA K>AHI >A=H EJJA H  HAIA>=?A J HA=EJO
SOURCE
     /sys/src/libdisk/disk.c
SEE ALSO
      floppy! sd!




                                                      !"'
,4)9                                                                                                  ,4)9 




NAME
       1=CA @H=M CA@H=M @H=MHAFNO @H=MHAF HAF?EFH EA FO BEFO >AEAH >AIFEA BE
       >AEAH BE>AIFEA AEFIA BEAEFIA =H? BE=H? E?IIE E?IIE  >H@AH IJHEC IJHEC HKA
       IJHEC HKAIJHEC IJHEC>C IJHEC>C HKAIJHEC>C HKAIJHEC>C IJHEC )449 @H=MIAJ@A
       >KC CH=FDE?I BK?JEI
SYNOPSIS
     #include <u.h>
     #include <libc.h>
     #include <draw.h>
       typedef
       struct Image
       {
            Display            *display;       /*   display holding data */
            int                id;             /*   id of system−held Image */
            Rectangle          r;              /*   rectangle in data area, local coords */
            Rectangle          clipr;          /*   clipping region */
            ulong              chan;           /*   pixel channel format descriptor */
            int                depth;          /*   number of bits per pixel */
            int                repl;           /*   flag: data replicates to tile clipr */
            Screen             *screen;        /*   0 if not a window */
            Image              *next;          /*   next in list of windows */
       } Image;
       typedef enum
       {
            /* Porter−Duff compositing operators */
            Clear     = 0,
            SinD = 8,
            DinS = 4,
            SoutD     = 2,
            DoutS     = 1,
            S         = SinD|SoutD,
            SoverD    = SinD|SoutD|DoutS,
            SatopD    = SinD|DoutS,
            SxorD     = SoutD|DoutS,
            D         = DinS|DoutS,
            DoverS    = DinS|DoutS|SoutD,
            DatopS    = DinS|SoutD,
            DxorS     = DoutS|SoutD, /* == SxorD */
            Ncomp = 12,
       } Drawop;
       void  draw(Image *dst, Rectangle r, Image *src,
                 Image *mask, Point p)
       void drawop(Image *dst, Rectangle r, Image *src,
                 Image *mask, Point p, Drawop op)
       void gendraw(Image *dst, Rectangle r, Image *src, Point sp,
                 Image *mask, Point mp)
       void gendrawop(Image *dst, Rectangle r, Image *src, Point sp,
                 Image *mask, Point mp, Drawop op)
       int   drawreplxy(int min, int max, int x)
       Point drawrepl(Rectangle r, Point p)
       void replclipr(Image *i, int repl, Rectangle clipr)
       void line(Image *dst, Point p0, Point p1, int end0, int end1,
                 int radius, Image *src, Point sp)
       void lineop(Image *dst, Point p0, Point p1, int end0, int end1,
                 int radius, Image *src, Point sp, Drawop op)




                                                      !#
,4)9                                                             ,4)9 



     void    poly(Image *dst, Point *p, int np, int end0, int end1,
                 int radius, Image *src, Point sp)
     void    polyop(Image *dst, Point *p, int np, int end0, int end1,
                 int radius, Image *src, Point sp, Drawop op)
     void    fillpoly(Image *dst, Point *p, int np, int wind,
                 Image *src, Point sp)
     void    fillpolyop(Image *dst, Point *p, int np, int wind,
                 Image *src, Point sp, Drawop op)
     int     bezier(Image *dst, Point p0, Point p1, Point p2, Point p3,
                 int end0, int end1, int radius, Image *src, Point sp)
     int     bezierop(Image *dst, Point p0, Point p1, Point p2, Point p3,
                 int end0, int end1, int radius, Image *src, Point sp,
                 Drawop op)
     int     bezspline(Image *dst, Point *pt, int npt, int end0, int end1,
                 int radius, Image *src, Point sp)
     int     bezsplineop(Image *dst, Point *pt, int npt, int end0, int end1,
                 int radius, Image *src, Point sp, Drawop op)
     int     bezsplinepts(Point *pt, int npt, Point **pp)
     int     fillbezier(Image *dst, Point p0, Point p1, Point p2, Point p3,
                 int w, Image *src, Point sp)
     int     fillbezierop(Image *dst, Point p0, Point p1, Point p2, Point p3,
                 int w, Image *src, Point sp, Drawop op)
     int     fillbezspline(Image *dst, Point *pt, int npt, int w,
                 Image *src, Point sp)
     int     fillbezsplineop(Image *dst, Point *pt, int npt, int w,
                 Image *src, Point sp, Drawop op)
     void    ellipse(Image *dst, Point c, int a, int b, int thick,
                 Image *src, Point sp)
     void    ellipseop(Image *dst, Point c, int a, int b, int thick,
                 Image *src, Point sp, Drawop op)
     void    fillellipse(Image *dst, Point c, int a, int b,
                 Image *src, Point sp)
     void    fillellipseop(Image *dst, Point c, int a, int b,
                 Image *src, Point sp, Drawop op)
     void    arc(Image *dst, Point c, int a, int b, int thick,
                 Image *src, Point sp, int alpha, int phi)
     void    arcop(Image *dst, Point c, int a, int b, int thick,
                 Image *src, Point sp, int alpha, int phi, Drawop op)
     void    fillarc(Image *dst, Point c, int a, int b, Image *src,
                 Point sp, int alpha, int phi)
     void    fillarcop(Image *dst, Point c, int a, int b, Image *src,
                 Point sp, int alpha, int phi, Drawop op)
     int     icossin(int deg, int *cosp, int *sinp)
     int     icossin2(int x, int y, int *cosp, int *sinp)
     void    border(Image *dst, Rectangle r, int i, Image *color, Point sp)
     Point   string(Image *dst, Point p, Image *src, Point sp,
                 Font *f, char *s)
     Point   stringop(Image *dst, Point p, Image *src, Point sp,
                 Font *f, char *s, Drawop op)
     Point   stringn(Image *dst, Point p, Image *src, Point sp,
                 Font *f, char *s, int len)
     Point   stringnop(Image *dst, Point p, Image *src, Point sp,
                 Font *f, char *s, int len, Drawop op)
     Point   runestring(Image *dst, Point p, Image *src, Point sp,
                 Font *f, Rune *r)
     Point   runestringop(Image *dst, Point p, Image *src, Point sp,
                 Font *f, Rune *r, Drawop op)
     Point   runestringn(Image *dst, Point p, Image *src, Point sp,
                 Font *f, Rune *r, int len)



                                    !#
,4)9                                                                                              ,4)9 



       Point runestringnop(Image *dst, Point p, Image *src, Point sp,
                 Font *f, Rune *r, int len, Drawop op)
       Point stringbg(Image *dst, Point p, Image *src, Point sp,
                 Font *f, char *s, Image *bg, Point bgp)
       Point stringbgop(Image *dst, Point p, Image *src, Point sp,
                 Font *f, char *s, Image *bg, Point bgp, Drawop op)
       Point stringnbg(Image *dst, Point p, Image *src, Point sp,
                 Font *f, char *s, int len, Image *bg, Point bgp)
       Point stringnbgop(Image *dst, Point p, Image *src, Point sp,
                 Font *f, char *s, int len, Image *bg, Point bgp, Drawop op)
       Point runestringbg(Image *dst, Point p, Image *src, Point sp,
                 Font *f, Rune *r, Image *bg, Point bgp)
       Point runestringbgop(Image *dst, Point p, Image *src, Point sp,
                 Font *f, Rune *r, Image *bg, Point bgp, Drawop op)
       Point runestringnbg(Image *dst, Point p, Image *src, Point sp,
                 Font *f, Rune *r, int len, Image *bg, Point bgp)
       Point runestringnbgop(Image *dst, Point p, Image *src, Point sp,
                 Font *f, Rune *r, int len, Image *bg, Point bgp, Drawop op)
       Point _string(Image *dst, Point p, Image *src,
                 Point sp, Font *f, char *s, Rune *r, int len,
                 Rectangle clipr, Image *bg, Point bgp, Drawop op)
       void drawsetdebug(int on)
       enum
       {
                /* line ends       */
                Endsquare =        0,
                Enddisc     =      1,
                Endarrow = 2,
                Endmask     =      0x1F
       };
       #define ARROW(a, b, c) (Endarrow|((a)<<5)|((b)<<14)|((c)<<23))
DESCRIPTION
      6DA Image JOFA @ABEAI HA?J=CK=H FE?JKHAI =@ JDA AJD@I J @H=M KF JDA EJ EI =I JDA
      >KE@EC >? BH DECDAH ALA >A?JI IK?D =I ME@MI =@ BJI 1 F=HJE?K=H = ME@M EI HAFHA
      IAJA@ =I = Image  IFA?E= FAH=JHI =HA AA@A@ J @H=M  = ME@M
       r         6DA ?H@E=JAI B JDA HA?J=CA E JDA F=A BH MDE?D JDA Image D=I @ABEA@ FENA L=
                 KAI 1J IDK@ J >A @EBEA@ =BJAH JDA E=CA EI ?HA=JA@
       clipr     6DA ?EFFEC HA?J=CA FAH=JEI JD=J HA=@ H MHEJA JDA E=CA ME J =??AII FENAI KJ
                 IE@A clipr .HAGKAJO clipr EI JDA I=A =I r >KJ EJ =O @EBBAH IAA E F=HJE?K=H
                 JDA @EI?KIIE B repl 6DA ?EFFEC HACE =O >A @EBEA@ @O=E?=O KIEC
                 replclipr q.v.
       chan      6DA FENA ?D=A BH=J @AI?HEFJH =I @AI?HE>A@ E image$ 6DA L=KA IDK@ J >A
                 @EBEA@ =BJAH JDA E=CA EI ?HA=JA@
       depth     6DA K>AH B >EJI FAH FENA E JDA FE?JKHA EJ EI E@AJE?=O chantodepth(chan) IAA
                 graphics  =@ EI FHLE@A@ =I = ?LAEA?A 6DA L=KA IDK@ J >A @EBEA@ =BJAH
                 JDA E=CA EI ?HA=JA@
       repl      ) >A= L=KA IFA?EBOEC MDAJDAH JDA E=CA EI JEA@ J ?LAH JDA F=A MDA KIA@ =I =
                 IKH?A BH = @H=MEC FAH=JE 1B repl EI AH FAH=JEI =HA HAIJHE?JA@ J JDA EJAH
                 IA?JE B r =@ clipr 1B repl EI IAJ r @ABEAI JDA JEA J >A HAFE?=JA@ =@ clipr
                 @ABEAI JDA FHJE B JDA F=A ?LAHA@ >O JDA JEEC E JDAH MH@I r EI HAFE?=JA@ J
                 ?LAH clipr E IK?D ?=IAI r =@ clipr =HA E@AFA@AJ
                 .H AN=FA = HAFE?=JA@ E=CA MEJD r IAJ J  =@ clipr IAJ J
                  MEJD JDA IECA FENA B r IAJ J >KA >AD=LAI E@AJE?=O J = E=CA
                 MEJD r =@ clipr >JD IAJ J  =@ = FENAI IAJ J >KA 0MALAH
                 JDA BEHIJ E=CA HAGKEHAI B=H AII AHO 6DA HAFE?=JE B=C =O >A @EBEA@ @O=E
                 ?=O KIEC replclipr q.v.



                                                    !#
,4)9                                                                                             ,4)9 



     IJ B JDA @H=MEC BK?JEI ?A E JM BHI = >=IE? BH =@ = ANJA@A@ BH JD=J J=AI
     = ANJH= Drawop J IFA?EBO = 2HJAH,KBB ?FIEJEC FAH=JH J KIA 6DA >=IE? BHI =IIKA
     JDA FAH=JH EI SoverD MDE?D IKBBE?AI BH JDA L=IJ =HEJO B =FFE?=JEI 6DA ANJA@A@ BHI
     =HA =A@ >O =@@EC = op IKBBEN J JDA >=IE? BH O JDA >=IE? BHI =HA EIJA@ >AM
     draw(dst, r, src, mask, p)
          Draw EI JDA IJ=@=H@ @H=MEC BK?JE O JDIA FENAI MEJDE JDA EJAHIA?JE B dst−>r
          =@ dst−>clipr ME >A =BBA?JA@ draw ECHAI dst−>repl 6DA FAH=JE FH?AA@I =I
          BMI JDEI EI = @AI?HEFJE B JDA >AD=LEH J JDA EFAAJ=JE
                 1B repl EI IAJ E src H mask HAFE?=JA JDAEH ?JAJI J BE JDAEH ?EF HA?J=CAI
                  6H=I=JA src =@ mask I p EI =ECA@ MEJD r.min
            !     5AJ r J JDA EJAHIA?JE B r =@ dst−>r
            "     1JAHIA?J r MEJD src−>clipr 1B src−>repl EI B=IA =I EJAHIA?J r MEJD src−>r
            #     1JAHIA?J r MEJD mask−>clipr 1B mask−>repl EI B=IA =I EJAHIA?J r MEJD
                   mask−>r
            $     .H A=?D ?=JE E r ?>EA JDA dst FENA MEJD JDA src FENA KIEC JDA =FD= L=KA
                   ?HHAIF@EC J JDA mask FENA 1B JDA mask D=I = ANFE?EJ =FD= ?D=A JDA
                   =FD= L=KA ?HHAIF@EC J JDA mask FENA EI IEFO JD=J FENA I =FD= ?D=A
                   JDAHMEIA JDA =FD= L=KA EI JDA 65+ CHAOI?=A AGKEL=AJ B JDA ?H L=KA MEJD
                   MDEJA A=EC F=GKA =@ >=? JH=IF=HAJ 1 JAHI B JDA 2HJAH,KBB ?FIEJ
                   EC =CA>H= draw HAF=?AI JDA dst FENAI MEJD src E mask LAH dst 1 JDA
                   ANJA@A@ BH LAH EI HAF=?A@ >O op
            6DA L=HEKI FENA ?D=A BH=JI ELLA@ AA@ J >A E@AJE?= 1B JDA ?D=AI ELLA@
            =HA I=AH JD= &>EJI JDAO ME >A FHJA@ >ABHA JDA ?=?K=JE >O HAFE?=JEC JDA
            ANJ=J >EJI =BJAH JDA ?=?K=JE JDAO ME >A JHK?=JA@ J JDAEH FHFAH IEAI
     gendraw(dst, r, src, p0, mask, p1)
          5EE=H J draw AN?AFJ JD=J gendraw =ECI JDA IKH?A =@ =I @EBBAHAJO src EI =ECA@
          I p0 ?HHAIF@I J r.min =@ mask EI =ECA@ I p1 ?HHAIF@I J r.min. .H IJ
          FKHFIAI MEJD IEFA =II =@ IKH?A E=CAI draw EI IKBBE?EAJ >KJ gendraw EI JDA
          CAAH= FAH=JH =@ JDA A = JDAH @H=MEC FHEEJELAI =HA >KEJ KF
     drawreplxy(min,max,x)
          +EFI x J >A E JDA D=BFA EJAHL= min max >O =@@EC H IK>JH=?JEC = KJEFA B
          max−min
     drawrepl(r,p)
          +EFI JDA FEJ p J >A MEJDE JDA HA?J=CA r >O JH=I=JEC JDA FEJ DHEJ=O >O =
          EJACAH KJEFA B HA?J=CA ME@JD =@ LAHJE?=O >O JDA DAECDJ
     replclipr(i,repl,clipr)
          *A?=KIA JDA E=CA @=J= EI IJHA@  JDA IAHLAH ?= @EBE?=JEI J JDA Image @=J=
          IJHK?JKHA EJIAB ME D=LA  ABBA?J Repclipr @EBEAI JDA ?= Image @=J= IJHK?JKHA I
          repl =@ clipr BEA@I =@ JEBEAI JDA IAHLAH B JDAEH @EBE?=JE
     line(dst, p0, p1, end0, end1, thick, src, sp)
          EA @H=MI E dst = EA B ME@JD  thick FENAI EEC FEJI p0 =@ p1 6DA EA EI
          @H=M KIEC FENAI BH JDA src E=CA =ECA@ I sp E JDA IKH?A ?HHAIF@I J p0 E JDA
          @AIJE=JE 6DA EA JK?DAI >JD p0 =@ p1 =@ end0 =@ end1 IFA?EBO DM JDA A@I B
          JDA EA =HA @H=M Endsquare JAHE=JAI JDA EA FAHFA@E?K=HO J JDA @EHA?JE B JDA
          EA = JDE? EA MEJD Endsquare  >JD A@I ME >A = HA?J=CA Enddisc JAHE=JAI
          JDA EA >O @H=MEC = @EI? B @E=AJAH  thick ?AJAHA@  JDA A@ FEJ Endarrow
          JAHE=JAI JDA EA MEJD = =HHMDA=@ MDIA JEF JK?DAI JDA A@FEJ
            6DA =?H ARROW FAHEJI ANFE?EJ ?JH B JDA ID=FA B JDA =HHM 1B = JDHAA F=H=A
            JAHI =HA AH EJ FH@K?AI JDA @AB=KJ =HHMDA=@ JDAHMEIA a IAJI JDA @EIJ=?A =C EA
            BH A@ B JDA HACK=H EA J JEF b IAJI JDA @EIJ=?A =C EA BH JDA >=H> J JDA JEF
            =@ c IAJI JDA @EIJ=?A FAHFA@E?K=H J JDA EA BH A@CA B EA J JDA JEF B JDA >=H> =
            E FENAI




                                                  !#!
,4)9                                                                                           ,4)9 



             Line =@ JDA JDAH CAAJHE?= FAH=JHI =HA AGKEL=AJ J ?=I J gendraw KIEC = =I
             FH@K?A@ >O JDA CAAJHE? FH?A@KHA
     poly(dst, p, np, end0, end1, thick, src, sp)
          Poly @H=MI = CAAH= FOC EJ EI ??AFJK=O AGKEL=AJ J = IAHEAI B ?=I J line EEC
          =@=?AJ FEJI E JDA =HH=O B Points p MDE?D D=I np AAAJI 6DA A@I B JDA FO
          C =HA IFA?EBEA@ =I E line EJAHEH EAI =HA JAHE=JA@ MEJD Enddisc J =A IJD
          EI 6DA IKH?A EI =ECA@ I sp ?HHAIF@I J p[0]
     fillpoly(dst, p, np, wind, src, sp)
          Fillpoly EI EA poly >KJ BEI E JDA HAIKJEC FOC H=JDAH JD= KJEEC EJ 6DA IKH?A EI
          =ECA@ I sp ?HHAIF@I J p[0] 6DA ME@EC HKA F=H=AJAH wind HAILAI =>ECKEJEAI
          =>KJ MD=J J BE EB JDA FOC EI IABEJAHIA?JEC 1B wind EI ~0 = FENA EI EIE@A JDA FO
          C EB JDA FOC I ME@EC K>AH =>KJ JDA FEJ EI AH 1B wind EI 1 = FENA EI
          EIE@A EB JDA ME@EC K>AH EI @@ +FAAJ=HO L=KAI  H  ?=KIA KJIE@A FENAI
          J >A BEA@ 6DA A=EC B JDAH L=KAI EI K@ABEA@ 6DA FOC EI ?IA@ MEJD = EA EB
          A?AII=HO
     bezier(dst, a, b, c, d, end0, end1, thick, src, sp)
          Bezier @H=MI JDA ?K>E? *AEAH ?KHLA @ABEA@ >O Points a b c =@ d 6DA A@ IJOAI =HA
          @AJAHEA@ >O end0 =@ end1 JDA JDE?AII B JDA ?KHLA EI  thick 6DA IKH?A EI
          =ECA@ I sp E src ?HHAIF@I J a E dst
     bezspline(dst, p, end0, end1, thick, src, sp)
          Bezspline J=AI JDA I=A =HCKAJI =I poly >KJ @H=MI = GK=@H=JE? *IFEA @AIFEJA EJI
          =A H=JDAH JD= = FOC 1B JDA BEHIJ =@ =IJ FEJI E p =HA AGK= JDA IFEA D=I FAHE
          @E? A@ ?@EJEI
     bezsplinepts(pt, npt, pp)
          Bezsplinepts HAJKHI E pp = EIJ B FEJI =EC KF JDA FA FOC JD=J bezspline MK@
          @H=M 6DA ?=AH EI HAIFIE>A BH BHAAEC *pp
     fillbezier(dst, a, b, c, d, wind, src, sp)
          Fillbezier EI J bezier =I fillpoly EI J poly
     fillbezspline(dst, p, wind, src, sp)
          Fillbezspline EI EA fillpoly >KJ BEI JDA GK=@H=JE? *IFEA H=JDAH JD= JDA FOC KJEA@
          >O p 6DA IFEA EI ?IA@ MEJD = EA EB A?AII=HO
     ellipse(dst, c, a, b, thick, src, sp)
          Ellipse @H=MI E dst = AEFIA ?AJAHA@  c MEJD DHEJ= =@ LAHJE?= IAE=NAI a =@ b
          6DA IKH?A EI =ECA@ I sp E src ?HHAIF@I J c E dst 6DA AEFIA EI @H=M MEJD JDE?
          AII  thick
     fillellipse(dst, c, a, b, src, sp)
          Fillellipse EI EA ellipse >KJ BEI JDA AEFIA H=JDAH JD= KJEEC EJ
     arc(dst, c, a, b, thick, src, sp, alpha, phi)
          Arc EI EA ellipse >KJ @H=MI O JD=J FHJE B JDA AEFIA IJ=HJEC =J =CA alpha =@
          ANJA@EC JDHKCD = =CA B phi 6DA =CAI =HA A=IKHA@ E @ACHAAI ?KJAH??MEIA
          BH JDA FIEJELA x =NEI
     fillarc(dst, c, a, b, src, sp, alpha, phi)
          Fillarc EI EA arc >KJ BEI JDA IA?JH MEJD JDA IKH?A ?H
     icossin(deg, cosp, sinp)
          Icossin IJHAI E *cosp =@ *sinp I?=A@ EJACAHI HAFHAIAJEC JDA ?IEA =@ IEA B JDA
          =CA deg A=IKHA@ E EJACAH @ACHAAI 6DA L=KAI =HA I?=A@ I ?I EI  "
     icossin2(x, y, cosp, sinp)
          Icossin2 EI ==CKI J icossin, MEJD JDA =CA HAFHAIAJA@ J E @ACHAAI >KJ EFE?EJO >O
          JDA FEJ xy 1J EI J icossin MD=J atan2 EI J atan IAA sin 
     border(dst, r, i, color, sp)
          Border @H=MI = KJEA B HA?J=CA r E JDA IFA?EBEA@ color 6DA KJEA D=I ME@JD i EB FI
          EJELA JDA >H@AH CAI EIE@A JDA HA?J=CA AC=JELA KJIE@A 6DA IKH?A EI =ECA@ I sp
          ?HHAIF@I J r.min.




                                                     !#"
,4)9                                                                                             ,4)9 



       string(dst, p, src, sp, font, s)
            String @H=MI E dst ?D=H=?JAHI IFA?EBEA@ >O JDA IJHEC s =@ font EJ EI AGKEL=AJ J = IAHEAI
            B ?=I J gendraw KIEC IKH?A src =@ =II @AJAHEA@ >O JDA ?D=H=?JAH ID=FAI 6DA
            JANJ EI FIEJEA@ MEJD JDA ABJ B JDA BEHIJ ?D=H=?JAH =J p.x =@ JDA JF B JDA EA B JANJ =J
            p.y 6DA IKH?A EI FIEJEA@ I sp E src ?HHAIF@I J p E dst String HAJKHI =
            Point JD=J EI JDA FIEJE B JDA ANJ ?D=H=?JAH JD=J MK@ >A @H=M EB JDA IJHEC MAHA
            CAH
               .H ?D=H=?JAHI MEJD K@ABEA@ H AHME@JD E=CAI E JDA BJ JDA ?D=H=?JAH =J BJ FIE
               JE  7 EI @H=M
               6DA JDAH IJHEC HKJEAI =HA L=HE=JI B JDEI >=IE? BH =@ D=LA =AI JD=J A?@A JDAEH
               L=HE=J >AD=LEH 4KJEAI MDIA =AI ?J=E rune =??AFJ = IJHEC B 4KAI H=JDAH JD=
               76.A?@A@ >OJAI 4KJEAI A@EC E n =??AFJ = =HCKAJ n JD=J @ABEAI JDA K>AH
               B ?D=H=?JAHI J @H=M H=JDAH JD= =??AFJEC = 7JAHE=JA@ IJHEC 4KJEAI ?J=EEC
               bg @H=M JDA >=?CHK@ >ADE@ JDA ?D=H=?JAHI E JDA IFA?EBEA@ ?H bg =@ =ECAJ
               bgp H=O JDA JANJ EI @H=M A=LEC JDA >=?CHK@ EJ=?J
               6DA HKJEA _string ?=FJKHAI = JDEI >AD=LEH EJ = IECA FAH=JH 9DAJDAH EJ @H=MI = 76.
               IJHEC H 4KA IJHEC @AFA@I  MDAJDAH s H r EI K JDA IJHEC ACJD EI =M=OI @AJAH
               EA@ >O len 1B bg EI K EJ EI KIA@ =I = >=?CHK@ ?H 6DA clipr =HCKAJ
               =MI BKHJDAH ==CAAJ B ?EFFEC MDA @H=MEC JDA IJHEC EJ EI EJAHIA?JA@ MEJD JDA
               KIK= ?EFFEC HA?J=CAI J BKHJDAH EEJ JDA ANJAJ B JDA JANJ
       drawsetdebug(on)
            6KHI  H BB @A>KCCEC KJFKJ KIK=O J = IAHE= EA =??H@EC J MDAJDAH on EI 
            AH
SOURCE
     /sys/src/libdraw
SEE ALSO
      graphics  stringsize  color$ utf$ addpt 
       6 2HJAH 6 ,KBB   +FIEJEC ,ECEJ= 1=CAI  Computer Graphics 2H? 51//4)20 &! FF
        #! #' '&"
DIAGNOSTICS
     6DAIA HKJEAI ?= JDA CH=FDE?I AHHH BK?JE  B=J= AHHHI
BUGS
       )JE=E=IA@ ?D=H=?JAHI ?= >A @H=M >O @ABEEC = BJ MEJD KJEFA >EJI FAH FENA >KJ JDAHA =HA
        =JE=E=IEC CAAJHE? FHEEJELAI




                                                    !##
,5)                                                                                                ,5) 




NAME
         @I=CA @I=IEC @I=LAHEBO @I=FK>=? @I=FK>BHAA @I=FHEL=? @I=FHELBHAA @I=IEC=? @I=IEC
         BHAA @I=FHELJFK>  @ECEJ= IEC=JKHA =CHEJD
SYNOPSIS
     #include         <u.h>
     #include         <libc.h>
     #include         <mp.h>
     #include         <libsec.h>
         DSApriv*       dsagen(DSApub *opub)
         DSAsig*        dsasign(DSApriv *k, mpint *m)
         int            dsaverify(DSApub *k, DSAsig *sig, mpint *m)
         DSApub*        dsapuballoc(void)
         void           dsapubfree(DSApub*)
         DSApriv*       dsaprivalloc(void)
         void           dsaprivfree(DSApriv*)
         DSAsig*        dsasigalloc(void)
         void           dsasigfree(DSAsig*)
         DSApub*        dsaprivtopub(DSApriv*)
DESCRIPTION
      ,5) EI JDA 156 =FFHLA@ @ECEJ= IEC=JKHA =CHEJD 6DA MAH B = AO FK>EIDAI JDA FK>E? F=HJ
      B JDA AO
                struct DSApub
                {
                     mpint             *p; // modulus
                     mpint             *q; // group order, q divides p−1
                     mpint             *alpha;  // group generator
                     mpint             *key;    // alpha**secret mod p
                };
         6DEI F=HJ ?= >A KIA@ BH LAHEBOEC IEC=JKHAI MEJD dsaverify ?HA=JA@ >O JDA MAH 6DA MAH
         IECI MEJD dsasign KIEC DEI FHEL=JA AO
                struct DSApriv
                {
                     DSApub    pub;
                     mpint     *secret; // (decryption key)
                };
         AOI =HA CAAH=JA@ KIEC dsagen 1B dsagen I =HCKAJ opub EI nil = AO EI ?HA=JA@ KIEC = AM
         p =@ q CAAH=JA@ >O DSAprimes IAA prime  JDAHMEIA p =@ q =HA ?FEA@ BH JDA @ AO
         Dsaprivtopub HAJKHI = AMO =?=JA@ ?FO B JDA FK>E? AO ?HHAIF@EC J JDA FHEL=JA AO
         6DA HKJEAI dsapuballoc dsapubfree dsaprivalloc =@ dsaprivfree =HA FHLE@A@ J ==CA AO
         IJH=CA
         Dsasign IECI AII=CA m KIEC = FHEL=JA AO k OEA@EC =
                struct DSAsig
                {
                     mpint             *r, *s;
                };
         Dsaverify HAJKHI  EB JDA IEC=JKHA EI L=E@ =@  EB J
         6DA HKJEAI dsasigalloc =@ dsasigfree =HA FHLE@A@ J ==CA IEC=JKHA IJH=CA
SOURCE
     /sys/src/libsec



                                                      !#$
,5)                                                                                     ,5) 



SEE ALSO
      mp  aes  blowfish  des  rc4  rsa  sechash  prime  rand 




                                                   !#%
,72                                                                                                ,72 




NAME
         @KF   @KFE?=JA = FA BEA @AI?HEFJH
SYNOPSIS
     #include <u.h>
     #include <libc.h>
         int dup(int oldfd, int newfd)
DESCRIPTION
      /ELA = BEA @AI?HEFJH oldfd HABAHHEC J = FA BEA dup HAJKHI = AM BEA @AI?HEFJH HABAHHEC
      J JDA I=A BEA
         1B newfd EI  JDA IOIJA ?DIAI JDA MAIJ =L=E=>A BEA @AI?HEFJH JDAHMEIA dup ME KIA
         newfd BH JDA AM BEA @AI?HEFJH ?IEC =O @ BEA =II?E=JA@ MEJD newfd .EA @AI?HEFJHI =HA
         =?=JA@ @O=E?=O I J FHALAJ KM=HH=JA@ CHMJD B JDA BEA @AI?HEFJH J=>A dup HAGKEHAI
         JD=J newfd >A  CHA=JAH JD=  HA JD= JDA DECDAIJ BEA @AI?HEFJH ALAH KIA@ >O JDA FHCH=
SOURCE
     /sys/src/libc/9syscall
SEE ALSO
      intro  dup!
DIAGNOSTICS
     5AJI errstr




                                                     !#&
,;,                                                                                          ,;, 




NAME
       @OBE@IO @OBHAAEFHJ @O=@B@ @O=@CA @O>BHAA @OJ=>IEA            =@ >A?J BEA
       @O=E?=O
SYNOPSIS
     #include       <u.h>
     #include       <libc.h>
     #include       <a.out.h>
     #include       <dynld.h>
       Dynsym*        dynfindsym(char *name, Dynsym *syms, int nsym);
       Dynobj*        dynloadfd(int fd, Dynsym *exports, int nexport,
                        ulong maxsize);
       Dynobj*        dynloadgen(void *file, long (*read)(void*,void*,long),
                        vlong (*seek)(void*,vlong,int), void (*err)(char*),
                        Dynsym *exports, int nexport, ulong maxsize);
       void*          dynimport(Dynobj *o, char *name, ulong sig);
       void           dynfreeimport(Dynobj *o);
       void           dynobjfree(Dynobj *o);
       int            dyntabsize(Dynsym *t);
       extern Dynsym         _exporttab[];
DESCRIPTION
      6DAIA BK?JEI =M = FH?AII J =@ BKHJDAH ?@A =@ @=J= EJ JDA ?KHHAJO ANA?KJEC E=CA
      ) @O=E?=O=@=>A BEA ?=A@ = module DAHA EI = L=HE=J B JDA a.out$ ANA?KJ=>A BH=J
      MEJD IA ANJH= ?FAJI 6DA =@AH BH JDA =H?DEJA?JKHA IAA 2l ?HA=JAI = @KA BEA BH
      ?FAJ >A?J BEAI MDA CELA JDA −u FJE ) @KA ?J=EI JANJ =@ @=J= IA?JEI =
      EFHJ J=>A = ANFHJ J=>A =@ HA?=JE @=J= 6DA EFHJ J=>A EIJI JDA IO>I JDA @KA
      AA@I BH JDA =@EC FHCH= JDA ANFHJ J=>A EIJI IO>I JDA @KA FHLE@AI MDA =@A@
      ) FHCH= JD=J =@I = @KA FHLE@AI = J=>A B EJI M IO>I J =J?D JDA IO>I E JDA
      @KA I EFHJ J=>A
       ) IO> AJHO E = IO> J=>A =AI = C>= BK?JE H @=J= EJA =@ D=I = =II?E=JA@
       signature L=KA HAFHAIAJEC JDA JOFA B JDA ?HHAIF@EC BK?JE H @=J= E JDA IKH?A ?@A
       6DA Dynsym IJHK?JKHA @ABEAI = IO>
              typedef struct         {
                   ulong             sig;
                   ulong             addr;
                   char*             name;
              } Dynsym;
       6DA IJHK?JKHA EI M J JDA =@AHI 2l Name EI JDA E=CA =A B JDA BK?JE H @=J=
       Addr EI EJI =@@HAII MDE?D EI HA=JELA J JDA IJ=HJ B JDA @KA >ABHA =@EC =@ = =@@HAII E
       JDA ?KHHAJ =@@HAII IF=?A =BJAH =@EC 6DA IEC=JKHA sig EI JDA L=KA FH@K?A@ >O JDA +
       ?FEAH I signof FAH=JH =FFEA@ J JDA JOFA 5O> J=>AI KIJ >A IHJA@ >O name
       ) ANA?KJ=>A JD=J MEIDAI J =@ @KAI ME H=O >A EA@ KIEC JDA −x FJE J JDA
       =FFHFHE=JA =@AH 2l 6DA HAIKJEC ANA?KJ=>A ?J=EI = ANFHJ J=>A _exporttab JD=J
       EIJI = JDA ANFHJA@ IO>I B JDA FHCH= >O @AB=KJ = ANJAH= IO>I ) E =A =HI
       JDA A@ B JDA J=>A 5AA 2l BH @AJ=EI 6DA J=>A ?= >A CELA J JDA BK?JEI >AM J =M =
       =@A@ @KA J =??AII JDIA IO>I
       ) =@A@ @KA EI @AI?HE>A@ >O = Dynobj IJHK?JKHA
              typedef struct         {
                   ulong             size;          /*   total   size in bytes */
                   ulong             text;          /*   bytes   of text */
                   ulong             data;          /*   bytes   of data */
                   ulong             bss;           /*   bytes   of bss */
                   uchar*            base;          /*   start   of text, data, bss */


                                                   !#'
,;,                                                                                           ,;, 



                   int               nexport;
                   Dynsym*           export;        /* export table */
                   int               nimport;
                   Dynsym**          import;        /* import table */
              } Dynobj;
       5ALAH= BEA@I CELA IEAI B JDA @KA I ?FAJI =I JA@ E ?AJI =>LA Base CELAI JDA
       =@@HAII =J MDE?D JDA @KA D=I >AA =@A@ ) EJI EJAH= HABAHA?AI D=LA >AA =@KIJA@
       MDAHA AA@A@ J HABA?J EJI ?KHHAJ =@@HAII Export FEJI J = IO> J=>A EIJEC JDA IO>I
       ANFHJA@ >O JDA @KA nexport CELAI JDA J=>A I ACJD Import FEJI J = EIJ B IO>I
       EFHJA@ >O JDA @KA JA JD=J A=?D AJHO =?JK=O FEJI J = AJHO E = IO> J=>A FHLE@A@
       >O JDA FHCH= JD=J =@A@ JDA @KA IAA >AM Nimport CELAI JDA EFHJ J=>A I ACJD 1B
       JDA EFHJ J=>A EI J HAGKEHA@ ?= dynfreeimport  JDA @KA FEJAH J BHAA EJ
       Dynfindysm I KF JDA AJHO BH JDA CELA name E IO> J=>A syms B ACJD nsym 1J
       HAJKHI = FEJAH J JDA AJHO EB BK@ E JDAHMEIA 6DA IO> J=>A KIJ >A IHJA@ >O =A E
       =I?A@EC H@AH
       Dyntabsize HAJKHI JDA ACJD B IO> J=>A t @ABEA@ J >A JDA K>AH B Dynsym L=KAI IJ=HJ
       EC =J t JD=J D=LA E name BEA@I 1J EI KIA@ J BE@ JDA ACJD B _exporttab
       Dynloadfd =@I = @KA BH JDA BEA FA BH HA=@EC  fd =@ HAJKHI JDA HAIKJEC @KA
       FEJAH  IK??AII H E  AHHH 1B maxsize EI AH JDA IEA B JDA @O=E?=O=@A@
       @KA I ?@A =@ @=J= EI EEJA@ J maxsize >OJAI Exports EI = =HH=O B nexport IO>I E JDA
       ?KHHAJ FHCH= JD=J ?= >A EFHJA@ >O JDA ?KHHAJ @KA 1J KIAI read  =@ seek  J
       =??AII fd =@ ?=I werrstr IAA errstr  J IAJ JDA AHHH IJHEC EB A?AII=HO
       Dynloadgen EI = HA CAAH= BK?JE JD=J ?= =@ = @KA BH = =H>EJH=HO IKH?A J KIJ =
       FA BEA @AI?HEFJH 1 F=HJE?K=H EJ ?= >A ?=A@ >O JDA AHA KIEC BK?JEI EJAH= J JDA
       AHA EIJA=@ B =EC IOIJA ?=I Exports nexport =@ maxsize =HA KIJ =I BH dynloadfd
       File EI = FEJAH J = IJHK?JKHA @ABEA@ >O JDA ?=AH JD=J HAFHAIAJI JDA BEA ?J=EEC JDA @KA
       1J EI F=IIA@ J read =@ seek Read EI ELA@ =I (*read)(file,buf, nbytes) Read IDK@
       HA=@ nbytes B @=J= BH file EJ buf =@ HAJKH JDA K>AH B >OJAI JH=IBAHHA@ 1J IDK@ HAJKH
         AHHH Seek EI ELA@ =I (*seek)(file,n, type) MDAHA n =@ type =HA KIJ =I BH
       seek  EJ IDK@ IAA J JDA HAGKAIJA@ BBIAJ E file H HAJKH   AHHH Dynloadgen HAJKHI =
       FEJAH J JDA =@A@ @KA  IK??AII  AHHH EJ HAJKHI E =BJAH ?=EC EJI err F=H=AJAH J
       IAJ JDA AHHH IJHEC
       Dynimport HAJKHI = FEJAH J JDA L=KA B JDA IO> name E =@A@ @KA o H nil EB o @AI
       J ANFHJ = IO> MEJD JDA CELA name 1B sig EI AH JDA ANFHJA@ IO> I IEC=JKHA KIJ
       AGK= sig H dynimport =C=E HAJKHI E .H AN=FA
              Dev *d;
              d = dynimport(obj, "XXXdevtab", signof(*d));
              if(d == nil)
                   error("not a dynamically−loadable driver");
       Dynobjfree BHAAI JDA @KA o 6DAHA EI  HABAHA?A ?KJEC EJ EI JDA ?=AH I HAIFIE>EEJO J
       @A?E@A MDAJDAH = @KA EI  CAH AA@A@
SEE ALSO
      2l mach  a.out$
DIAGNOSTICS
     .K?JEI JD=J HAJKH FEJAHI HAJKH E  AHHH Dynloadfd IAJI JDA AHHH IJHEC =@ HAJKHI E




                                                    !$
-/))                                                                                        -/)) 




NAME
       ACCA ACA?HOFJ AC@A?HOFJ ACIEC ACLAHEBO ACFK>=? ACFK>BHAA ACFHEL=? ACFHELBHAA ACIE
       C=? ACIECBHAA ACFHELJFK>  AC== A?HOFJE
SYNOPSIS
     #include       <u.h>
     #include       <libc.h>
     #include       <mp.h>
     #include       <libsec.h>
       EGpriv*        eggen(int nlen, int nrep)
       mpint*         egencrypt(EGpub *k, mpint *in, mpint *out)
       mpint*         egdecrypt(EGpriv *k, mpint *in, mpint *out)
       EGsig*         egsign(EGpriv *k, mpint *m)
       int            egverify(EGpub *k, EGsig *sig, mpint *m)
       EGpub*         egpuballoc(void)
       void           egpubfree(EGpub*)
       EGpriv*        egprivalloc(void)
       void           egprivfree(EGpriv*)
       EGsig*         egsigalloc(void)
       void           egsigfree(EGsig*)
       EGpub*         egprivtopub(EGpriv*)
DESCRIPTION
      -C== EI = FK>E? AO A?HOFJE =@ IEC=JKHA =CHEJD 6DA MAH B = AO FK>EIDAI JDA FK>
      E? F=HJ B JDA AO
               struct EGpub
               {
                       mpint        *p; // modulus
                       mpint        *alpha;        // generator
                       mpint        *key;          // (encryption key) alpha**secret mod p
               };
      6DEI F=HJ ?= >A KIA@ BH A?HOFJEC @=J= MEJD egencrypt J >A IAJ J JDA MAH 6DA MAH
      @A?HOFJI MEJD egdecrypt KIEC DEI FHEL=JA AO
               struct EGpriv
               {
                       EGpub        pub;
                       mpint        *secret; // (decryption key)
               };
       AOI =HA CAAH=JA@ KIEC eggen Eggen J=AI >JD >EJ ACJD B JDA @KKI =@ JDA K>AH B
       HAFAJEJEI B JDA EAH4=>E FHE=EJO JAIJ J HK 1B JDA =JJAH EI  EJ @AI JDA @AB=KJ K>AH B
       HK@I Egprivtopub HAJKHI = AMO =?=JA@ ?FO B JDA FK>E? AO ?HHAIF@EC J JDA FHEL=JA
       AO
       6DA HKJEAI egpuballoc egpubfree egprivalloc =@ egprivfree =HA FHLE@A@ J ==CA AO IJH
       =CA
       Egsign IECI AII=CA m KIEC = FHEL=JA AO k OEA@EC =
              struct EGsig
              {
                      mpint           *r, *s;
              };
       Egverify HAJKHI  EB JDA IEC=JKHA EI L=E@ =@  EB J
       6DA HKJEAI egsigalloc =@ egsigfree =HA FHLE@A@ J ==CA IEC=JKHA IJH=CA




                                                     !$
-/))                                                                                     -/)) 



SOURCE
     /sys/src/libsec
SEE ALSO
      mp  aes  blowfish  des  dsa  rc4  rsa  sechash  prime  rand 




                                                   !$
-+,-                                                                                         -+,- 




NAME
       @A?$" A?$" @A?!  A?!  @A?$ A?$ A?@ABJ       A?@EC >OJA =HH=OI =I IJHECI
SYNOPSIS
     #include <u.h>
     #include <libc.h>
       int    dec64(uchar *out, int lim, char *in, int n)
       int    enc64(char *out, int lim, uchar *in, int n)
       int    dec32(uchar *out, int lim, char *in, int n)
       int    enc32(char *out, int lim, uchar *in, int n)
       int    dec16(uchar *out, int lim, char *in, int n)
       int    enc16(char *out, int lim, uchar *in, int n)
       int    encodefmt(Fmt*)
DESCRIPTION
      Enc16 enc32 =@ enc64 ?HA=JA K JAHE=JA@ IJHECI 6DAO HAJKH JDA IEA B JDA A?@A@ IJHEC
      MEJDKJ JDA K H  EB JDA A?@EC B=EI 6DA A?@EC B=EI EB lim JDA ACJD B JDA KJFKJ
      >KBBAH EI J I=
       Dec16 dec32 =@ dec64 HAJKH JDA K>AH B >OJAI @A?@A@ H  EB JDA @A?@EC B=EI 6DA
       @A?@EC B=EI EB JDA KJFKJ >KBBAH EI J =HCA AKCD H BH >=IA !  EB JDA EFKJ >KBBAH ACJD EI
       J = KJEFA B &
       Encodefmt ?= >A KIA@ MEJD fmtinstall  =@ print  J FHEJ A?@A@ HAFHAIAJ=JEI B >OJA
       =HH=OI 6DA LAH>I =HA
       H      >=IA $ EA DAN=@A?E= 6DA @AB=KJ A?@EC EI E KFFAH ?=IA 6DA l B=C BH?AI MAH
              ?=IA
       <      >=IA !
       [      >=IA $" I=A =I 1-
       6DA ACJD B JDA =HH=O EI IFA?EBEA@ =I f2 .H AN=FA J @EIF=O = # >OJA =HH=O =I DAN

             char x[15];

             fmtinstall(’H’, encodefmt);
             print("%.*H\n", sizeof x, x);

SOURCE
     /sys/src/libc/port/u32.c
     /sys/src/libc/port/u64.c




                                                    !$!
-+4;26                                                                                    -+4;26 




NAME
       A?HOFJ @A?HOFJ AJ?HOFJ   ,-5 A?HOFJE
SYNOPSIS
     #include <u.h>
     #include <libc.h>
       int    encrypt(void *key, void *data, int len)
       int    decrypt(void *key, void *data, int len)
       int    netcrypt(void *key, void *data)
DESCRIPTION
      Encrypt =@ decrypt FAHBH ,-5 A?HOFJE =@ @A?HOFJE Key EI = =HH=O B DESKEYLEN
      @ABEA@ =I % E <auth.h> >OJAI ?J=EEC JDA A?HOFJE AO Data EI = =HH=O B len >OJAI EJ
      KIJ >A =J A=IJ & >OJAI C 6DA >OJAI =HA A?HOFJA@ H @A?HOFJA@ E F=?A
       6DA ,-5 =CHEJD A?HOFJI = E@ELE@K= &>OJA >? B @=J= Encrypt KIAI JDA BMEC AJD@
       J A?HOFJ @=J= CAH JD= & >OJAI 6DA BEHIJ & >OJAI =HA A?HOFJA@ =I KIK= 6DA =IJ >OJA B JDA
       A?HOFJA@ HAIKJ EI FHABENA@ J JDA ANJ % KA?HOFJA@ >OJAI J =A JDA ANJ & >OJAI J A?HOFJ
       6DEI EI HAFA=JA@ KJE BAMAH JD= % >OJAI HA=E KA?HOFJA@ )O HA=EEC KA?HOFJA@ >OJAI
       =HA A?HOFJA@ MEJD AKCD B JDA FHA?A@EC A?HOFJA@ >OJAI J =A = BK &>OJA >? Decrypt
       KIAI JDA ELAHIA =CHEJD
       Netcrypt FAHBHI JDA I=A A?HOFJE =I = 5A?KHAAJ AO Data FEJI J = )5+11 IJHEC B @A?E
       = @ECEJI MEJD KAHE? L=KA >AJMAA  =@  6DAIA @ECEJI =HA ?FEA@ EJ = &>OJA >KBBAH
       MEJD JH=EEC >E=HO AH BE =@ A?HOFJA@ =I A ,-5 >? 6DA BEHIJ BKH >OJAI =HA A=?D BH=J
       JA@ =I JM @ECEJ )5+11 DAN=@A?E= K>AHI =@ JDA IJHEC EI ?FEA@ EJ data
SOURCE
     /sys/src/libc/port
DIAGNOSTICS
     6DAIA HKJEAI HAJKH  EB JDA @=J= M=I A?HOFJA@ =@  EB JDA A?HOFJE B=EI Encrypt =@
     decrypt B=E EB JDA @=J= F=IIA@ EI AII JD= & >OJAI C Netcrypt ?= B=E EB EJ EI F=IIA@ EL=E@
     @=J=
SEE ALSO
      securenet&
BUGS
       6DA EFAAJ=JE EI >HA E = M=O JD=J =AI EJ KIKEJ=>A BH =OJDEC >KJ =KJDAJE?=JE




                                                     !$"
-444                                                                                           -444 




NAME
       M=IAHHH FFAHHH ANJAHHH AHHH BJAHHH IEAJAHHH   AN?AFJE D=@EC BH JDHA=@A@ FH
       CH=I
SYNOPSIS
     #include       <u.h>
     #include       <libc.h>
     #include       <thread.h>
     #include       <error.h>

       int     waserror(void);
       void    poperror(void)
       void    nexterror(void);
       void    error(char *err);
       void    fmterror(char *fmt, ...);
       void    silenterror(char *fmt, ...);
DESCRIPTION
      6DA BK?JEI E JDEI E>H=HO FHLE@A = =AN?AFJE D=@EC A?D=EI @AA@  JD=J E JDA
      2= ' AHA ) ?IJHK?J IK?D =I
              try{
                        …
                        if(…) raise(exception);
                        …
              }except{
                        handle exception
              }
      KIEC JDEI E>H=HO >A?AI
              if(waserror()){
                        handle exception
              }
              …
              if(…) error("exception");
              …
              poperror();
      Waserror =@ poperror =HA JDA >H=?AJEC AAAJI =HK@ JDA ?@A E MDE?D = AN?AFJE ECDJ
      >A H=EA@ MEJD = ?= J error
       Waserror IAJI = FEJ J MDE?D ?JH HAJKHI EB = AN?AFJE ??KHI =@ HAJKHI AH 1B JDA
       AN?AFJE ??KHI ?JH JH=IBAHI >=? J waserror =@ EJ JDA ?A=HI JDA FEJ FHALEKIO IAJ =@
       HAJKHI AH
       Poperror ?A=HI JDA AN?AFJEHAJKH FEJ FHALEKIO IAJ >O waserror
       Error fmterror =@ silenterror = H=EIA = AHHH =@ JDAO = IAJ JDA AHHH IJHEC Fmterror =@
       silenterror J=A = BH=J IJHEC MDEA error KIJ J=AI = IEFA IJHEC Error =@ fmterror FHEJ JDA
       IJHEC  IJ=@=H@ AHHH =I MA Silenterror @AI J
       -N?AFJE ?JANJI >H=?AJA@ >O waserror =@ poperror ?= >A AIJA@ 9DA = AN?AFJE D=I
       >AA D=@A@ E JDA EAHIJ ?JANJ = ?= J nexterror JH=IBAHI EJ J JDA ANJ =HCAH ?JANJ
EXAMPLES
     7IEC AN?AFJEI J BHAA @O=E? AHO
             if(waserror()){
                    free(p);
                    nexterror();
             }
             p = malloc(something);
             …
             if(…)
                    fmterror("%s: %r", x);
             …



                                                    !$#
-444                                                                                         -444 



               free(p);
               poperror();
       -N?AHFJ BH JDA MHAH E>H=HO 6DA MHAH ?=I = KIAHIF?EBEA@ BK?JE JD=J =O H=EIA = AHHH
       6DA AHHH EI ?=KCDJ =@ JDA MHAH FHAF=HAI BH JDA ANJ ?KIJAH
               static void
               worker(void *arg)
               {
                        Worker *w;

                       w = arg;
                       for(;;){
                             w−>r = recvp(w−>chan);
                             if(!waserror()){
                                   w−>r−>func(w, w−>r−>arg);
                                   poperror();
                             }
                             reqfree(w−>r);
                             sendp(workerthreads, w);
                       }
               }
DIAGNOSTICS
     Waserror HAJKHI AH MDA = AHHH M=I H=EIA@
SEE ALSO
      worker 
BUGS
       6DA AHHH IJ=? EI O ! ALAI @AAF
AUTHOR
     5=FA KA@AH




                                                  !$$
-44564                                                                                             -44564 




NAME
       AHHIJH HAHHIJH MAHHIJH   @AI?HEFJE B =IJ IOIJA ?= AHHH
SYNOPSIS
     #include <u.h>
     #include <libc.h>
       int errstr(char *err, uint nerr)
       void rerrstr(char *err, uint nerr)
       void werrstr(char *fmt, ...)
DESCRIPTION
      9DA = IOIJA ?= B=EI EJ HAJKHI  =@ HA?H@I = K JAHE=JA@ IJHEC @AI?HE>EC JDA AHHH E =
      FAHFH?AII >KBBAH Errstr IM=FI JDA ?JAJI B JD=J >KBBAH MEJD JDA ?JAJI B JDA =HH=O err
      Errstr ME MHEJA =J IJ nerr >OJAI EJ err EB JDA FAHFH?AII AHHH IJHEC @AI J BEJ EJ EI IEAJO
      JHK?=JA@ =J = 76. ?D=H=?JAH >K@=HO 6DA HAJKHA@ IJHEC EI 7JAHE=JA@ 7IK=O errstr ME
      >A ?=A@ MEJD = AFJO IJHEC >KJ JDA AN?D=CA FHFAHJO FHLE@AI = A?D=EI BH E>H=HEAI J
      IAJ JDA HAJKH L=KA BH JDA ANJ ?= J errstr
       6DA FAHFH?AII >KBBAH EI ERRMAX >OJAI C )O AHHH IJHEC FHLE@A@ >O JDA KIAH ME >A JHK
       ?=JA@ =J ERRMAX−1 >OJAI ERRMAX EI @ABEA@ E <libc.h>
       1B  IOIJA ?= D=I CAAH=JA@ = AHHH IE?A JDA =IJ ?= J errstr MEJD = AFJO IJHEC JDA HAIKJ
       EI = AFJO IJHEC
       6DA LAH> r E print  ?=I errstr =@ KJFKJI JDA AHHH IJHEC
       Rerrstr HA=@I JDA AHHH IJHEC >KJ @AI J @EBO JDA FAHFH?AII >KBBAH I = IK>IAGKAJ errstr
       ME HA?LAH JDA I=A IJHEC
       Werrstr J=AI = print IJOA BH=J =I EJI =HCKAJ =@ KIAI EJ J BH=J = IJHEC J F=II J errstr
       6DA IJHEC HAJKHA@ BH errstr EI @EI?=H@A@
SOURCE
     /sys/src/libc/9syscall
     /sys/src/libc/9sys/werrstr.c
DIAGNOSTICS
     Errstr =M=OI HAJKHI 
SEE ALSO
      intro  perror 




                                                       !$%
-8-6                                                                                       -8-6 




NAME
       ALAJ AEEJ AIJ=HJ AIJ=HJB AJEAH AHA=@ AKIA A>@ A?=HA=@ A?=KIA A?=>@ AHA=@
       KIA A=JKIA AHAIEA@ ACAJHA?J A@H=MCAJHA?J AAKDEJ ALAJ AIAJ?KHIH -LAJ
       KIA AK CH=FDE?I ALAJI
SYNOPSIS
     #include        <u.h>
     #include        <libc.h>
     #include        <draw.h>
     #include        <event.h>
     #include        <cursor.h>
       void          einit(ulong keys)
       ulong         event(Event *e)
       Mouse         emouse(void)
       int           ekbd(void)
       int           ecanmouse(void)
       int           ecankbd(void)
       int           ereadmouse(Mouse *m)
       int           eatomouse(Mouse *m, char *buf, int n)
       ulong         estart(ulong key, int fd, int n)
       ulong         estartfn(int id, ulong key, int fd, int n,
                         int (*fn)(Event*, uchar*, int))
       ulong         etimer(ulong key, int n)
       ulong         eread(ulong keys, Event *e)
       int           ecanread(ulong keys)
       void          eresized(int new)
       Rectangle egetrect(int but, Mouse *m)
       void          edrawgetrect(Rectangle r, int up)
       int           emenuhit(int but, Mouse *m, Menu *menu)
       int           emoveto(Point p)
       int           esetcursor(Cursor *c)
       extern Mouse           *mouse
       enum{
                     Emouse = 1,
                     Ekeyboard = 2,
       };
DESCRIPTION
      6DAIA HKJEAI FHLE@A = EJAHB=?A J KJEFA IKH?AI B EFKJ BH KJDHA=@A@ FHCH=I
      6DHA=@A@ FHCH=I IAA thread  IDK@ EIJA=@ KIA JDA JDHA=@A@ KIA =@ AO>=H@ EJAHB=?A
      @AI?HE>A@ E mouse  =@ keyboard  
       Einit KIJ >A ?=A@ BEHIJ 1B JDA =HCKAJ J einit D=I JDA Emouse =@ Ekeyboard >EJI IAJ JDA
       KIA =@ AO>=H@ ALAJI ME >A A=>A@ E JDEI ?=IA initdraw IAA graphics  KIJ D=LA
       =HA=@O >AA ?=A@ 6DA KIAH KIJ FHLE@A = BK?JE ?=A@ eresized J >A ?=A@ MDAALAH JDA
       ME@M E MDE?D JDA FH?AII EI HKEC D=I >AA HAIEA@ JDA =HCKAJ new EI = B=C IFA?EBOEC
       MDAJDAH JDA FHCH= KIJ ?= getwindow IAA graphics  J HAAIJ=>EID = ?A?JE J EJI ME
       @M )BJAH HAIEEC =@ FAHD=FI ?=EC getwindow JDA C>= L=HE=>A screen ME >A KF@=JA@
       J FEJ J JDA AM ME@M I Image IJHK?JKHA
       )I ?D=H=?JAHI =HA JOFA@  JDA AO>=H@ JDAO =HA HA=@ >O JDA ALAJ A?D=EI =@ FKJ E =
       GKAKA Ekbd HAJKHI JDA ANJ HKA BH JDA GKAKA >?EC KJE JDA GKAKA EI AFJO 6DA



                                                 !$&
-8-6                                                                                            -8-6 



      ?D=H=?JAHI =HA HA=@ E H=M @A IAA cons! I JDAO =HA =L=E=>A =I I =I = ?FAJA HKA EI
      JOFA@
      9DA JDA KIA LAI H = KIA >KJJ EI FHAIIA@ H HAA=IA@ = AM KIA ALAJ EI GKAKA@ >O
      JDA ALAJ A?D=EI Emouse HAJKHI JDA ANJ KIA ALAJ BH JDA GKAKA >?EC KJE JDA
      GKAKA EI AFJO Emouse HAJKHI = Mouse IJHK?JKHA
             struct Mouse
             {
                 int   buttons;
                 Point xy;
                 ulong msec;
             };
      Buttons&1 EI IAJ MDA JDA ABJ KIA >KJJ EI FHAIIA@ buttons&2 MDA JDA E@@A >KJJ
      EI FHAIIA@ =@ buttons&4 MDA JDA HECDJ >KJJ EI FHAIIA@ 6DA ?KHHAJ KIA FIEJE EI
      =M=OI HAJKHA@ E xy Msec EI = JEA IJ=F E KEJI B EEIA?@I
      Ecankbd =@ ecanmouse HAJKH AH MDA JDAHA =HA AO>=H@ H KIA ALAJI =L=E=>A J >A
      HA=@
      Ereadmouse HA=@I JDA ANJ KIA ALAJ BH JDA BEA @AI?HEFJH ?A?JA@ J JDA KIA ?LAHJI
      JDA JANJK= @=J= EJ = Mouse IJHK?JKHA >O ?=EC eatomouse MEJD JDA >KBBAH =@ ?KJ BH JDA
      HA=@ ?= =@ HAJKHI JDA K>AH B >OJAI HA=@ H  BH = AHHH
      Estart ?= >A KIA@ J HACEIJAH =@@EJE= BEA @AI?HEFJHI J I?= BH EFKJ 1J J=AI =I =HCKAJI
      JDA BEA @AI?HEFJH J HACEIJAH JDA =NEK ACJD B = ALAJ AII=CA  JD=J @AI?HEFJH =@ =
      AO J >A KIA@ E =??AIIEC JDA ALAJ 6DA AO KIJ >A = FMAH B =@ KIJ J ?BE?J MEJD
      =O FHALEKI AOI 1B = AH AO EI CELA = AO ME >A =?=JA@ =@ HAJKHA@ Estartfn EI IEE=H
      J estart >KJ FH?AIIAI JDA @=J= HA?AELA@ >O ?=EC fn >ABHA HAJKHEC JDA ALAJ J JDA KIAH 6DA
      BK?JE fn EI ?=A@ MEJD JDA id B JDA ALAJ EJ IDK@ HAJKH id EB JDA ALAJ EI J >A F=IIA@ J JDA
      KIAH 0 EB EJ EI J >A ECHA@ 6DA L=HE=>A Event.v ?= >A KIA@ >O fn J =JJ=?D = =H>EJH=HO @=J=
      EJA J JDA HAJKHA@ Event IJHK?JKHA       Ekeyboard =@ Emouse =HA JDA AO>=H@ =@ KIA
      ALAJ AOI
      Etimer IJ=HJI = HAFA=JEC JEAH MEJD = FAHE@ B n EEIA?@I EJ HAJKHI JDA JEAH ALAJ AO H
      AH EB EJ B=EI O A JEAH ?= >A IJ=HJA@ -NJH= JEAH ALAJI =HA J GKAKA@ =@ JDA JEAH
      ?D=A D=I  =II?E=JA@ @=J=
      Eread M=EJI BH JDA ANJ ALAJ IFA?EBEA@ >O JDA =I keys B ALAJ AOI IK>EJJA@ J estart 1J BEI
      E JDA =FFHFHE=JA BEA@ B JDA =HCKAJ Event IJHK?JKHA MDE?D I EA
             struct Event
             {
                 int   kbdc;
                 Mouse mouse;
                 int   n;
                 void *v;
                 uchar data[EMAXMSG];
             };
      Data EI = =HH=O MDE?D EI =HCA AKCD J D@ = '2 AII=CA Eread HAJKHI JDA AO BH JDA ALAJ
      MDE?D M=I ?DIA .H AN=FA EB = KIA ALAJ M=I HA=@ Emouse ME >A HAJKHA@
      Event M=EJI BH JDA ANJ ALAJ B =O E@ 6DA HAJKH EI JDA I=A =I BH eread
      )I @AI?HE>A@ E graphics  JDA CH=FDE?I BK?JEI =HA >KBBAHA@ Event eread emouse =@ ekbd
      = ?=KIA = >KBBAH BKID KAII JDAHA EI = ALAJ B JDA =FFHFHE=JA JOFA =HA=@O GKAKA@
      Ecanread ?DA?I MDAJDAH = ?= J eread(keys) MK@ >? HAJKHEC  EB EJ MK@  EB EJ
      MK@ J
      Getrect FHFJI JDA KIAH J IMAAF = HA?J=CA 1J IDK@ >A ?=A@ MEJD m D@EC JDA KIA
      ALAJ JD=J JHECCAHA@ JDA egetrect H EB A = Mouse MEJD buttons IAJ J % 1J ?D=CAI J JDA
      IMAAF ?KHIH M=EJI BH JDA >KJJI = J >A HAA=IA@ =@ JDA M=EJI BH >KJJ K>AH but J >A
      FHAIIA@ =HEC JDA EEJE= ?HAH 1B =JDAH >KJJ EI FHAIIA@ EIJA=@ egetrect HAJKHI = HA?J=
      CA MEJD AH BH >JD ?HAHI =BJAH M=EJEC BH = JDA >KJJI J >A HAA=IA@ JDAHMEIA egetrect
      ?JEK=O @H=MI JDA IMAFJ HA?J=CA KJE JDA >KJJ EI HAA=IA@ =C=E =@ HAJKHI JDA IMAFJ



                                                   !$'
-8-6                                                                                           -8-6 



       HA?J=CA 6DA KIA IJHK?JKHA FEJA@ J >O m ME ?J=E JDA BE= KIA ALAJ
       Egetrect KIAI IK??AIIELA ?=I J edrawgetrect J =EJ=E JDA HA@ HA?J=CA IDMEC JDA IMAAF
       EFHCHAII 6DA HA?J=CA J >A @H=M EI IFA?EBEA@ >O rc =@ JDA up F=H=AJAH I=OI MDAJDAH J
       @H=M  H AH=IA  JDA HA?J=CA
       Emenuhit @EIF=OI = AK =@ HAJKHI = IAA?JA@ AK EJA K>AH 1J IDK@ >A ?=A@ MEJD m
       D@EC JDA KIA ALAJ JD=J JHECCAHA@ JDA emenuhit EJ ME ?= emouse J KF@=JA EJ ) Menu EI =
       IJHK?JKHA
              struct Menu
              {
                  char **item;
                  char *(*gen)(int);
                  int   lasthit;
              };
       1B item EI AH EJ IDK@ >A = KJAHE=JA@ =HH=O B JDA ?D=H=?JAH IJHECI J >A @EIF=OA@ =I
       AK EJAI JDAHMEIA gen IDK@ >A = BK?JE JD=J CELA = EJA K>AH HAJKHI JDA ?D=H=?
       JAH IJHEC BH JD=J EJA H AH EB JDA K>AH EI F=IJ JDA A@ B JDA EIJ 1JAI =HA K>AHA@ IJ=HJ
       EC =J AH Menuhit M=EJI KJE but EI HAA=IA@ =@ JDA HAJKHI JDA K>AH B JDA IAA?JE H
          BH  IAA?JE 6DA m =HCKAJ EI BEA@ E MEJD JDA BE= KIA ALAJ
       Emoveto LAI JDA KIA ?KHIH J JDA FIEJE p  JDA I?HAA
       Esetcursor ?D=CAI JDA ?KHIH E=CA J JD=J @AI?HE>A@ >O JDA Cursor c IAA mouse  1B c EI E
       EJ HAIJHAI JDA E=CA J JDA @AB=KJ =HHM
SOURCE
     /sys/src/libdraw
SEE ALSO
      rio graphics  plumb  cons! draw!




                                                   !%
-:-+                                                                                              -:-+ 




NAME
       ANA? ANA? FHEL=JAI FHEL=JAI JI   ANA?KJA = BEA
SYNOPSIS
     #include <u.h>
     #include <libc.h>
       void* exec(char *name, char* argv[])
       void* execl(char *name, ...)
       void **_privates;
       int    _nprivates;
       #include <tos.h>
       typedef struct Tos Tos;
       struct Tos {
           struct { ... } prof;                   /*   profiling data */
           uvlong cyclefreq;                      /*   cycle clock frequency */
           vlong   kcycles;                       /*   kernel cycles */
           vlong   pcycles;                       /*   process cycles (kernel + user) */
           ulong   pid;                           /*   process id */
           ulong   clock;                         /*   profiling clock */
           /* top of stack is here                */
       };
       extern Tos *_tos;
DESCRIPTION
      Exec =@ execl LAH=O JDA ?=EC FH?AII MEJD JDA =A@ BEA JDA JH=IBAH J JDA AJHO FEJ B
      JDA E=CA B JDA BEA
       Name FEJI J JDA =A B JDA BEA J >A ANA?KJA@ EJ KIJ J >A = @EHA?JHO =@ JDA FAHEIIEI
       KIJ =M JDA ?KHHAJ KIAH J ANA?KJA EJ IAA stat  1J IDK@ =I >A = L=E@ >E=HO E=CA =I
       @ABEA@ E JDA a.out$ BH JDA ?KHHAJ =?DEA =H?DEJA?JKHA H = IDA I?HEFJ IAA rc 6DA BEHIJ
       EA B = IDA I?HEFJ KIJ >ACE MEJD #! BMA@ >O JDA =A B JDA FHCH= J EJAHFHAJ JDA BEA
       =@ =O EEJE= =HCKAJI J JD=J FHCH= BH AN=FA
              #!/bin/rc
              ls | mc
       9DA = + FHCH= EI ANA?KJA@ EJ EI ?=A@ =I BMI
              void main(int argc, char *argv[])
       Argv EI = ?FO B JDA =HH=O B =HCKAJ FEJAHI F=IIA@ J exec JD=J =HH=O KIJ A@ E = K
       FEJAH =@ argc EI JDA K>AH B AAAJI >ABHA JDA K FEJAH *O ?LAJE JDA BEHIJ =HCK
       AJ IDK@ >A JDA =A B JDA FHCH= J >A ANA?KJA@ Execl EI EA exec AN?AFJ JD=J argv ME
       >A = =HH=O B JDA F=H=AJAHI JD=J BM name E JDA ?= 6DA =IJ =HCKAJ J execl KIJ >A =
       K FEJAH
       .H = BEA >ACEEC #! JDA =HCKAJI F=IIA@ J JDA FHCH= /bin/rc E JDA AN=FA =>LA
       ME >A JDA =A B JDA BEA >AEC ANA?KJA@ =O =HCKAJI  JDA #! EA JDA =A B JDA BEA
       =C=E =@ BE=O JDA IA?@ =@ IK>IAGKAJ =HCKAJI CELA J JDA HECE= exec ?= 6DA HAIKJ
       DHI JDA JM ?LAJEI B = FHCH= =??AFJEC =I =HCKAJ = BEA J >A EJAHFHAJA@ =@
       argv[0] =EC JDA BEA >AEC ANA?KJA@
       IJ =JJHE>KJAI B JDA ?=EC FH?AII =HA ?=HHEA@ EJ JDA HAIKJ E F=HJE?K=H BEAI HA=E FA
       =?HII exec AN?AFJ JDIA FAA@ MEJD OCEXEC 4 @ EJ JDA FA @A IAA open  =@ JDA
       MHEC @EHA?JHO =@ ALEHAJ IAA env! HA=E JDA I=A 0MALAH = AMO exec’ed FH
       ?AII D=I  JEBE?=JE D=@AH IAA notify 
       6DA C>= ?A _privates FEJI J = =HH=O B _nprivates AAAJI B FAHFH?AII FHEL=JA
       @=J= 6DEI IJH=CA EI FHEL=JA BH A=?D FH?AII ALA EB JDA FH?AIIAI ID=HA @=J= IACAJI
       9DA JDA AM FHCH= >ACEI JDA C>= FEJAH _tos EI IAJ J JDA =@@HAII B = IJHK?JKHA JD=J
       D@I EBH=JE =MEC =??KH=JA JEA AAFEC =@ ?? HA=@EC E KIAH IF=?A 6DAIA @=J= =HA



                                                     !%
-:-+                                                                                             -:-+ 



       KF@=JA@ >O JDA AHA @KHEC B JDA EBA B JDA FH?AII E?K@EC =?HII rforkI =@ execI 1B JDAHA
       EI = KIAHIF=?A =??AIIE>A B=IJ ?? = FH?AIIH ?O?A ?KJAH cyclefreq ME >A IAJ J EJI BHA
       GKA?O E 0 Kcycles pcycles ?KJI JDA K>AH B ?O?AI JDEI FH?AII D=I IFAJ E AHA
       @A AHA =@ KIAH @A Pid EI JDA ?KHHAJ FH?AII I E@ Clock EI JDA KIAHFHBEEC ??
       IAA prof 1JI JEA EI A=IKHA@ E EEIA?@I >KJ EI KF@=JA@ =J = IOIJA@AFA@AJ MAH
       H=JA 6DEI ?? EI JOFE?=O KIA@ >O JDA FHBEAH >KJ EI =L=E=>A J = FHCH=I
       6DA =>LA ?LAJEI =FFO J + FHCH=I JDA H=M IOIJA EJAHB=?A J JDA AM E=CA EI =I B
       MI JDA MH@ FEJA@ J >O JDA IJ=? FEJAH EI argc JDA MH@I >AO@ JD=J =HA JDA AHJD =@
       IK>IAGKAJ AAAJI B argv BMA@ >O = JAHE=JEC K FEJAH =@ JDA HAJKH HACEIJAH AC
       R0  JDA $&  ?J=EI JDA =@@HAII B JDA ?? EBH=JE
SOURCE
     /sys/src/libc/9syscall
     /sys/src/libc/port/execl.c
SEE ALSO
      prof intro  stat 
DIAGNOSTICS
     1B JDAIA BK?JEI B=E JDAO HAJKH =@ IAJ errstr 6DAHA ?= >A  HAJKH J JDA ?=EC FH?AII
     BH = IK??AIIBK exec H execl JDA ?=EC E=CA EI IJ
BUGS
       6DAHA EI = =HCA >KJ BEEJA EEJ  JDA IEA B = =HCAJ EIJ JOFE?=O =HK@ "'$ >OJAI 6DA
       AHA ?IJ=J TSTKSIZ ?JHI JDEI




                                                   !%
-:165                                                                                              -:165 




NAME
       ANEJI ANEJI =JANEJ =JANEJ@J JAHE=JA   JAHE=JA FH?AII FH?AII ?A=KF
SYNOPSIS
     #include <u.h>
     #include <libc.h>
       void _exits(char *msg)
       void exits(char *msg)
       int    atexit(void(*)(void))
       void atexitdont(void(*)(void))
DESCRIPTION
      Exits EI JDA ?LAJE= M=O J JAHE=JA = FH?AII _Exits EI JDA K@AHOEC IOIJA ?= 6DAO ?=
      ALAH HAJKH
       Msg ?LAJE=O E?K@AI = >HEAB =NEK ACJD ERRLEN ANF==JE B JDA HA=I BH ANEJ
       EC H = K FEJAH H AFJO IJHEC J E@E?=JA H= JAHE=JE 6DA IJHEC EI F=IIA@ J JDA
       F=HAJ FH?AII FHABENA@ >O JDA =A =@ FH?AII E@ B JDA ANEJEC FH?AII MDA JDA F=HAJ @AI
       = wait 
       *ABHA ?=EC _exits MEJD msg =I = =HCKAJ exits ?=I E HALAHIA H@AH = JDA BK?JEI
       HA?H@A@ >O atexit
       Atexit HA?H@I fn =I = BK?JE J >A ?=A@ >O exits 1J HAJKHI AH EB EJ B=EA@ AH JDAHMEIA
       ) JOFE?= KIA EI J HACEIJAH = ?A=KF HKJEA BH = 1 F=?=CA 6 IEFEBO FHCH=I JD=J BH H
       ID=HA AHO exits O ?=I JDIA atexitHACEIJAHA@ BK?JEI JD=J MAHA HACEIJAHA@ >O JDA I=A
       FH?AII =I JD=J ?=EC exits
       +=EC atexit JME?A H HA MEJD JDA I=A BK?JE =HCKAJ ?=KIAI exits J ELA JDA BK?JE
       JME?A H HA
       6DAHA EI = EEJ J JDA K>AH B ANEJ BK?JEI JD=J ME >A HA?H@A@ atexit HAJKHI  EB JD=J EEJ
       D=I >AA HA=?DA@
       Atexitdont ?=?AI = FHALEKI HACEIJH=JE B = ANEJ BK?JE
SOURCE
     /sys/src/libc/port/atexit.c
SEE ALSO
      fork  wait 




                                                      !%!
-:2                                                                                      -:2 




NAME
         ANF C C FM FM IGHJ    ANFAJE= C=HEJD FMAH IGK=HA HJ
SYNOPSIS
     #include <u.h>
     #include <libc.h>
         double exp(double x)
         double log(double x)
         double log10(double x)
         double pow(double x, double y)
         double pow10(int n)
         double sqrt(double x)
DESCRIPTION
      Exp HAJKHI JDA ANFAJE= BK?JE B x
         Log HAJKHI JDA =JKH= C=HEJD B x log10 HAJKHI JDA >=IA  C=HEJD
         Pow HAJKHI xy =@ pow10 HAJKHI 10n =I = @K>A
         Sqrt HAJKHI JDA IGK=HA HJ B x
SOURCE
     ) JDAIA HKJEAI D=LA FHJ=>A + EFAAJ=JEI E /sys/src/libc/port IJ =I D=LA
     =?DEA@AFA@AJ       EFAAJ=JEI   MHEJJA    AEJDAH E  =IIA>AH H    +   E
     /sys/src/libc/$objtype
SEE ALSO
      hypot  sinh  intro 




                                                     !%"
.)760                                                                                         .)760 




NAME
       B=KJD   IAJ KF =KJDAJE?=JE  = BEA @AI?HEFJH J = BEA IAHLAH
SYNOPSIS
     #include <u.h>
     #include <libc.h>
       int      fauth(int fd, char *aname)
DESCRIPTION
      Fauth EI KIA@ J AIJ=>EID =KJDAJE?=JE BH JDA ?KHHAJ KIAH J =??AII JDA HAIKH?AI =L=E=>A
      JDHKCD JDA '2 ?A?JE HAFHAIAJA@ >O fd 6DA HAJKH L=KA EI = BEA @AI?HEFJH ?LAJE=O
      ?=A@ afd JD=J EI IK>IAGKAJO KIA@ J ACJE=JA JDA =KJDAJE?=JE FHJ? BH JDA IAHLAH JOFE
      ?=O KIEC auth_proxy H fauth_proxy IAA auth  )BJAH IK??AIIBK =KJDAJE?=JE afd =O >A
      F=IIA@ =I JDA IA?@ =HCKAJ J = IK>IAGKAJ mount ?= IAA bind  MEJD JDA I=A aname,
      =I = JE?AJBAJHO BH JDA KIAH
       1B fauth HAJKHI  JDA AHHH ?=IA JD=J A=I JDA BEA IAHLAH @AI J HAGKEHA =KJDAJE?=JE BH
       JDA ?A?JE =@ afd IDK@ >A IAJ J  E JDA ?= J mount.
       1J EI H=HA J KIA fauth @EHA?JO HA ?O amount IAA auth  EI KIA@
SOURCE
     /sys/src/libc/9syscall
SEE ALSO
      attach# auth  F=HJE?K=HO amount authsrv$ auth&
DIAGNOSTICS
     5AJI errstr




                                                     !%#
.+)                                                                                    .+) 




NAME
       .?= ?L5  ?L,  ?L 5 ?L , B?=BJ @EHBJ @EH@ABJ HA=@'FIC
       IJ=J?DA? IEA5  IEA,  EJAHB=?A J 2= ' .EA FHJ?
SYNOPSIS
     #include <u.h>
     #include <libc.h>
     #include <fcall.h>
       uint convS2M(Fcall *f, uchar *ap, uint nap)
       uint convD2M(Dir *d, uchar *ap, uint nap)
       uint convM2S(uchar *ap, uint nap, Fcall *f)
       uint convM2D(uchar *ap, uint nap, Dir *d, char *strs)
       int dirfmt(Fmt*)
       int fcallfmt(Fmt*)
       int dirmodefmt(Fmt*)
       int read9pmsg(int fd, uchar *buf, uint nbuf)
       int statcheck(uchar *buf, uint nbuf)
       uint sizeS2M(Fcall *f)
       uint sizeD2M(Dir *d)
DESCRIPTION
      6DAIA HKJEAI ?LAHJ AII=CAI E JDA =?DEAE@AFA@AJ BH=J B JDA 2= ' BEA FHJ?
      '2 J =@ BH = HA ?LAEAJ BH = Fcall IJHK?JKHA
       #define MAXWELEM 16

       typedef
       struct Fcall
       {
           uchar type;
           u32int    fid;
           ushort    tag;
           union {
                 struct {
                     u32int         msize;                    /* Tversion, Rversion */
                     char           *version;                 /* Tversion, Rversion */
                 };
                 struct {
                     ushort         oldtag;                   /* Tflush */
                 };
                 struct {
                     char           *ename;                   /* Rerror */
                 };
                 struct {
                     Qid            qid;                      /* Rattach, Ropen, Rcreate */
                     u32int         iounit;                   /* Ropen, Rcreate */
                 };
                 struct {
                     Qid            aqid;                     /* Rauth */
                 };
                 struct {
                     u32int         afid;                     /* Tauth, Tattach */
                     char           *uname;                   /* Tauth, Tattach */
                     char           *aname;                   /* Tauth, Tattach */
                 };



                                                !%$
.+)                                                                                      .+) 



                    struct {
                        u32int      perm;                      /* Tcreate */
                        char        *name;                     /* Tcreate */
                        uchar       mode;                      /* Tcreate, Topen */
                    };
                    struct {
                        u32int      newfid;                    /* Twalk */
                        ushort      nwname;                    /* Twalk */
                        char        *wname[MAXWELEM];          /* Twalk */
                    };
                    struct {
                        ushort      nwqid;                     /* Rwalk */
                        Qid         wqid[MAXWELEM];            /* Rwalk */
                    };
                    struct {
                        vlong       offset;                    /* Tread, Twrite */
                        u32int      count;                     /* Tread, Twrite, Rread */
                        char        *data;                     /* Twrite, Rread */
                    };
                    struct {
                        ushort      nstat;                     /* Twstat, Rstat */
                        uchar       *stat;                     /* Twstat, Rstat */
                    };
          };
      } Fcall;

      /* these are implemented as macros */

      uchar         GBIT8(uchar*)
      ushort        GBIT16(uchar*)
      ulong         GBIT32(uchar*)
      vlong         GBIT64(uchar*)

      void          PBIT8(uchar*, uchar)
      void          PBIT16(uchar*, ushort)
      void          PBIT32(uchar*, ulong)
      void          PBIT64(uchar*, vlong)

      #define       BIT8SZ          1
      #define       BIT16SZ         2
      #define       BIT32SZ         4
      #define       BIT64SZ         8
      6DEI IJHK?JKHA EI @ABEA@ E <fcall.h> 5AA IA?JE # BH = BK @AI?HEFJE B '2 AII=CAI =@
      JDAEH A?@EC .H = AII=CA JOFAI JDA type BEA@ B = Fcall D@I A B Tversion
      Rversion Tattach Rattach AJ? @ABEA@ E = AKAH=JA@ JOFA E <fcall.h> Fid EI
      KIA@ >O IJ AII=CAI =@ tag EI KIA@ >O = AII=CAI 6DA JDAH BEA@I =HA KIA@ IAA?JELAO >O
      JDA AII=CA JOFAI CELA E ?AJI
      ConvM2S J=AI = '2 AII=CA =J ap B ACJD nap =@ KIAI EJ J BE E Fcall IJHK?JKHA f 1B JDA
      F=IIA@ AII=CA E?K@EC =O @=J= BH Twrite =@ Rread AII=CAI EI BH=JJA@ FHFAHO JDA
      HAJKH L=KA EI JDA K>AH B >OJAI JDA AII=CA ??KFEA@ E JDA >KBBAH ap MDE?D ME =M=OI >A
      AII JD= H AGK= J nap JDAHMEIA EJ EI  .H Twrite =@ Tread AII=CAI data EI IAJ J =
      FEJAH EJ JDA =HCKAJ AII=CA J = ?FO
      ConvS2M @AI JDA HALAHIA ?LAHIE JKHEC f EJ = AII=CA IJ=HJEC =J ap 6DA ACJD B JDA
      HAIKJEC AII=CA EI HAJKHA@ .H Twrite =@ Rread AII=CAI count >OJAI IJ=HJEC =J
      data =HA ?FEA@ EJ JDA AII=CA
      6DA ?IJ=J IOHDRSZ EI = IKEJ=>A =KJ B >KBBAH J HAIAHLA BH IJHEC JDA '2 DA=@AH JDA
      @=J= FHJE B = Twrite H Rread ME >A  HA JD= JDA >KBBAH IEA ACJE=JA@ E JDA
      Tversion/Rversion AN?D=CA EKI IOHDRSZ



                                                !%%
.+)                                                                                          .+) 



       6DA HKJEA sizeS2M HAJKHI JDA K>AH B >OJAI HAGKEHA@ J IJHA JDA =?DEAE@AFA@AJ HAF
       HAIAJ=JE B JDA Fcall IJHK?JKHA f E?K@EC EJI EEJE= ! >EJ IEA BEA@ 1 JDAH MH@I EJ
       HAFHJI JDA K>AH B >OJAI FH@K?A@ >O = IK??AIIBK ?= J convS2M
       )JDAH IJHK?JKHA EI Dir KIA@ >O JDA HKJEAI @AI?HE>A@ E stat  ConvM2D ?LAHJI JDA
       =?DEAE@AFA@AJ BH IJ=HJEC =J ap EJ d =@ HAJKHI JDA ACJD B JDA =?DEA
       E@AFA@AJ A?@EC 6DA IJHECI E JDA HAJKHA@ Dir IJHK?JKHA =HA IJHA@ =J IK??AIIELA ?=
       JEI IJ=HJEC =J strs 7IK=O strs ME FEJ J IJH=CA EA@E=JAO =BJAH JDA Dir EJIAB 1J ?=
       =I >A = nil FEJAH E MDE?D ?=IA JDA IJHEC FEJAHI E JDA HAJKHA@ Dir =HA = nil DMALAH
       JDA HAJKH L=KA IJE E?K@AI JDAEH ACJD
       ConvD2M @AI JDA HALAHIA JH=I=JE =I HAJKHEC JDA ACJD B JDA A?@EC 1B JDA >KBBAH EI
       J IDHJ JDA HAJKH L=KA ME >A BIT16SZ =@ JDA ?HHA?J IEA ME >A HAJKHA@ E JDA BEHIJ
       BIT16SZ >OJAI 1B JDA >KBBAH EI AII JD=J BIT16SZ JDA HAJKH L=KA EI AH JDAHABHA = ?HHA?J
       JAIJ BH ?FAJA F=?EC B JDA AII=CA EI JD=J JDA HAJKH L=KA EI CHA=JAH JD= BIT16SZ 6DA
       =?H GBIT16 ?= >A KIA@ J ANJH=?J JDA ?HHA?J L=KA 6DA HA=JA@ =?HI MEJD @EBBAHAJ IEAI
       HAJHEALA JDA ?HHAIF@ECIEA@ GK=JEJEAI PBIT16 =@ EJI >HAJDHA F=?A L=KAI E AII=CAI
       9EJD JDA AN?AFJE B D=@EC IDHJ >KBBAHI E convD2M JDAIA =?HI =HA J KIK=O AA@A@
       AN?AFJ >O EJAH= HKJEAI
       )=CKI J sizeS2M sizeD2M HAJKHI JDA K>AH B >OJAI HAGKEHA@ J IJHA JDA =?DEA
       E@AFA@AJ HAFHAIAJ=JE B JDA Dir IJHK?JKHA d E?K@EC EJI EEJE= $>EJ IEA BEA@
       6DA HKJEA statcheck ?DA?I MDAJDAH JDA nbuf >OJAI B buf ?J=E = L=E@O BH=JJA@
       =?DEAE@AFA@AJ Dir AJHO IKEJ=>A =I = =HCKAJ BH AN=FA BH JDA wstat IAA
       stat  IOIJA ?= 1J ?DA?I JD=J JDA IEAI B = JDA AAAJI B JDA JDA AJHO IK J AN=?JO
       nbuf MDE?D EI = IEFA >KJ ABBA?JELA JAIJ B L=E@EJO Nbuf =@ buf IDK@ E?K@A JDA IA?@ JM
       >OJA $>EJ ACJD BEA@ JD=J FHA?A@AI JDA AJHO MDA BH=JJA@ E = '2 AII=CA IAA stat# E
       JDAH MH@I nbuf EI FKI JDA IK B JDA IEAI B JDA AJHO EJIAB Statcheck =I LAHEBEAI JD=J JDA
       ACJD BEA@ D=I JDA ?HHA?J L=KA JD=J EI nbuf−2 1J HAJKHI 0 BH = L=E@ AJHO =@ −1 BH =
       E?HHA?JO BH=JJA@ AJHO
       Dirfmt fcallfmt =@ dirmodefmt =HA BH=JJEC HKJEAI IKEJ=>A BH fmtinstall  6DAO ?LAHJ
       Dir* Fcall* =@ long L=KAI EJ IJHEC HAFHAIAJ=JEI B JDA @EHA?JHO >KBBAH Fcall
       >KBBAH H BEA @A L=KA Fcallfmt =IIKAI JD=J dirfmt D=I >AA EIJ=A@ MEJD BH=J AJJAH D
       =@ dirmodefmt MEJD BH=J AJJAH M
       Read9pmsg ?=I read  KJEFA JEAI EB A?AII=HO J HA=@ = AJEHA '2 AII=CA EJ buf 6DA
       HAJKH L=KA EI  BH A@ B BEA H  BH AHHH EJ @AI J HAJKH F=HJE= AII=CAI
SOURCE
     /sys/src/libc/9sys
SEE ALSO
      intro  9p  stat  intro#




                                                   !%&
., 2)60                                                                                    ., 2)60  




NAME
       B@ F=JD   HAJKH BEA =A =II?E=JA@ MEJD BEA @AI?HEFJH
SYNOPSIS
     #include <u.h>
     #include <libc.h>
       int fd2path(int fd, char *buf, int nbuf)
DESCRIPTION
      )I @AI?HE>A@ E intro  JDA AHA IJHAI = HJA@ F=JD =A MEJD ALAHO FA BEA H @EHA?JHO
      JOFE?=O EJ EI JDA =A KIA@ E JDA HECE= =??AII B JDA BEA Fd2path HAJKHI JDA F=JD =A
      =II?E=JA@ MEJD FA BEA @AI?HEFJH fd 7F J nbuf >OJAI B JDA =A =HA IJHA@ E buf EB JDA =A
      EI J C EJ ME >A IEAJO JHK?=JA@ =J = 76.& ?D=H=?JAH >K@=HO 6DA =A EI =M=OI K
      JAHE=JA@ 6DA HAJKH L=KA B fd2path ME >A AH KAII = AHHH ??KHI
       +D=CAI J JDA K@AHOEC =A IF=?A @ J KF@=JA JDA F=JD =A IJHA@ MEJD JDA BEA @AI?HEF
       JH 6DAHABHA JDA F=JD HAJKHA@ >O fd2path =O  CAH HABAH J JDA I=A BEA H E@AA@ =O
       BEA =BJAH IA ?FAJ @EHA?JHO H BEA E JDA F=JD D=I >AA HALA@ HA=A@ H HA>K@
       )I = AN=FA getwd  EI EFAAJA@ >O FAEC . =@ ANA?KJEC fd2path  JDA HAIKJEC BEA
       @AI?HEFJH
SOURCE
     /sys/src/libc/9syscall
SEE ALSO
      bind ns bind  intro  getwd  proc!
DIAGNOSTICS
     5AJI errstr




                                                    !%'
./-6+                                                                                               ./-6+ 




NAME
       BCAJ? CAJ? CAJ?D=H BFKJ? FKJ? FKJ?D=H KCAJ? BCAJI CAJI BFKJI FKJI BHA=@ BMHEJA   5J@E EFKJ
       =@ KJFKJ
SYNOPSIS
     #include <u.h>
     #include <stdio.h>
       int    fgetc(FILE *f)
       int    getc(FILE *f)
       int    getchar(void)
       int    fputc(int c, FILE *f)
       int    putc(int c, FILE *f)
       int    putchar(int c)
       int    ungetc(int c, FILE *f)
       char *fgets(char *s, int n, FILE *f)
       char *gets(char *s)
       int    fputs(char *s, FILE *f)
       int    puts(char *s)
       long fread(void *ptr, long itemsize, long nitems, FILE *stream)
       long fwrite(void *ptr, long itemsize, long nitems, FILE *stream)
DESCRIPTION
      6DA BK?JEI @AI?HE>A@ DAHA MH  FA 5J@E IJHA=I IAA fopen
       Fgetc HAJKHI =I = int JDA ANJ unsigned char BH EFKJ IJHA= f 1B JDA IJHA= EI =J A@
       BBEA JDA A@BBEA E@E?=JH BH JDA IJHA= EI IAJ =@ fgetc HAJKHI EOF 1B = HA=@ AHHH
       ??KHI JDA AHHH E@E?=JH BH JDA IJHA= EI IAJ =@ fgetc HAJKHI EOF Getc EI EA fgetc AN?AFJ
       JD=J EJ EI EFAAJA@ =I = =?H Getchar EI EA getc AN?AFJ JD=J EJ =M=OI HA=@I BH stdin
       Ungetc FKIDAI ?D=H=?JAH c >=? J JDA EFKJ IJHA= f 6DA FKIDA@>=? ?D=H=?JAH ME >A
       HAJKHA@ >O IK>IAGKAJ HA=@I E JDA HALAHIA H@AH B JDAEH FKIDEC ) IK??AIIBK EJAHLAEC
       fseek fsetpos H rewind  f @EI?=H@I =O FKIDA@>=? ?D=H=?JAHI BH f A ?D=H=?JAH B FKID
       >=? EI CK=H=JAA@ Ungetc HAJKHI JDA ?D=H=?JAH FKIDA@ >=? ?LAHJA@ J unsigned char
       H EOF EB JDA FAH=JE B=EI ) IK??AIIBK ?= J ungetc ?A=HI JDA A@BBEA E@E?=JH BH JDA
       IJHA= 6DA BEA FIEJE E@E?=JH BH JDA IJHA= =BJAH HA=@EC H @EI?=H@EC = FKIDA@>=? ?D=H
       =?JAHI EI JDA I=A =I EJ M=I >ABHA JDA ?D=H=?JAHI MAHA FKIDA@ >=?
       Fputc MHEJAI ?D=H=?JAH c ?LAHJA@ J unsigned char J KJFKJ IJHA= f =J JDA FIEJE E@E
       ?=JA@ >O JDA FIEJE E@E?=JH BH JDA IJHA= =@ =@L=?AI JDA E@E?=JH =FFHFHE=JAO 1B JDA BEA
       ?=J IKFFHJ FIEJEEC HAGKAIJI H EB JDA IJHA= M=I FAA@ MEJD =FFA@ @A JDA ?D=H=?JAH
       EI =FFA@A@ J JDA KJFKJ IJHA= Fputc HAJKHI JDA ?D=H=?JAH MHEJJA H EOF EB JDAHA M=I = MHEJA
       AHHH Putc EI EA fputc >KJ EI EFAAJA@ =I = =?H Putchar EI EA putc AN?AFJ JD=J EJ =M=OI
       MHEJAI J stdout
       ) JDAH EFKJ J=AI F=?A =I EB ?D=H=?JAHI MAHA HA=@ >O IK??AIIELA ?=I J fgetc =@ = JDAH KJ
       FKJ J=AI F=?A =I EB ?D=H=?JAHI MAHA MHEJJA >O IK??AIIELA ?=I J fputc
       Fgets HA=@I KF J =@ E?K@EC JDA ANJ AMEA >KJ J F=IJ A@BBEA H HA JD= n ?D=H
       =?JAHI BH IJHA= f EJ =HH=O s ) K ?D=H=?JAH EI MHEJJA EA@E=JAO =BJAH JDA =IJ ?D=H=?JAH
       HA=@ EJ JDA =HH=O EB =O ?D=H=?JAHI =HA HA=@ =J = Fgets HAJKHI s EB IK??AIIBK JDAHMEIA = K
       FEJAH Gets EI IEE=H J fgets AN?AFJ JD=J EJ =M=OI HA=@I BH stdin =@ EJ @EI?=H@I JDA JAHE
       =JEC AMEA EB =O Gets @AI J ?DA? BH LAHBM B JDA HA?AELEC =HH=O I EJI KIA EI @AFHA
       ?=JA@
       Fputs MHEJAI JDA IJHEC s J IJHA= f HAJKHEC EOF EB = MHEJA AHHH ??KHHA@ JDAHMEIA = AC=
       JELA L=KA 6DA JAHE=JEC K ?D=H=?JAH EI J MHEJJA Puts EI JDA I=A MHEJEC J stdout




                                                     !&
./-6+                                                                                       ./-6+ 



       Fread HA=@I BH JDA =A@ EFKJ stream =J IJ nitems B @=J= B IEA itemsize =@ JDA JOFA B
       *ptr EJ = >? >ACEEC =J ptr 1J HAJKHI JDA K>AH B EJAI =?JK=O HA=@
       Fwrite =FFA@I J JDA =A@ KJFKJ stream =J IJ nitems B @=J= B IEA itemsize =@ JDA JOFA B
       *ptr BH = >? >ACEEC =J ptr 1J HAJKHI JDA K>AH B EJAI =?JK=O MHEJJA
SOURCE
     /sys/src/libstdio
SEE ALSO
      read  fopen  bio 
BUGS
       5J@E @AI J D=@A 76. H HKAI KIA *E EIJA=@




                                                   !&
.)6-                                                                                                   .)6- 




NAME
       @AB=JAEEJ @AB=JA @AB=JAE> @AB=JA>? @AB=JAE>>? EB=JAEEJ EB=JA EB=JAE> EB=JA
       >? EB=JAE>>? B=JAAHH ?H?J=> >??H? =@AH!     @AB=JA ?FHAIIE
SYNOPSIS
     #include <u.h>
     #include <libc.h>
     #include <flate.h>
       int       deflateinit(void)
       int       deflate(void *wr, int (*w)(void*,void*,int),
                 void *rr, int (*r)(void*,void*,int),
                 int level, int debug)
       int       deflatezlib(void *wr, int (*w)(void*,void*,int),
                 void *rr, int (*r)(void*,void*,int),
                 int level, int debug)
       int       deflateblock(uchar *dst, int dsize,
                 uchar *src, int ssize,
                 int level, int debug)
       int       deflatezlibblock(uchar *dst, int dsize,
                 uchar *src, int ssize,
                 int level, int debug)
       int       inflateinit(void)
       int       inflate(void *wr, int (*w)(void*, void*, int),
                 void *getr, int (*get)(void*))
       int       inflatezlib(void *wr, int (*w)(void*, void*, int),
                 void *getr, int (*get)(void*))
       int       inflateblock(uchar *dst, int dsize,
                 uchar *src, int ssize)
       int       inflatezlibblock(uchar *dst, int dsize,
                 uchar *src, int ssize)
       char      *flateerr(int error)
       ulong     *mkcrctab(ulong poly)
       ulong     blockcrc(ulong *tab, ulong crc, void *buf, int n)
       ulong     adler32(ulong adler, void *buf, int n)
DESCRIPTION
      6DAIA HKJEAI ?FHAII =@ @A?FHAII @=J= KIEC JDA @AB=JA ?FHAIIE =CHEJD MDE?D EI
      KIA@ BH IJ CEF EF =@ E> BEAI
       Deflate ?FHAIIAI EFKJ @=J= HAJHEALA@ >O ?=I J r MEJD =HCKAJI rr = EFKJ >KBBAH =@ =
       ?KJ B >OJAI J HA=@ R IDK@ HAJKH JDA K>AH B >OJAI HA=@ A@ B EFKJ EI IEC=A@ >O
       HAJKHEC AH = EFKJ AHHH >O HAJKHEC = AC=JELA K>AH 6DA ?FHAIIA@ KJFKJ EI MHEJJA
       J w MEJD =HCKAJI wr JDA KJFKJ @=J= =@ JDA K>AH B >OJAI J MHEJA W IDK@ HAJKH JDA
       K>AH B >OJAI MHEJJA MHEJEC BAMAH JD= JDA HAGKAIJA@ K>AH B >OJAI EI = AHHH Level E@E
       ?=JAI JDA =KJ B ?FKJ=JE @AB=JA IDK@ @ MDEA ?FHAIIEC JDA @=J= 0ECDAH levels KIK
       =O J=A HA JEA =@ FH@K?A I=AH KJFKJI 8=E@ L=KAI =HA  J ' E?KIELA $ EI = C@
       ?FHEIA 1B debug EI AH ?HOFJE? @A>KCCEC EBH=JE EI FH@K?A@  IJ=@=H@ AHHH
       Inflate HALAHIAI JDA FH?AII ?LAHJEC ?FHAIIA@ @=J= EJ K?FHAIIA@ KJFKJ 1FKJ EI
       HAJHEALA@ A >OJA =J = JEA >O ?=EC get MEJD JDA =HCKAJ getr -@ B EFKJ B IEC=A@ >O
       HAJKHEC = AC=JELA L=KA 6DA K?FHAIIA@ KJFKJ EI MHEJJA J w MDE?D D=I JDA I=A EJAH
       B=?A =I BH deflate
       Deflateblock =@ inflateblock FAH=JA  >?I B AHO >KJ =HA JDAHMEIA IEE=H J deflate =@
       inflate



                                                       !&
.)6-                                                                                            .)6- 



      6DA E> BK?JEI =HA IEE=H >KJ FAH=JA  BEAI MEJD = E> DA=@AH =@ JH=EAH
      Deflateinit H inflateinit KIJ >A ?=A@ ?A >ABHA =O ?= J JDA ?HHAIF@EC HKJEAI
      1B JDA =>LA HKJEAI B=E JDAO HAJKH = AC=JELA K>AH E@E?=JEC JDA FH>A 6DA FIIE>A L=
      KAI =HA FlateNoMem  FlateInputFail FlateOutputFail FlateCorrupted =@ FlateInternal Flateerr
      ?LAHJI JDA K>AH EJ = FHEJ=>A AII=CA FlateOk EI @ABEA@ J >A AH JDA IK??AIIBK HAJKH
      L=KA BH deflateinit deflate deflatezlib inflateinit inflate =@ inflatezlib 6DA >? BK?JEI
      HAJKH JDA K>AH B >OJAI FH@K?A@ MDA JDAO IK??AA@
      Mkcrctab =?=JAI KIEC malloc  EEJE=EAI =@ HAJKHI = J=>A BH H=FE@ ?FKJ=JE B ! >EJ
      +4+ L=KAI KIEC JDA FOE= poly Blockcrc KIAI tab = J=>A HAJKHA@ >O mkcrctab J KF@=JA
      crc BH JDA n >OJAI B @=J= E buf =@ HAJKHI JDA AM L=KA Crc IDK@ EEJE=O >A AH Blockcrc
      FHA?@EJEI =@ FIJ?@EJEI crc >O AI ?FAAJ=JE
      Adler32 KF@=JAI JDA )@AH ! >EJ ?DA?IK B JDA n >KJAI B @=J= E buf. 6DA EEJE= L=KA B adler
      JD=J EI EJI L=KA =BJAH IAAEC AH >OJAI IDK@ >A 
SOURCE
     /sys/src/libflate




                                                    !&!
.4                                                                                          .4 




NAME
       B=>I B@ BH ?AE   =>IKJA L=KA HA=E@AH BH ?AEEC BK?JEI
SYNOPSIS
     #include <u.h>
     #include <libc.h>
       double floor(double x)
       double ceil(double x)
       double fabs(double x)
       double fmod(double x, double y)
DESCRIPTION
      Fabs HAJKHI JDA =>IKJA L=KA  x 
       Floor HAJKHI JDA =HCAIJ EJACAH J CHA=JAH JD= x
       Ceil HAJKHI JDA I=AIJ EJACAH J AII JD= x
       Fmod HAJKHI x EB y EI AH JDAHMEIA JDA K>AH f MEJD JDA I=A IEC =I x IK?D JD=J x = iy + f BH
       IA EJACAH i =@  f    y 
SOURCE
     /sys/src/libc/port
SEE ALSO
      abs  frexp 




                                                     !&"
.6156)                                                                              .6156) 




NAME
       BJEIJ= @BJ @HBJ BJFHEJ BJLFHEJ BJHKA BJIJH?FO BJHKAIJH?FO BJB@EEJ BJB@
       BKID BJIJHEEJ BJIJHBKID HKABJIJHEEJ HKABJIJHBKID AHHBJ  IKFFHJ BH KIAH@ABEA@
       FHEJ BH=JI =@ KJFKJ HKJEAI
SYNOPSIS
     #include <u.h>
     #include <libc.h>
       typedef struct Fmt Fmt;
       struct Fmt{
           uchar   runes; /* output buffer is runes or chars? */
           void    *start; /* of buffer */
           void    *to;    /* current place in the buffer */
           void    *stop; /* end of the buffer; overwritten if flush fails */
           int     (*flush)(Fmt*);/* called when to == stop */
           void    *farg; /* to make flush a closure */
           int     nfmt;   /* num chars formatted so far */
           va_list args;   /* args passed to dofmt */
           int     r;      /* % format Rune */
           int     width;
           int     prec;
           ulong   flags;
       };
       enum{
           FmtWidth           =   1,
           FmtLeft            =   FmtWidth << 1,
           FmtPrec            =   FmtLeft << 1,
           FmtSharp           =   FmtPrec << 1,
           FmtSpace           =   FmtSharp << 1,
           FmtSign            =   FmtSpace << 1,
           FmtZero            =   FmtSign << 1,
           FmtUnsigned        =   FmtZero << 1,
           FmtShort           =   FmtUnsigned << 1,
           FmtLong            =   FmtShort << 1,
           FmtVLong           =   FmtLong << 1,
           FmtComma           =   FmtVLong << 1,
             FmtFlag          = FmtComma << 1
       };
       int      fmtfdinit(Fmt *f, int fd, char *buf, int nbuf);
       int      fmtfdflush(Fmt *f);
       int      fmtstrinit(Fmt *f);
       char* fmtstrflush(Fmt *f);
       int      runefmtstrinit(Fmt *f);
       Rune* runefmtstrflush(Fmt *f);

       int      fmtinstall(int c, int (*fn)(Fmt*));
       int      dofmt(Fmt *f, char *fmt);
       int      dorfmt(Fmt*, Rune *fmt);
       int      fmtprint(Fmt *f, char *fmt, ...);
       int      fmtvprint(Fmt *f, char *fmt, va_list v);
       int      fmtrune(Fmt *f, int r);
       int      fmtstrcpy(Fmt *f, char *s);




                                                  !&#
.6156)                                                                                 .6156) 



       int      fmtrunestrcpy(Fmt *f, Rune *s);
       int      errfmt(Fmt *f);
DESCRIPTION
      6DA EJAHB=?A @AI?HE>A@ DAHA =MI JDA ?IJHK?JE B ?KIJ print  LAH>I =@ KJFKJ HKJEAI
      1 AIIA?A JDAO FHLE@A =??AII J JDA MHECI B JDA BH=JJA@ FHEJ ?@A
       6DA print  IKEJA =EJ=EI EJI IJ=JA MEJD = @=J= IJHK?JKHA ?=A@ Fmt ) JOFE?= ?= J print  H
       EJI HA=JELAI EEJE=EAI = Fmt IJHK?JKHA F=IIAI EJ J IK>IE@E=HO HKJEAI J FH?AII JDA KJFKJ =@
       BEEIDAI >O AEJJEC =O I=LA@ IJ=JA HA?H@A@ E JDA Fmt 6DA @AJ=EI B JDA Fmt =HA KEFHJ=J
       J KJIE@A KIAHI AN?AFJ EIB=H =I JDA CAAH= @AIEC EBKA?AI JDA EJAHB=?A 6DA Fmt HA?H@I
       MDAJDAH JDA KJFKJ EI E HKAI H >OJAI JDA LAH> >AEC FH?AIIA@ EJI FHA?EIE =@ ME@JD =@
       >KBBAHEC F=H=AJAHI IJ EFHJ=J EJ =I HA?H@I = flush HKJEA JD=J JDA E>H=HO ME ?= EB =
       >KBBAH LAHBMI 9DA FHEJEC J = BEA @AI?HEFJH JDA BKID HKJEA ME AEJ I=LA@ ?D=H=?JAHI
       =@ HAIAJ JDA >KBBAH MDA FHEJEC J = =?=JA@ IJHEC EJ ME HAIEA JDA IJHEC J HA?AELA HA
       KJFKJ 6DA BKID HKJEA EI E MDA FHEJEC J BENA@IEA >KBBAHI 7IAH ?@A AA@ ALAH FHLE@A
       = BKID HKJEA JDEI EI @A EJAH=O >O JDA E>H=HO
   Custom output routines
      6 MHEJA = ?KIJ KJFKJ HKJEA IK?D =I = AHHH D=@AH JD=J BH=JI =@ FHEJI ?KIJ AHHH
      AII=CAI JDA KJFKJ IAGKA?A ?= >A HK BH KJIE@A JDA E>H=HO KIEC JDA HKJEAI @AI?HE>A@
      DAHA 6DAHA =HA JM =E ?=IAI KJFKJ J = FA BEA @AI?HEFJH =@ KJFKJ J = IJHEC
       6 MHEJA J = BEA @AI?HEFJH ?= fmtfdinit J EEJE=EA JDA ?= Fmt IJHK?JKHA f CELEC JDA BEA
       @AI?HEFJH fd JDA >KBBAH buf =@ EJI IEA nbuf 6DA ?= fmtprint H fmtvprint J CAAH=JA JDA
       KJFKJ 6DAIA >AD=LA EA fprint IAA print  H vfprint AN?AFJ JD=J JDA ?D=H=?JAHI =HA >KB
       BAHA@ KJE fmtfdflush EI ?=A@ =@ JDA HAJKH L=KA EI AEJDAH  H  ) JOFE?= AN=FA B JDEI
       IAGKA?A =FFA=HI E JDA -N=FAI IA?JE
       6DA I=A >=IE? IAGKA?A =FFEAI MDA KJFKJJEC J = =?=JA@ IJHEC ?= fmtstrinit J EEJE=EA
       JDA Fmt JDA ?= fmtprint =@ fmtvprint J CAAH=JA JDA KJFKJ .E=O fmtstrflush ME HAJKH
       JDA =?=JA@ IJHEC MDE?D IDK@ >A BHAA@ =BJAH KIA 6 KJFKJ J = HKA IJHEC KIA
       runefmtstrinit =@ runefmtstrflush 4AC=H@AII B JDA KJFKJ IJOA H JOFA fmtprint H fmtvprint
       CAAH=JAI JDA ?D=H=?JAHI
   Custom format verbs
      Fmtinstall EI KIA@ J EIJ= ?KIJ LAH>I =@ B=CI =>AA@ >O ?D=H=?JAH c MDE?D =O >A =O 
      AH 7E?@A ?D=H=?JAH Fn IDK@ >A @A?=HA@ =I
              int      fn(Fmt*)
       Fp−>r EI JDA B=C H LAH> ?D=H=?JAH J ?=KIA fn J >A ?=A@ 1 fn fp−>width, fp−>prec =HA
       JDA ME@JD =@ FHA?EIE =@ fp−>flags JDA @A?@A@ B=CI BH JDA LAH> IAA print  BH =
       @AI?HEFJE B JDAIA EJAI 6DA IJ=@=H@ B=C L=KAI =HA FmtSign + FmtLeft −
       FmtSpace ’ ’ FmtSharp # FmtComma , FmtLong l FmtShort h
       FmtUnsigned u =@ FmtVLong ll 6DA B=C >EJI FmtWidth =@ FmtPrec E@AJEBO
       MDAJDAH = ME@JD =@ FHA?EIE MAHA IFA?EBEA@
       Fn EI F=IIA@ = FEJAH J JDA Fmt IJHK?JKHA HA?H@EC JDA IJ=JA B JDA KJFKJ 1B fp−>r EI = LAH>
       H=JDAH JD= = B=C fn IDK@ KIA Fmt−>args J BAJ?D EJI =HCKAJ BH JDA EIJ JDA BH=J EJ
       =@ HAJKH AH 1B fp−>r EI = B=C fn IDK@ HAJKH A ) EJAHFHAJ=JE B fp−>width
       fp−>prec =@ fp−>flags EI ABJ KF J JDA ?LAHIE HKJEA Fmtinstall HAJKHI  EB JDA EIJ=
       =JE IK??AA@I  EB EJ B=EI
       Fmtprint =@ fmtvprint =O >A ?=A@ J DAF FHAF=HA KJFKJ E ?KIJ ?LAHIE HKJEAI 0M
       ALAH JDAIA BK?JEI ?A=H JDA ME@JD FHA?EIE =@ B=CI *JD BK?JEI HAJKH  BH IK??AII =@
         BH B=EKHA
       6DA BK?JEI dofmt =@ dorfmt =HA JDA K@AHOEC BH=JJAHI JDAO KIA JDA ANEIJEC ?JAJI B
       Fmt =@ IDK@ >A ?=A@ O >O IFDEIJE?=JA@ ?LAHIE HKJEAI 6DAIA HKJEAI HAJKH JDA
       K>AH B ?D=H=?JAHI >OJAI B 76. H HKAI FH@K?A@
       5A EJAH= BK?JEI =O >A KIABK J BH=J FHEEJELA JOFAI 6DAO DH JDA ME@JD FHA?EIE
       =@ B=CI =I @AI?HE>A@ E print  Fmtrune BH=JI = IECA ?D=H=?JAH r Fmtstrcpy BH=JI =
       IJHEC s fmtrunestrcpy BH=JI = HKA IJHEC s Errfmt BH=JI JDA IOIJA AHHH IJHEC ) JDAIA
       HKJEAI HAJKH AH BH IK??AIIBK ANA?KJE +LAHIE HKJEAI JD=J ?= JDAIA BK?JEI ME



                                                    !&$
.6156)                                                                             .6156) 



       MH FHFAHO HAC=H@AII B MDAJDAH JDA KJFKJ EI >OJAI H HKAI
       2c @AI?HE>AI JDA + @EHA?JELA #pragma varargck JD=J ?= >A KIA@ J FHLE@A JOFA?DA?EC
       BH ?KIJ FHEJ LAH>I =@ KJFKJ HKJEAI
EXAMPLES
     6DEI BK?JE FHEJI = AHHH AII=CA MEJD = L=HE=>A K>AH B =HCKAJI =@ JDA GKEJI +
     F=HA@ J JDA ?HHAIF@EC AN=FA E print  JDEI LAHIE KIAI = I=AH >KBBAH ME ALAH JHK
     ?=JA JDA KJFKJ AII=CA >KJ ECDJ CAAH=JA KJEFA write IOIJA ?=I J FH@K?A EJI KJFKJ
               #pragma varargck argpos             fatal       1
               void
               fatal(char *fmt, ...)
               {
                    Fmt f;
                    char buf[64];
                    va_list arg;
                     fmtfdinit(&f, 1, buf, sizeof buf);
                     fmtprint(&f, "fatal: ");
                     va_start(arg, fmt);
                     fmtvprint(&f, fmt, arg);
                     va_end(arg);
                     fmtprint(&f, "\n");
                     fmtfdflush(&f);
                     exits("fatal error");
               }
       6DEI AN=FA =@@I = LAH> J FHEJ ?FAN K>AHI
               typedef struct {
                   double  r, i;
               } Complex;
               #pragma varargck type "X" Complex
               int
               Xfmt(Fmt *f)
               {
                   Complex c;
                     c = va_arg(f−>args, Complex);
                     return fmtprint(f, "(%g,%g)", c.r, c.i);
               }
               main(...)
               {
                   Complex x = (Complex){ 1.5, −2.3 };
                     fmtinstall(’X’, Xfmt);
                     print("x = %X\n", x);
               }
SOURCE
     /sys/src/libc/fmt
SEE ALSO
      print  utf$ errstr 
DIAGNOSTICS
     6DAIA HKJEAI HAJKH AC=JELA K>AHI H E BH AHHHI =@ IAJ errstr




                                                  !&%
.2-                                                                                           .2- 




NAME
       BFA BHAFA B@FA BEA B?IA IFAH IFAM I?IA BBKID IAJL>KB IAJ>KB BCAJFI
       BJA BIAJFI BIAA HAME@ BAB BAHHH ?A=HAHH IJ=@=H@ >KBBAHA@ EFKJKJFKJ F=?=CA
SYNOPSIS
     #include <u.h>
     #include <stdio.h>
       FILE *fopen(char *filename, char *mode)
       FILE *freopen(char *filename, char *mode, FILE *f)
       FILE *fdopen(int fd, char *mode)
       int    fileno(FILE *f)
       FILE *sopenr(char *s)
       FILE *sopenw(void)
       char *sclose(FILE *f)
       int    fclose(FILE *f)
       int    fflush(FILE *f)
       int    setvbuf(FILE *f, char *buf, int type, long size)
       void setbuf(FILE *f, char *buf)
       int    fgetpos(FILE *f, long *pos)
       long ftell(FILE *f)
       int    fsetpos(FILE *f, long *pos)
       int    fseek(FILE *f, long offset, int whence)
       void rewind(FILE *f)
       int    feof(FILE *f)
       int    ferror(FILE *f)
       void clearerr(FILE *f)
DESCRIPTION
      6DA BK?JEI @AI?HE>A@ E JDEI =@ HA=JA@ F=CAI fgetc  fprintf  fscanf  =@ tmpfile 
      EFAAJ JDA )51 + >KBBAHA@ 1 F=?=CA MEJD ANJAIEI
       ) BEA MEJD =II?E=JA@ >KBBAHEC EI ?=A@ = stream =@ EI @A?=HA@ J >A = FEJAH J = @ABEA@ JOFA
       FILE Fopen  ?HA=JAI ?AHJ=E @AI?HEFJELA @=J= BH = IJHA= =@ HAJKHI = FEJAH J @AIEC=JA
       JDA IJHA= E = BKHJDAH JH=I=?JEI 6DAHA =HA JDHAA H=O FA IJHA=I MEJD ?IJ=J FEJ
       AHI @A?=HA@ E JDA E?K@A BEA =@ =II?E=JA@ MEJD JDA IJ=@=H@ FA BEAI
       stdin IJ=@=H@ EFKJ BEA
       stdout IJ=@=H@ KJFKJ BEA
       stderr IJ=@=H@ AHHH BEA
       ) ?IJ=J FEJAH NULL @AIEC=JAI  IJHA= =J =
       Fopen FAI JDA BEA =A@ >O filename =@ =II?E=JAI = IJHA= MEJD EJ Fopen HAJKHI = FEJAH J
       >A KIA@ J E@AJEBO JDA IJHA= E IK>IAGKAJ FAH=JEI H NULL EB JDA FA B=EI Mode EI = ?D=H
       =?JAH IJHEC D=LEC A B JDA BMEC L=KAI
       "r"      FA BH HA=@EC
       "w"      JHK?=JA J AH ACJD H ?HA=JA BH MHEJEC
       "a"      =FFA@ FA H ?HA=JA BH MHEJEC =J A@ B BEA
       "r+" FA BH KF@=JA HA=@EC =@ MHEJEC
       "w+" JHK?=JA J AH ACJD H ?HA=JA BH KF@=JA
       "a+" =FFA@ FA H ?HA=JA BH KF@=JA =J A@ B BEA
       1 =@@EJE A=?D B JDA =>LA IJHECI ?= D=LA = b IAMDAHA =BJAH JDA BEHIJ ?D=H=?JAH A=EC
        >E=HO BEA  >KJ JDEI EFAAJ=JE =AI  @EIJE?JE >AJMAA >E=HO =@ JANJ BEAI




                                                   !&&
.2-                                                                                              .2- 



       Fclose ?=KIAI JDA IJHA= FEJA@ J >O f J >A BKIDA@ IAA >AM =@ @AI = close IAA open 
        JDA =II?E=JA@ BEA 1J BHAAI =O =KJ=JE?=O =?=JA@ >KBBAH Fclose EI ?=A@ =KJ=JE?=O 
       exits  BH = FA IJHA=I
       Freopen EI EA FA AN?AFJ JD=J EJ HAKIAI IJHA= FEJAH f Freopen BEHIJ =JJAFJI J ?IA =O BEA
       =II?E=JA@ MEJD f EJ ECHAI =O AHHHI E JD=J ?IA
       Fdopen =II?E=JAI = IJHA= MEJD = FA 2= ' BEA @AI?HEFJH
       Fileno HAJKHI JDA K>AH B JDA 2= ' BEA @AI?HEFJH =II?E=JA@ MEJD JDA IJHA=
       Sopenr =II?E=JAI = HA=@O IJHA= MEJD = KJAHE=JA@ IJHEC
       Sopenw FAI = IJHA= BH MHEJEC  BEA @AI?HEFJH EI =II?E=JA@ MEJD JDA IJHA= EIJA=@ =
       KJFKJ EI MHEJJA J JDA IJHA= >KBBAH
       Sclose ?IAI = IJHA= FAA@ MEJD sopenr H sopenw 1J HAJKHI = FEJAH J JDA  JAHE=JA@
       >KBBAH =II?E=JA@ MEJD JDA IJHA=
       *O @AB=KJ KJFKJ J = IJHA= EI BKO >KBBAHA@ EJ EI =??KK=JA@ E = >KBBAH KJE JDA >KBBAH EI BK
       =@ JDA write IAA read  EI KIA@ J MHEJA JDA >KBBAH ) AN?AFJE EI IJ=@=H@ AHHH MDE?D EI
       EA >KBBAHA@ KJFKJ EI =??KK=JA@ E = >KBBAH KJE = AMEA EI MHEJJA 1FKJ EI =I BKO >KB
       BAHA@ >O @AB=KJ JDEI A=I JD=J read  EI KIA@ J BE = >KBBAH =I K?D =I EJ ?= =@ JDA ?D=H=?
       JAHI =HA J=A BH JD=J >KBBAH KJE EJ AFJEAI Setvbuf ?D=CAI JDA >KBBAHEC AJD@ BH BEA f
       =??H@EC J type: AEJDAH _IOFBF BH BKO >KBBAHA@ _IOLBF BH EA >KBBAHA@ H _IONBF BH
       K>KBBAHA@ A=?D ?D=H=?JAH ?=KIAI = read H write). 1B buf EI IKFFEA@ EJ EI KIA@ =I JDA >KBBAH =@
       size IDK@ >A EJI IEA 1B buf EI AH = >KBBAH B JDA CELA IEA EI =?=JA@ AN?AFJ BH JDA
       K>KBBAHA@ ?=IA KIEC malloc 
       Setbuf EI = @AH AJD@ BH ?D=CEC >KBBAHEC 1B buf EI IKFFEA@ EJ ?D=CAI J BKO >KBBAHA@
       MEJD JDA CELA >KBBAH MDE?D IDK@ >A B IEA BUFSIZ @ABEA@ E stdio.h 1B buf EI AH JDA
       >KBBAHEC AJD@ ?D=CAI J K>KBBAHA@
       Fflush BKIDAI JDA >KBBAH B KJFKJ IJHA= f @AELAHEC =O KMHEJJA >KBBAHA@ @=J= J JDA DIJ BEA
       6DAHA EI = file position indicator =II?E=JA@ MEJD A=?D IJHA= 1J IJ=HJI KJ FEJEC =J JDA BEHIJ
       ?D=H=?JAH KAII JDA BEA EI FAA@ MEJD =FFA@ @A E MDE?D ?=IA JDA E@E?=JH EI =M=OI
       ECHA@ 6DA BEA FIEJE E@E?=JH EI =EJ=EA@ >O JDA HA=@EC =@ MHEJEC BK?JEI @AI?HE>A@
       E fgetc 
       Fgetpos IJHAI JDA ?KHHAJ L=KA B JDA BEA FIEJE E@E?=JH BH IJHA= f E JDA >A?J FEJA@ J
       >O pos 1J HAJKHI AH  IK??AII AH JDAHMEIA Ftell HAJKHI JDA ?KHHAJ L=KA B JDA BEA
       FIEJE E@E?=JH 6DA BEA FIEJE E@E?=JH EI J >A KIA@ O =I = =HCKAJ J fseek.
       Fsetpos IAJI JDA BEA FIEJE E@E?=JH BH IJHA= f J JDA L=KA B JDA >A?J FEJA@ J >O pos
       MDE?D ID= >A = L=KA HAJKHA@ >O = A=HEAH ?= J fgetpos  JDA I=A IJHA= 1J HAJKHI AH 
       IK??AII AH JDAHMEIA Fseek >J=EI = AM FIEJE A=IKHA@ E ?D=H=?JAHI BH JDA >ACE
       EC B JDA BEA >O =@@EC offset J JDA FIEJE IFA?EBEA@ >O whence JDA >ACEEC B JDA BEA EB
       whence EI SEEK_SET JDA ?KHHAJ L=KA B JDA BEA FIEJE E@E?=JH BH SEEK_CUR =@ JDA
       A@BBEA BH SEEK_END Rewind IAJI JDA BEA FIEJE E@E?=JH J JDA >ACEEC B JDA BEA
       ) EJACAH ?IJ=J EOF EI HAJKHA@ KF A@ B BEA H AHHH >O EJACAHL=KA@ BK?JEI JD=J @A=
       MEJD IJHA=I Feof HAJKHI AH EB =@ O EB f EI =J EJI A@ B BEA
       Ferror HAJKHI AH EB =@ O EB f EI E JDA AHHH IJ=JA 1J ?= CAJ EJ JDA AHHH IJ=JA EB = IOI
       JA ?= B=EA@  JDA =II?E=JA@ BEA H = AHO =?=JE B=EA@ Clearerr J=AI = IJHA= KJ B
       JDA AHHH IJ=JA
SOURCE
     /sys/src/libstdio
SEE ALSO
      fprintf  fscanf  fgetc 
      open  read 
DIAGNOSTICS
     6DA L=KA EOF EI HAJKHA@ KEBHO J E@E?=JA JD=J = FILE FEJAH D=I J >AA EEJE=EA@ MEJD
     fopen EFKJ KJFKJ D=I >AA =JJAFJA@  = KJFKJ EFKJ IJHA= H = FILE FEJAH @AIEC
     =JAI ?HHKFJ H JDAHMEIA KEJAECE>A FILE @=J=
     5A B JDAIA BK?JEI IAJ errstr


                                                     !&'
.2-                                                                                              .2- 



BUGS
       *KBBAHEC B KJFKJ ?= FHALAJ KJFKJ @=J= BH >AEC IAA KJE C =BJAH EJ EI ?FKJA@ FAH
       D=FI ALAH =I MDA = =>HJ ??KHI >AJMAA >KBBAH BEEC =@ BKIDEC
       *KBBAHEC B EFKJ ?= ?=KIA = FH?AII J ?IKA HA EFKJ JD= EJ =?JK=O KIAI 6DEI ?=
       ?=KIA JHK>A =?HII exec 
       *KBBAHEC =O @A=O JDA HA?AEFJ B = MHEJA AHHH KJE = IK>IAGKAJ stdio MHEJEC IAAEC H BEA
       ?IEC ?=
       )51 I=OI JD=J = BEA ?= >A BKO >KBBAHA@ O EB JDA BEA EI J =JJ=?DA@ J = EJAH=?JELA @ALE?A 1
       2= ' = =HA BKO >KBBAHA@ AN?AFJ IJ=@=H@ AHHH
       Fdopen fileno sopenr sopenw =@ sclose =HA J )51 5J@E BK?JEI
       5J@E BBAHI  IKFFHJ BH HKAI H 76. ?D=H=?JAHI 7AII ANJAH= ?F=JE>EEJO EI A?AII=HO KIA
       bio  MDE?D IKFFHJI 76. =@ EI I=AH B=IJAH =@ IEFAH JD= 5J@E




                                                     !'
.4                                                                                                .4 




NAME
       BH HBH   =EFK=JA FH?AII HAIKH?AI
SYNOPSIS
     #include <u.h>
     #include <libc.h>
       int fork(void)
       int rfork(int flags)
DESCRIPTION
      .HEC EI JDA O M=O AM FH?AIIAI =HA ?HA=JA@ 6DA flags =HCKAJ J rfork IAA?JI MDE?D
      HAIKH?AI B JDA ELEC FH?AII F=HAJ =HA ID=HA@ >O JDA AM FH?AII ?DE@ H EEJE=EA@ J
      JDAEH @AB=KJ L=KAI 6DA HAIKH?AI E?K@A JDA BEA =A IF=?A JDA FA BEA @AI?HEFJH J=>A
      MDE?D MDA ID=HA@ FAHEJI FH?AIIAI J FA =@ ?IA BEAI BH JDAH FH?AIIAI JDA IAJ B
      ALEHAJ L=HE=>AI IAA env! JDA JA CHKF JDA IAJ B FH?AIIAI JD=J HA?AELA JAI MHEJJA
      J = A>AH I notepg BEA IAA proc! JDA IAJ B HA@ALKI J=CI IAA rendezvous   =@
      FA BEAI Flags EI JDA CE?= 4 B IA IK>IAJ B
       RFPROC          1B IAJ = AM FH?AII EI ?HA=JA@ JDAHMEIA ?D=CAI =BBA?J JDA ?KHHAJ FH?AII
       RFNOWAIT        1B IAJ JDA ?DE@ FH?AII ME >A @EII?E=JA@ BH JDA F=HAJ 7F ANEJ JDA ?DE@ ME
                       A=LA  Waitmsg IAA wait  BH JDA F=HAJ J ?A?J
       RFNAMEG         1B IAJ JDA AM FH?AII EDAHEJI = ?FO B JDA F=HAJ I =A IF=?A JDAHMEIA JDA
                       AM FH?AII ID=HAI JDA F=HAJ I =A IF=?A 1I KJK=O AN?KIELA MEJD
                       RFCNAMEG
       RFCNAMEG        1B IAJ JDA AM FH?AII IJ=HJI MEJD = ?A= =A IF=?A ) AM =A IF=?A KIJ >A
                       >KEJ BH = KJ B = FA BEA @AI?HEFJH 1I KJK=O AN?KIELA MEJD RFNAMEG
       RFNOMNT         1B IAJ IK>IAGKAJ KJI EJ JDA AM =A IF=?A =@ @AHABAHA?EC B F=JD
                       =AI IJ=HJEC MEJD # =HA @EI=MA@
       RFENVG          1B IAJ JDA ALEHAJ L=HE=>AI =HA ?FEA@ JDAHMEIA JDA JM FH?AIIAI ID=HA ALE
                       HAJ L=HE=>AI 1I KJK=O AN?KIELA MEJD RFCENVG
       RFCENVG         1B IAJ JDA AM FH?AII IJ=HJI MEJD = AFJO ALEHAJ 1I KJK=O AN?KIELA MEJD
                       RFENVG
       RFNOTEG         -=?D FH?AII EI = A>AH B = CHKF B FH?AIIAI JD=J = HA?AELA JAI MDA = JA
                       EI MHEJJA J =O B JDAEH notepg BEAI IAA proc! 6DA CHKF B = AM FH?AII EI
                       >O @AB=KJ JDA I=A =I EJI F=HAJ >KJ EB RFNOTEG EI IAJ HAC=H@AII B RFPROC
                       JDA FH?AII >A?AI JDA BEHIJ E = AM CHKF EI=JA@ BH FHALEKI FH?AIIAI
       RFFDG           1B IAJ JDA ELAH I BEA @AI?HEFJH J=>A IAA intro  EI ?FEA@ JDAHMEIA JDA JM
                       FH?AIIAI ID=HA = IECA J=>A
       RFCFDG          1B IAJ JDA AM FH?AII IJ=HJI MEJD = ?A= BEA @AI?HEFJH J=>A 1I KJK=O AN?KIELA
                       MEJD RFFDG
       RFREND          1B IAJ JDA FH?AII ME >A K=>A J rendezvous   MEJD =O B EJI =?AIJHI EJI ?DE
                       @HA ME DMALAH >A =>A J rendezvous MEJD EJ 1 ABBA?J RFREND =AI JDA
                       FH?AII JDA BEHIJ E = CHKF B FH?AIIAI JD=J ID=HA = IF=?A BH rendezvous J=CI
       RFMEM           1B IAJ JDA ?DE@ =@ JDA F=HAJ ME ID=HA data =@ bss IACAJI JDAHMEIA JDA
                       ?DE@ EDAHEJI = ?FO B JDIA IACAJI JDAH IACAJ JOFAI E F=HJE?K=H IJ=?
                       IACAJI ME >A K=BBA?JA@ =O >A IAJ O MEJD RFPROC
       .EA @AI?HEFJHI E = ID=HA@ BEA @AI?HEFJH J=>A =HA AFJ FA KJE AEJDAH JDAO =HA ANFE?EJO ?IA@
       H = FH?AIIAI ID=HEC JDA J=>A ANEJ
       1B RFPROC EI IAJ JDA L=KA HAJKHA@ E JDA F=HAJ FH?AII EI JDA FH?AII E@ B JDA ?DE@ FH?AII
       JDA L=KA HAJKHA@ E JDA ?DE@ EI AH 9EJDKJ RFPROC JDA HAJKH L=KA EI AH 2H?AII E@I
       H=CA BH  J JDA =NEK EJACAH int L=KA Rfork ME IAAF EB A?AII=HO KJE HAGKEHA@
       FH?AII HAIKH?AI =HA =L=E=>A
       Fork EI KIJ = ?= B rfork(RFFDG|RFREND|RFPROC)
SOURCE
     /sys/src/libc/9syscall
     /sys/src/libc/9sys/fork.c




                                                     !'
.4                                  .4 



SEE ALSO
      intro  proc!
DIAGNOSTICS
     6DAIA BK?JEI IAJ errstr




                                   !'
.2416.                                                                                              .2416.  




NAME
       BFHEJB FHEJB IFHEJB IFHEJB LBFHEJB LFHEJB LIFHEJB LIFHEJB   FHEJ BH=JJA@ KJFKJ
SYNOPSIS
     #include <u.h>
     #include <stdio.h>
       int fprintf(FILE *f, char *format, ...)
       int printf(char *format, ...)
       int sprintf(char *s, char *format, ...)
       int snprintf(char *s, int n, char *format, ...)
       int vfprintf(FILE *f, char *format, va_list args)
       int vprintf(char *format, va_list args)
       int vsprintf(char *s, char *format, va_list args)
       int vsnprintf(char *s, int n, char *format, va_list args)
DESCRIPTION
      Fprintf F=?AI KJFKJ  JDA =A@ KJFKJ IJHA= f IAA fopen  Printf F=?AI KJFKJ  JDA
      IJ=@=H@ KJFKJ IJHA= stdout Sprintf F=?AI KJFKJ BMA@ >O JDA K ?D=H=?JAH \0 E ?IA?
      KJELA >OJAI IJ=HJEC =J s EJ EI JDA KIAH I HAIFIE>EEJO J AIKHA JD=J AKCD IJH=CA EI =L=E=>A
      Snprintf EI EA sprintf >KJ MHEJAI =J IJ n >OJAI E?K@EC JDA K ?D=H=?JAH EJ s Vfprintf
      vprintf vsnprintf =@ vsprintf =HA JDA I=A AN?AFJ JDA args =HCKAJ EI JDA =HCKAJ EIJ B JDA
      ?=EC BK?JE =@ JDA ABBA?J EI =I EB JDA ?=EC BK?JE I =HCKAJ EIJ BH JD=J FEJ  EI
      F=IIA@ J JDA printf HKJEAI
       -=?D BK?JE HAJKHI JDA K>AH B ?D=H=?JAHI JH=IEJJA@ J E?K@EC JDA \0 E JDA ?=IA B
       sprintf =@ BHEA@I H = AC=JELA L=KA EB = KJFKJ AHHH M=I A?KJAHA@
       6DAIA BK?JEI ?LAHJ BH=J =@ FHEJ JDAEH JH=EEC =HCKAJI K@AH ?JH B = format
       IJHEC 6DA format ?J=EI JM JOFAI B >A?JI F=E ?D=H=?JAHI MDE?D =HA IEFO ?FEA@ J JDA
       KJFKJ IJHA= =@ ?LAHIE IFA?EBE?=JEI A=?D B MDE?D HAIKJI E BAJ?DEC B AH H HA
       =HCKAJI 6DA HAIKJI =HA K@ABEA@ EB JDAHA =HA =HCKAJI B JDA MHC JOFA H J BAM =HCK
       AJI BH JDA BH=J 1B JDA BH=J EI AND=KIJA@ MDEA =HCKAJI HA=E JDA AN?AII =HA ECHA@
       -=?D ?LAHIE IFA?EBE?=JE EI EJH@K?A@ >O JDA ?D=H=?JAH % )BJAH JDA % JDA BMEC =FFA=H E
       IAGKA?A
               AH H HA flags MDE?D @EBO JDA A=EC B JDA ?LAHIE IFA?EBE?=JE
               ) FJE= @A?E= @ECEJ IJHEC IFA?EBOEC = EEK field width 1B JDA ?LAHJA@ L=KA
               D=I BAMAH ?D=H=?JAHI JD= JDA BEA@ ME@JD EJ ME >A F=@@A@ MEJD IF=?AI  JDA ABJ H HECDJ
               EB JDA ABJ =@KIJAJ @AI?HE>A@ =JAH D=I >AA CELA J JDA BEA@ ME@JD
               ) FJE= precision JD=J CELAI JDA EEK K>AH B @ECEJI J =FFA=H BH JDA d i o u
               x =@ X ?LAHIEI JDA K>AH B @ECEJI J =FFA=H =BJAH JDA @A?E= FEJ BH JDA e E
               =@ f ?LAHIEI JDA =NEK K>AH B IECEBE?=J @ECEJI BH JDA g =@ G ?LAHIEI
               H JDA =NEK K>AH B ?D=H=?JAHI J >A MHEJJA BH = IJHEC E s ?LAHIE 6DA
               FHA?EIE J=AI JDA BH B = FAHE@ . BMA@ >O = FJE= @A?E= EJACAH EB JDA EJA
               CAH EI EJJA@ EJ EI JHA=JA@ =I AH
               ) FJE= h IFA?EBOEC JD=J = BMEC d i o u x H X ?LAHIE IFA?EBEAH =FFEAI J =
               short int H unsigned short =HCKAJ JDA =HCKAJ ME D=LA >AA FHJA@
               =??H@EC J JDA EJACH= FHJEI =@ EJI L=KA ID= >A ?LAHJA@ J short H
               unsigned short >ABHA FHEJEC = FJE= h IFA?EBOEC JD=J = BMEC n ?LAHIE
               IFA?EBEAH =FFEAI J = FEJAH J = short =HCKAJ = FJE= l A IFA?EBOEC JD=J = B
               MEC d i o u x H X ?LAHIE ?D=H=?JAH =FFEAI J = long H unsigned long
               =HCKAJ = FJE= l IFA?EBOEC JD=J = BMEC n ?LAHIE IFA?EBEAH =FFEAI J =
               FEJAH J = long int =HCKAJ H = FJE= L IFA?EBOEC JD=J = BMEC e E f g
               H G ?LAHIE IFA?EBEAH =FFEAI J = long double =HCKAJ 1B = h l H L =FFA=HI
               MEJD =O JDAH ?LAHIE IFA?EBEAH JDA >AD=LEH EI K@ABEA@




                                                        !'!
.2416.                                                                                          .2416.  



              ) ?D=H=?JAH JD=J E@E?=JAI JDA JOFA B ?LAHIE J >A =FFEA@
       ) BEA@ ME@JD H FHA?EIE H >JD =O >A E@E?=JA@ >O = =IJAHEI * EIJA=@ B = @ECEJ IJHEC 1
       JDEI ?=IA = int arg IKFFEAI JDA BEA@ ME@JD H FHA?EIE 6DA =HCKAJI IFA?EBOEC BEA@ ME@JD
       H FHA?EIE H >JD ID= =FFA=H E JD=J H@AH >ABHA JDA =HCKAJ EB =O J >A ?LAHJA@ )
       AC=JELA BEA@ ME@JD =HCKAJ EI J=A =I = − B=C BMA@ >O = FIEJELA BEA@ ME@JD ) AC=JELA
       FHA?EIE EI J=A =I EB EJ MAHA EIIEC
       6DA B=C ?D=H=?JAHI =@ JDAEH A=ECI =HA
       −         6DA HAIKJ B JDA ?LAHIE EI ABJKIJEBEA@ MEJDE JDA BEA@
       +         6DA HAIKJ B = IECA@ ?LAHIE =M=OI >ACEI MEJD = IEC + H −
       >=     1B JDA BEHIJ ?D=H=?JAH B = IECA@ ?LAHIE EI J = IEC H = IECA@ ?LAHIE HAIKJI
                 E  ?D=H=?JAHI = >= EI FHABENA@ J JDA HAIKJ 6DEI EFEAI JD=J EB JDA >= =@ +
                 B=CI >JD =FFA=H JDA >= B=C EI ECHA@
       #         6DA HAIKJ EI J >A ?LAHJA@ J = =JAH=JA BH .H o ?LAHIE EJ E?HA=IAI JDA
                 FHA?EIE J BH?A JDA BEHIJ @ECEJ B JDA HAIKJ J >A = AH .H x H X ?LAHIE =
                 AH HAIKJ D=I 0x H 0X FHABENA@ J EJ .H e E f g =@ G ?LAHIEI JDA
                 HAIKJ =M=OI ?J=EI = @A?E= FEJ ALA EB  @ECEJI BM JDA FEJ H=O = @A?
                 E= FEJ =FFA=HI E JDA HAIKJ B JDAIA ?LAHIEI O EB = @ECEJ BMI EJ .H g =@
                 G ?LAHIEI JH=EEC AHI =HA not >A HALA@ BH JDA HAIKJ =I JDAO H=O =HA
                 .H JDAH ?LAHIEI JDA >AD=LEH EI K@ABEA@
       0         .H d i o u x X e E f g =@ G ?LAHIEI A=@EC AHI BMEC =O E@E?=
                 JE B IEC H >=IA =HA KIA@ J F=@ JDA BEA@ ME@JD  IF=?A F=@@EC EI FAHBHA@ 1B
                 JDA 0 =@ − B=CI >JD =FFA=H JDA 0 B=C ME >A ECHA@ .H d i o u x =@ X ?
                 LAHIEI EB = FHA?EIE EI IFA?EBEA@ JDA 0 B=C ME >A ECHA@ .H JDAH ?LAHIEI JDA
                 >AD=LEH EI K@ABEA@
       6DA ?LAHIE ?D=H=?JAHI =@ JDAEH A=ECI =HA
       douxX
                   6DA EJACAH arg EI ?LAHJA@ J IECA@ @A?E= d H i KIECA@ ?J= o KIECA@
                   @A?E= u H KIECA@ DAN=@A?E= J=JE x H X JDA AJJAHI abcdef =HA KIA@ BH
                   x ?LAHIE =@ JDA AJJAHI ABCDEF BH X ?LAHIE 6DA FHA?EIE IFA?EBEAI JDA E
                   EK K>AH B @ECEJI J =FFA=H EB JDA L=KA >AEC ?LAHJA@ ?= >A HAFHAIAJA@ E
                   BAMAH @ECEJI EJ EI ANF=@A@ MEJD A=@EC AHI 6DA @AB=KJ FHA?EIE EI  6DA HAIKJ B
                   ?LAHJEC = AH L=KA MEJD = FHA?EIE B AH EI  ?D=H=?JAHI
       f           6DA double =HCKAJ EI ?LAHJA@ J @A?E= J=JE E JDA IJOA  ddd.ddd MDAHA
                   JDA K>AH B @ECEJI =BJAH JDA @A?E= FEJ EI AGK= J JDA FHA?EIE IFA?EBE?=JE 1B JDA
                   FHA?EIE EI EIIEC EJ EI J=A =I $ EB JDA FHA?EIE EI ANFE?EJO 0  @A?E= FEJ
                   =FFA=HI
       eE         6DA double =HCKAJ EI ?LAHJA@ E JDA IJOA  d.ddde dd MDAHA JDAHA EI A @ECEJ
                   >ABHA JDA @A?E= FEJ =@ JDA K>AH B @ECEJI =BJAH EJ EI AGK= J JDA FHA?EIE MDA
                   JDA FHA?EIE EI EIIEC EJ EI J=A =I $ EB JDA FHA?EIE EI AH  @A?E= FEJ
                   =FFA=HI 6DA E BH=J ?@A FH@K?AI = K>AH MEJD E EIJA=@ B e EJH@K?EC JDA
                   ANFAJ 6DA ANFAJ =M=OI ?J=EI =J A=IJ JM @ECEJI
       gG         6DA double =HCKAJ EI FHEJA@ E IJOA f H e H E IJOA E E JDA ?=IA B = G ?LAH
                   IE IFA?EBEAH MEJD JDA FHA?EIE IFA?EBOEC JDA K>AH B IECEBE?=J @ECEJI 1B =
                   ANFE?EJ FHA?EIE EI AH EJ EI J=A =I  6DA IJOA KIA@ @AFA@I  JDA L=KA ?
                   LAHJA@ IJOA e EI KIA@ O EB JDA ANFAJ HAIKJEC BH JDA ?LAHIE EI AII JD= "
                   H CHA=JAH JD= H AGK= J JDA FHA?EIE 6H=EEC AHI =HA HALA@ BH JDA BH=?JE=
                   FHJE B JDA HAIKJ = @A?E= FEJ =FFA=HI O EB EJ EI BMA@ >O = @ECEJ
       c           6DA int =HCKAJ EI ?LAHJA@ J = unsigned char =@ JDA HAIKJEC ?D=H=?JAH EI
                   MHEJJA
       s           6DA =HCKAJ EI J=A J >A = IJHEC ?D=H=?JAH FEJAH =@ ?D=H=?JAHI BH JDA IJHEC
                   =HA FHEJA@ KJE = K ?D=H=?JAH \0 EI A?KJAHA@ H JDA K>AH B ?D=H=?JAHI E@E
                   ?=JA@ >O JDA FHA?EIE IFA?EBE?=JE EI HA=?DA@ 1B JDA FHA?EIE EI EIIEC EJ EI J=A J
                   >A EBEEJA I = ?D=H=?JAHI KF J JDA BEHIJ K ?D=H=?JAH =HA FHEJA@ ) AH L=KA BH
                   JDA =HCKAJ OEA@I K@ABEA@ HAIKJI
       P           6DA void* =HCKAJ EI FHEJA@ E = EFAAJ=JE@ABEA@ M=O BH 2= ' JDA
                   =@@HAII =I DAN=@A?E= K>AH
       n           6DA =HCKAJ ID= >A = FEJAH J = EJACAH EJ MDE?D EI written JDA K>AH B ?D=H
                   =?JAHI MHEJJA J JDA KJFKJ IJHA= I B=H >O JDEI ?= J fprintf  =HCKAJ EI



                                                     !'"
.2416.                                                                                         .2416.  



                 ?LAHJA@
       %         2HEJ = %  =HCKAJ EI ?LAHJA@
       1B = ?LAHIE IFA?EBE?=JE EI EL=E@ JDA >AD=LEH EI K@ABEA@
       1B =O =HCKAJ EI H FEJI J = KE H = =CCHAC=JA AN?AFJ BH = =HH=O B ?D=H=?JAH JOFA
       KIEC %s ?LAHIE H = FEJAH ?=IJ J >A = FEJAH J void KIEC %P ?LAHIE JDA >AD=LEH
       EI K@ABEA@
       1  ?=IA @AI = ANEIJAJ H I= BEA@ ME@JD ?=KIA JHK?=JE B = BEA@ EB JDA HAIKJ B = ?
       LAHIE EI ME@AH JD= JDA BEA@ ME@JD JDA BEA@ EI ANF=@A@ J ?J=E JDA ?LAHIE HAIKJ
SOURCE
     /sys/src/libstdio
SEE ALSO
      fopen  fscanf  print 
BUGS
       6DAHA EI  M=O J FHEJ = ME@A ?D=H=?JAH HKA KIA print  H bio 




                                                     !'#
.4)-                                                                                                    .4)- 




NAME
       BHEEJ BHIAJHA?JI BHEEJJE? BH?A=H BH?D=HBFJ BHFJB?D=H BHEIAHJ BH@AAJA BHIAA?J BHJE? BHIAA?J
       F=EJ BH@H=MIA BH@H=MIA BHCAJKIA BH=AI B JANJ
SYNOPSIS
     #include         <u.h>
     #include         <libc.h>
     #include         <draw.h>
     #include         <thread.h>
     #include         <mouse.h>
     #include         <frame.h>
       void      frinit(Frame *f, Rectangle r, Font *ft, Image *b, Image **cols)
       void      frsetrects(Frame *f, Rectangle r, Image *b)
       void      frinittick(Frame *f)
       void      frclear(Frame *f, int resize)
       ulong frcharofpt(Frame *f, Point pt)
       Point frptofchar(Frame *f, ulong p)
       void      frinsert(Frame *f, Rune *r0, Rune *r1, ulong p)
       int       frdelete(Frame *f, ulong p0, ulong p1)
       void      frselect(Frame *f, Mousectl *m)
       void      frtick(Frame *f, Point pt, int up)
       void      frselectpaint(Frame *f, Point p0, Point p1, Image *col)
       void      frdrawsel(Frame *f, Point pt0, ulong p0, ulong p1,
                     int highlighted)
       void      frdrawsel0(Frame *f, Point pt0, ulong p0, ulong p1,
                     Image *back, Image *text)
       enum{
            BACK,
            HIGH,
            BORD,
            TEXT,
            HTEXT,
            NCOL
       };
DESCRIPTION
      6DEI E>H=HO IKFFHJI frames B A@EJ=>A JANJ E = IECA BJ  H=IJAH @EIF=OI IK?D =I E sam
      =@ rio .H=AI =O D@ =O ?D=H=?JAH AN?AFJ 7  C EAI =HA B@A@ =@ J=>I =HA =J
      BENA@ EJAHL=I
       6DA KIAHLEIE>A @=J= IJHK?JKHA = Frame EI @ABEA@ E <frame.h>
               typedef struct Frame Frame;
               struct Frame
               {
                   Font      *font;                              /*   of chars in the frame */
                   Display   *display;                           /*   on which frame appears */
                   Image     *b;                                 /*   on which frame appears */
                   Image     *cols[NCOL];                        /*   text and background colors */
                   Rectangle r;                                  /*   in which text appears */
                   Rectangle entire;                             /*   of full frame */
                   Frbox     *box;
                   ulong     p0, p1;                             /* selection */
                   ushort    nbox, nalloc;
                   ushort    maxtab;                             /* max size of tab, in pixels */



                                                        !'$
.4)-                                                                                            .4)- 



                    ushort         nchars;                  /*   # runes in frame */
                    ushort         nlines;                  /*   # lines with text */
                    ushort         maxlines;                /*   total # lines in frame */
                    ushort         lastlinefull;            /*   last line fills frame */
                    ushort         modified;                /*   changed since frselect() */
                    Image          *tick;                   /*   typing tick */
                    Image          *tickback;               /*   saved image under tick */
                    int            ticked;                  /*   flag: is tick onscreen? */
             };
      Frbox EI = EJAH= JOFA =@ EI J KIA@ >O JDA EJAHB=?A P0 =@ p1 =O >A ?D=CA@ >O JDA
      =FFE?=JE FHLE@A@ JDA IAA?JE HKJEAI =HA ?=A@ =BJAHM=H@I J =EJ=E = ?IEIJAJ @EIF=O
      Maxtab @AJAHEAI JDA IEA B J=> IJFI Frinit IAJI EJ J & JEAI JDA ME@JD B = 0 AH ?D=H=?JAH
      E JDA BJ EJ =O >A ?D=CA@ >ABHA =O JANJ EI =@@A@ J JDA BH=A 6DA JDAH AAAJI B JDA
      IJHK?JKHA =HA =EJ=EA@ >O JDA E>H=HO =@ IDK@ J >A @EBEA@ @EHA?JO
      6DA JANJ MEJDE BH=AI EI J @EHA?JO =@@HAII=>A EIJA=@ BH=AI =HA @AIECA@ J MH =CIE@A
      =JDAH IJHK?JKHA JD=J D@I JDA JANJ 6DA JOFE?= =FFE?=JE EI J @EIF=O = IA?JE B = CAH
      @?KAJ IK?D =I = JANJ BEA H JAHE= IAIIE 7IK=O JDA FHCH= ME AAF EJI M ?FO B JDA
      JANJ E JDA ME@M FH>=>O =I = =HH=O B Runes =@ F=II ?FAJI B JDEI JANJ J JDA BH=A
      HKJEAI J @EIF=O JDA LEIE>A FHJE O JDA JANJ JD=J EI LEIE>A EI DA@ >O JDA Frame JDA =FFE
      ?=JE KIJ ?DA? maxlines nlines =@ lastlinefull J @AJAHEA BH AN=FA
      MDAJDAH AM JANJ AA@I J >A =FFA@A@ =J JDA A@ B JDA Frame =BJAH ?=EC frdelete GL
      6DAHA =HA  HKJEAI E JDA E>H=HO J =?=JA Frames EIJA=@ JDA EJAHB=?A =IIKAI JD=J
      Frames ME >A ?FAJI B =HCAH IJHK?JKHAI Frinit FHAF=HAI JDA Frame f I ?D=H=?JAHI
      @H=M E EJ ME =FFA=H E JDA IECA Font ft 1J JDA ?=I frsetrects =@ frinittick J EEJE=EA JDA
      CAAJHO BH JDA Frame 6DA Image b EI MDAHA JDA Frame EI J >A @H=M Rectangle r
      @ABEAI JDA EEJ B JDA FHJE B JDA Image JDA JANJ ME ??KFO 6DA Image FEJAH =O >A
      K =MEC JDA JDAH HKJEAI J >A ?=A@ J =EJ=E JDA =II?E=JA@ @=J= IJHK?JKHA E BH AN=
      FA = >I?KHA@ ME@M
      6DA =HH=O B Images ?I IAJI JDA ?HI E MDE?D JANJ =@ >H@AHI ME >A @H=M 6DA >=?
      CHK@ B JDA BH=A ME >A @H=M E cols[BACK] JDA >=?CHK@ B DECDECDJA@ JANJ E
      cols[HIGH] >H@AHI =@ I?H >=H E cols[BORD] HACK=H JANJ E cols[TEXT] =@ DECD
      ECDJA@ JANJ E cols[HTEXT]
      Frclear BHAAI JDA EJAH= IJHK?JKHAI =II?E=JA@ MEJD f FAHEJJEC =JDAH frinit H frsetrects  JDA
      Frame 1J @AI J ?A=H JDA =II?E=JA@ @EIF=O 1B f EI J >A @A=?=JA@ JDA =II?E=JA@ Font
      =@ Image KIJ >A BHAA@ IAF=H=JAO 6DA resize =HCKAJ IDK@ >A AH EB JDA BH=A EI
      J >A HA@H=M MEJD = @EBBAHAJ BJ JDAHMEIA JDA BH=A ME =EJ=E IA @=J= IJHK?JKHAI =II?E
      =JA@ MEJD JDA BJ
      6 HAIEA = Frame KIA frclear =@ frinit =@ JDA frinsert GL J HA?HA=JA JDA @EIF=O 1B =
      Frame EI >AEC LA@ >KJ J HAIEA@ JD=J EI EB JDA ID=FA B EJI ?J=EEC HA?J=CA EI
      K?D=CA@ EJ EI IKBBE?EAJ J KIA draw  J ?FO JDA ?J=EEC HA?J=CA BH JDA @ J JDA AM
      ?=JE =@ JDA ?= frsetrects J AIJ=>EID JDA AM CAAJHO 1J EI KA?AII=HO J ?= frinittick
      KAII JDA BJ IEA D=I ?D=CA@  HA@H=MEC EI A?AII=HO
      Frames D@ JANJ =I HKAI J =I >OJAI Frptofchar HAJKHI JDA ?=JE B JDA KFFAH ABJ ?HAH
      B JDA p’th HKA IJ=HJEC BH  E JDA Frame f 1B f D@I BAMAH JD= p HKAI frptofchar HAJKHI
      JDA ?=JE B JDA KFFAH HECDJ ?HAH B JDA =IJ ?D=H=?JAH E f Frcharofpt EI JDA ELAHIA EJ HAJKHI
      JDA E@AN B JDA ?IAIJ HKA MDIA E=CA I KFFAH ABJ ?HAH EI KF =@ J JDA ABJ B pt
      Frinsert EIAHJI EJ Frame f IJ=HJEC =J HKA E@AN p JDA HKAI >AJMAA r0 =@ r1 1B = 7 
      ?D=H=?JAH EI EIAHJA@ ?D=I ME AIKA 6=>I =@ AMEAI =HA D=@A@ >O JDA E>H=HO >KJ = JDAH
      ?D=H=?JAHI E?K@EC ?JH ?D=H=?JAHI =HA KIJ @EIF=OA@ .H AN=FA >=?IF=?AI =HA FHEJA@
      J AH=IA = ?D=H=?JAH KIA frdelete
      Frdelete @AAJAI BH JDA Frame JDA JANJ >AJMAA p0 =@ p1 p1 FEJI =J JDA BEHIJ HKA >AO@
      JDA @AAJE
      Frselect JH=?I JDA KIA J IAA?J = ?JECKKI IJHEC B JANJ E JDA Frame 9DA ?=A@ =
      KIA >KJJ EI JOFE?=O @M Frselect ME HAJKH MDA JDA >KJJ IJ=JA D=I ?D=CA@ IA >KJ
      JI =O IJE >A @M =@ ME IAJ f−>p0 =@ f−>p1 J JDA IAA?JA@ H=CA B JANJ



                                                    !'%
.4)-                                                                                          .4)- 



       2HCH=I JD=J MEID J ==CA JDA IAA?JE JDAIALAI D=LA IALAH= HKJEAI J DAF 6DAO
       ELLA JDA =EJA=?A B JDA JE?  JDA LAHJE?= EA E@E?=JEC = K IAA?JE >AJMAA ?D=H=?
       JAHI =@ JDA ?HA@ HACE HAFHAIAJEC = K IAA?JE Frtick @H=MI EB up EI AH H
       HALAI EB up EI AH JDA JE? =J JDA I?HAA FIEJE E@E?=JA@ >O pt Frdrawsel HAF=EJI = IA?JE
       B JDA BH=A @AEEJA@ >O ?D=H=?JAH FIEJEI p0 =@ p1 AEJDAH MEJD F=E >=?CHK@ H AJEHAO
       DECDECDJA@ =??H@EC J JDA B=C highlighted ==CEC JDA JE? =FFHFHE=JAO 6DA FEJ pt0 EI
       JDA CAAJHE?= ?=JE B p0  JDA I?HAA EA = B JDA IAA?JEDAFAH HKJEAI Point =HCK
       AJI EJ KIJ >A = L=KA CAAH=JA@ >O frptofchar Frdrawsel0 EI = MAHALA HKJEA J=EC =I
       =HCKAJI = >=?CHK@ ?H back =@ JANJ ?H text 1J =IIKAI JD=J JDA JE? EI >AEC D=@A@
       HALA@ >ABHAD=@ HAF=?A@ =BJAHM=H@I =I HAGKEHA@ >O EJI ?=AH Frselectpaint KIAI = IE@
       ?H col J F=EJ = HACE B JDA BH=A @ABEA@ >O JDA Points p0 =@ p1
SOURCE
     /sys/src/libframe
SEE ALSO
      graphics  draw  cachechars 




                                                   !'&
.4-:2                                                                                            .4-:2 




NAME
       BHANF @ANF @B   IFEJ EJ =JEII= =@ ANFAJ
SYNOPSIS
     #include <u.h>
     #include <libc.h>
       double frexp(double value, int *eptr)
       double ldexp(double value, int exp)
       double modf(double value, double *iptr)
DESCRIPTION
      Frexp HAJKHI JDA =JEII= B value =@ IJHAI JDA ANFAJ E@EHA?JO JDHKCD eptr I JD=J value
       frexpvalue (*eptr)
       Ldexp HAJKHI JDA GK=JEJO   value   exp
                                                  



       Modf HAJKHI JDA IECA@ BH=?JE= F=HJ B value =@ IJHAI JDA EJACAH F=HJ E@EHA?JO JDHKCD iptr
SOURCE
     /sys/src/libc/port/frexp.c
SEE ALSO
      intro 
DIAGNOSTICS
     Ldexp HAJKHI  BH K@AHBM =@ JDA =FFHFHE=JAO IECA@ EBEEJO BH LAHBM




                                                      !''
.5+).                                                                                          .5+).  




NAME
       BI?=B I?=B II?=B LBI?=B   I?= BH=JJA@ EFKJ
SYNOPSIS
     #include <u.h>
     #include <stdio.h>
       int fscanf(FILE *f, char *format, ...)
       int scanf(char *format, ... )
       int sscanf(char *s, char *format, ...)
       int vfscanf(FILE *stream, char *format, char *args)
DESCRIPTION
      Fscanf HA=@I BH JDA =A@ EFKJ IJHA= f IAA fopen  K@AH ?JH B JDA IJHEC FEJA@ J
      >O format JD=J IFA?EBEAI JDA =@EIIE>A EFKJ IAGKA?AI =@ DM JDAO =HA J >A ?LAHJA@ BH
      =IIECAJ KIEC IK>IAGKAJ =HCKAJI =I FEJAHI J JDA >A?JI J HA?AELA JDA ?LAHJA@ EFKJ
      1B JDAHA =HA EIKBBE?EAJ =HCKAJI BH JDA BH=J JDA >AD=LEH EI K@ABEA@ 1B JDA BH=J EI
      AND=KIJA@ MDEA =HCKAJI HA=E JDA AN?AII =HCKAJI =HA AL=K=JA@ =I =M=OI >KJ =HA JDAH
      MEIA ECHA@
       Scanf =@ sscanf =HA JDA I=A >KJ JDAO HA=@ BH stdin =@ JDA ?D=H=?JAH IJHEC s HAIFA?JELAO
       Vfscanf EI EA scanf AN?AFJ JDA args =HCKAJ EI = FEJAH J = =HCKAJ E = =HCKAJ EIJ B
       JDA ?=EC BK?JE =@ JDA ABBA?J EI =I EB JDA ?=EC BK?JE I =HCKAJ EIJ BH JD=J FEJ  EI
       F=IIA@ J JDA I?=B HKJEAI
       6DA BH=J EI ?FIA@ B AH H HA @EHA?JELAI A H HA MDEJAIF=?A ?D=H=?JAHI = H@E
       =HO ?D=H=?JAH J % H = ?LAHIE IFA?EBE?=JE -=?D ?LAHIE IFA?EBE?=JE EI EJH@K?A@
       >O JDA ?D=H=?JAH %. )BJAH JDA % JDA BMEC =FFA=H E IAGKA?A
              ) FJE= =IIECAJIKFFHAIIEC ?D=H=?JAH *
              ) FJE= @A?E= EJACAH JD=J IFA?EBEAI JDA =NEK BEA@ ME@JD
              ) FJE= h l A H L E@E?=JEC JDA IEA B JDA HA?AELEC >A?J 6DA ?LAHIE IFA?E
              BEAHI d i =@ n ID= >A FHA?A@A@ >O h EB JDA ?HHAIF@EC =HCKAJ EI = FEJAH J
              short H=JDAH JD= = FEJAH J int H >O l EB EJ EI = FEJAH J long 5EE=HO JDA ?
              LAHIE IFA?EBEAHI o u =@ x ID= >A FHA?A@A@ >O h EB JDA ?HHAIF@EC =HCKAJ EI =
              FEJAH J unsigned short H=JDAH JD= = FEJAH J unsigned H >O l EB EJ EI = FEJAH
              J unsigned long .E=O JDA ?LAHIE IFA?EBEAHI e f =@ g ID= >A FHA?A@A@ >O l
              EB JDA ?HHAIF@EC =HCKAJ EI = FEJAH J double H=JDAH JD= = FEJAH J float H
              >O L EB EJ EI = FEJAH J long double 1B = h l H L =FFA=HI MEJD =O JDAH ?LAHIE
              IFA?EBEAH JDA >AD=LEH EI K@ABEA@
              ) ?D=H=?JAH JD=J IFA?EBEAI JDA JOFA B ?LAHIE J >A =FFEA@ 6DA L=E@ ?LAHIE IFA?E
              BEAHI =HA @AI?HE>A@ >AM
       Fscanf ANA?KJAI A=?D @EHA?JELA B JDA BH=J E JKH 1B = @EHA?JELA B=EI =I @AJ=EA@ >AM fscanf
       HAJKHI .=EKHAI =HA @AI?HE>A@ =I EFKJ B=EKHAI @KA J JDA K=L=E=>EEJO B EFKJ H =J?DEC
       B=EKHAI @KA J E=FFHFHE=JA EFKJ
       ) @EHA?JELA ?FIA@ B MDEJA IF=?A EI ANA?KJA@ >O HA=@EC EFKJ KF J JDA BEHIJ MDEJAIF=?A
       ?D=H=?JAH MDE?D HA=EI KHA=@ H KJE  HA ?D=H=?JAHI ?= >A HA=@
       ) @EHA?JELA JD=J EI = H@E=HO ?D=H=?JAH EI ANA?KJA@ >O HA=@EC JDA ANJ ?D=H=?JAH BH JDA IJHA=
       1B EB @EBBAHI BH JDA A ?FHEIEC JDA @EHA?JELA JDA @EHA?JELA B=EI =@ JDA @EBBAHEC =@ IK>IA
       GKAJ ?D=H=?JAHI HA=E KHA=@
       ) @EHA?JELA JD=J EI = ?LAHIE IFA?EBE?=JE @ABEAI = IAJ B =J?DEC EFKJ IAGKA?AI =I
       @AI?HE>A@ >AM BH A=?D IFA?EBEAH ) ?LAHIE IFA?EBE?=JE EI ANA?KJA@ E JDA BMEC IJAFI
       1FKJ MDEJAIF=?A ?D=H=?JAHI =I IFA?EBEA@ >O isspace IAA ctype  =HA IEFFA@ KAII JDA IFA?EBE
       ?=JE E?K@AI = [ c H n IFA?EBEAH
       ) EFKJ EJA EI HA=@ BH JDA IJHA= KAII JDA IFA?EBE?=JE E?K@AI = n IFA?EBEAH ) EFKJ
       EJA EI @ABEA@ =I JDA CAIJ IAGKA?A B EFKJ ?D=H=?JAHI KF J =O IFA?EBEA@ =NEK BEA@
       ME@JD MDE?D EI = EEJE= IK>IAGKA?A B = =J?DEC IAGKA?A 6DA BEHIJ ?D=H=?JAH EB =O =BJAH JDA



                                                    "
.5+).                                                                                           .5+).  



      EFKJ EJA HA=EI KHA=@ 1B JDA ACJD B JDA EFKJ EJA EI AH JDA ANA?KJE B JDA @EHA?JELA
      B=EI JDEI ?@EJE EI = =J?DEC B=EKHA KAII = AHHH FHALAJA@ EFKJ BH JDA IJHA= E
      MDE?D ?=IA EJ EI = EFKJ B=EKHA
      -N?AFJ E JDA ?=IA B = % IFA?EBEAH JDA EFKJ EJA H E JDA ?=IA B = %n @EHA?JELA JDA ?KJ B
      EFKJ ?D=H=?JAHI EI ?LAHJA@ J = JOFA =FFHFHE=JA J JDA ?LAHIE IFA?EBEAH 1B JDA EFKJ EJA EI
      J = =J?DEC IAGKA?A JDA ANA?KJE B JDA @EHA?JELA B=EI JDEI ?@EJE EI = =J?DEC B=EKHA
      7AII =IIECAJ IKFFHAIIE M=I E@E?=JA@ >O = * JDA HAIKJ B JDA ?LAHIE EI F=?A@ E JDA
      >A?J FEJA@ J >O JDA BEHIJ =HCKAJ BMEC JDA format =HCKAJ JD=J D=I J =HA=@O
      HA?AELA@ = ?LAHIE HAIKJ 1B JDEI >A?J @AI J D=LA = =FFHFHE=JA JOFA H EB JDA HAIKJ B JDA
      ?LAHIE ?=J >A HAFHAIAJA@ E JDA IF=?A FHLE@A@ JDA >AD=LEH EI K@ABEA@
      6DA BMEC ?LAHIE IFA?EBEAHI =HA L=E@
      d       =J?DAI = FJE=O IECA@ @A?E= EJACAH MDIA BH=J EI JDA I=A =I ANFA?JA@ BH JDA
              IK>A?J IAGKA?A B JDA strtol IAA atof  BK?JE MEJD  BH JDA base =HCKAJ 6DA
              ?HHAIF@EC =HCKAJ ID= >A = FEJAH J int
      i       =J?DAI = FJE=O IECA@ @A?E= EJACAH MDIA BH=J EI JDA I=A =I ANFA?JA@ BH JDA
              IK>A?J IAGKA?A B JDA strtol BK?JE MEJD  BH JDA base =HCKAJ 6DA ?HHAIF@EC
              =HCKAJ ID= >A = FEJAH J int
      o       =J?DAI = FJE=O IECA@ ?J= EJACAH MDIA BH=J EI JDA I=A =I ANFA?JA@ BH JDA
              IK>A?J IAGKA?A B JDA strtoul IAA atof  BK?JE MEJD & BH JDA base =HCKAJ 6DA
              ?HHAIF@EC =HCKAJ ID= >A = FEJAH J unsigned int
      u       =J?DAI = FJE=O IECA@ @A?E= EJACAH MDIA BH=J EI JDA I=A =I ANFA?JA@ BH JDA
              IK>A?J IAGKA?A B JDA strtoul BK?JE MEJD  BH JDA base =HCKAJ 6DA ?HHAIF@EC
              =HCKAJ ID= >A = FEJAH J unsigned int
      x       =J?DAI = FJE=O IECA@ DAN=@A?E= EJACAH MDIA BH=J EI JDA I=A =I ANFA?JA@ BH
              JDA IK>A?J IAGKA?A B JDA strtoul BK?JE MEJD $ BH JDA base =HCKAJ 6DA ?HHA
              IF@EC =HCKAJ ID= >A = FEJAH J unsigned int
      efg
              =J?DAI = FJE=O IECA@ B=JECFEJ K>AH MDIA BH=J EI JDA I=A =I ANFA?JA@
              BH JDA IK>A?J IJHEC B JDA strtod IAA atof  BK?JE 6DA ?HHAIF@EC =HCKAJ ID=
              >A = FEJAH J float
      s       =J?DAI = IAGKA?A B MDEJAIF=?A ?D=H=?JAHI 6DA ?HHAIF@EC =HCKAJ ID= >A =
              FEJAH J JDA EEJE= ?D=H=?JAH B = =HH=O =HCA AKCD J =??AFJ JDA IAGKA?A =@ = JAHE
              =JEC 7  ?D=H=?JAH MDE?D ME >A =@@A@ =KJ=JE?=O
      [       =J?DAI = AFJO IAGKA?A B ?D=H=?JAHI BH = IAJ B ANFA?JA@ ?D=H=?JAHI JDA scanset
              6DA ?HHAIF@EC =HCKAJ ID= >A = FEJAH J JDA EEJE= ?D=H=?JAH B = =HH=O =HCA
              AKCD J =??AFJ JDA IAGKA?A =@ = JAHE=JEC 7 ?D=H=?JAH MDE?D ME >A =@@A@ =KJ
              =JE?=O 6DA ?LAHIE IFA?EBEAH E?K@AI = IK>IAGKAJ ?D=H=?JAHI E JDA format IJHEC
              KF J =@ E?K@EC JDA =J?DEC HECDJ >H=?A ] 6DA ?D=H=?JAHI >AJMAA JDA >H=?AJI JDA
              scanlist ?FHEIA JDA I?=IAJ KAII JDA ?D=H=?JAH =BJAH JDA ABJ >H=?AJ EI = ?EH?KBAN ^
              E MDE?D ?=IA JDA I?=IAJ ?J=EI = ?D=H=?JAHI JD=J @ J =FFA=H E JDA I?=EIJ >AJMAA
              JDA ?EH?KBAN =@ JDA HECDJ >H=?AJ )I = IFA?E= ?=IA EB JDA ?LAHIE IFA?EBEAH >ACEI
              MEJD [] H [^] JDA HECDJ >H=?AJ ?D=H=?JAH EI E JDA I?=EIJ =@ JDA ANJ HECDJ >H=?AJ ?D=H
              =?JAH EI JDA =J?DEC HECDJ >H=?AJ JD=J A@I JDA IFA?EBE?=JE 1B = − ?D=H=?JAH EI E JDA
              I?=EIJ =@ EI J JDA BEHIJ H JDA IA?@ MDAHA JDA BEHIJ ?D=H=?JAH EI = ^ H JDA =IJ ?D=H
              =?JAH JDA >AD=LEH EI EFAAJ=JE@ABEA@ E 2= ' JDA I?=EIJ E?K@AI = ?D=H=?JAHI
              E JDA )5+11 IE? H=CA >AJMAA JDA JM ?D=H=?JAHI  AEJDAH IE@A B JDA −
      c       =J?DAI = IAGKA?A B ?D=H=?JAHI B JDA K>AH IFA?EBEA@ >O JDA BEA@ ME@JD  EB  BEA@
              ME@JD EI FHAIAJ E JDA @EHA?JELA 6DA ?HHAIF@EC =HCKAJ ID= >A = FEJAH J JDA EE
              JE= ?D=H=?JAH B = =HH=O =HCA AKCD J =??AFJ JDA IAGKA?A  7 ?D=H=?JAH EI =@@A@
      P       =J?DAI = EFAAJ=JE@ABEA@ IAJ B IAGKA?AI MDE?D IDK@ >A JDA I=A =I JDA IAJ
              B IAGKA?AI JD=J =O >A FH@K?A@ >O JDA %P ?LAHIE B JDA fprintf  BK?JE E 2=
              ' = DAN=@A?E= K>AH 6DA ?HHAIF@EC =HCKAJ ID= >A = FEJAH J = FEJAH J
              void 6DA EJAHFHAJ=JE B JDA EFKJ EJA EI EFAAJ=JE @ABEA@ DMALAH BH =O
              EFKJ EJA JDAH JD= = L=KA ?LAHJA@ A=HEAH @KHEC JDA I=A FHCH= ANA?KJE JDA
              >AD=LEH B JDA %P ?LAHIE EI K@ABEA@


                                                     "
.5+).                                                                                        .5+).  



       n      EFKJ EI ?IKA@ 6DA ?HHAIF@EC =HCKAJ ID= >A = FEJAH J EJACAH EJ MDE?D
             EI MHEJJA JDA K>AH B ?D=H=?JAHI HA=@ BH JDA EFKJ IJHA= I B=H >O JDEI ?= J fscanf
             -NA?KJE B = %n @EHA?JELA @AI J E?HAAJ JDA =IIECAJ ?KJ HAJKHA@ =J JDA ?
             FAJE B fscanf
       %     =J?DAI = IECA %  ?LAHIE H =IIECAJ ??KHI 6DA ?FAJA ?LAHIE IFA?EBE?=
             JE ID= >A %%
       1B = ?LAHIE IFA?EBE?=JE EI EL=E@ JDA >AD=LEH EI K@ABEA@
       6DA ?LAHIE IFA?EBEAHI E G =@ X =HA =I L=E@ =@ >AD=LA JDA I=A =I HAIFA?JELAO e g
       =@ x
       1B A@BBEA EI A?KJAHA@ @KHEC EFKJ ?LAHIE EI JAHE=JA@ 1B A@BBEA ??KHI >ABHA
       =O ?D=H=?JAHI =J?DEC JDA ?KHHAJ @EHA?JELA D=LA >AA HA=@ JDAH JD= A=@EC MDEJA IF=?A
       MDAHA FAHEJJA@ ANA?KJE B JDA ?KHHAJ @EHA?JELA JAHE=JAI MEJD = EFKJ B=EKHA JDAHMEIA
       KAII ANA?KJE B JDA ?KHHAJ @EHA?JELA EI JAHE=JA@ MEJD = =J?DEC B=EKHA ANA?KJE B JDA B
       MEC @EHA?JELA EB =O EI JAHE=JA@ MEJD = EFKJ B=EKHA
       1B ?LAHIE JAHE=JAI  = ?BE?JEC EFKJ ?D=H=?JAH JDA BBA@EC EFKJ ?D=H=?JAH EI ABJ
       KHA=@ E JDA EFKJ IJHA= 6H=EEC MDEJA IF=?A E?K@EC AMEA ?D=H=?JAHI EI ABJ KHA=@
       KAII =J?DA@ >O = @EHA?JELA 6DA IK??AII B EJAH= =J?DAI =@ IKFFHAIIA@ =IIECAJI EI J
       @EHA?JO @AJAHE=>A JDAH JD= LE= JDA %n @EHA?JELA
       6DA HAJKH L=KA BH fscanf EI JDA K>AH B EFKJ EJAI =IIECA@ MDE?D ?= >A BAMAH JD= FH
       LE@A@ BH H ALA AH E JDA ALAJ B = A=HO =J?DEC B=EKHA 0MALAH EB = EFKJ B=EKHA
       ??KHI >ABHA =O ?LAHIE EOF EI HAJKHA@
SOURCE
     /sys/src/libstdio
SEE ALSO
      fopen  fgetc 
BUGS
       ,AI J M =>KJ 76.




                                                     "
.8-451                                                                                      .8-451  




NAME
       BLAHIE   EEJE=EA '2 ?A?JE =@ ACJE=JA LAHIE
SYNOPSIS
     #include <u.h>
     #include <libc.h>
       int        fversion(int fd, int bufsize, char *version, int nversion)
DESCRIPTION
      Fversion EI KIA@ J EEJE=EA JDA '2 ?A?JE HAFHAIAJA@ >O fd =@ J ACJE=JA JDA LAHIE B
      JDA FHJ? J >A KIA@
       6DA bufsize @AJAHEAI JDA IEA B JDA 1 >KBBAH KIA@ J IJ=CA '2 HAGKAIJI J JDA IAHLAH IK>A?J
       J JDA ?IJH=EJI B JDA IAHLAH EJIAB 6DA version EI = JANJ IJHEC JD=J HAFHAIAJI JDA DECDAIJ LAH
       IE ALA JDA FHJ? ME IKFFHJ 6DA version ME >A LAHMHEJJA MEJD JDA ACJE=JA@ FIIE>O
       MAH LAHIE B JDA FHJ? 6DA HAJKH L=KA B fversion EI JDA ACJD B JDA HAJKHA@ LAHIE
       IJHEC JDA L=KA B nversion EI JDAHABHA J JDA ACJD B JDA LAHIE IJHEC FHAIAJA@ J JDA IOI
       JA ?= >KJ JDA JJ= ACJD B JDA >KBBAH J =??AFJ JDA BE= HAIKJ E JDA =AH B = HA=@ IOIJA
       ?=
       ,AB=KJ L=KAI B AH BH bufsize =@ JDA AFJO IJHEC BH version ME ACJE=JA IAIE>A @AB=KJI
       BH JDA ?A?JE 1B version EI JDA AFJO IJHEC nversion KIJ IJE >A =HCA AKCD J HA?AELA
       JDA HAJKHA@ LAHIE IJHEC
       6DA EJAHFHAJ=JE B JDA LAHIE IJHECI EI @ABEA@ E version#
       1J EI H=HA J KIA fversion @EHA?JO KIK=O JDA @AB=KJ ACJE=JE FAHBHA@ >O JDA AHA @KHEC
       mount IAA bind  H ALA HA ?O amount IAA auth  EI IKBBE?EAJ
SOURCE
     /sys/src/libc/9syscall
SEE ALSO
      intro# version# fauth 
DIAGNOSTICS
     5AJI errstr




                                                    "!
/-6+)-42+                                                                            /-6+)-42+ 




NAME
       CAJ?=AHF?   BAJ?D HAJKH 2+ B ?KHHAJ BK?JE
SYNOPSIS
     #include <u.h>
     #include <libc.h>
       uintptr getcallerpc(void *firstarg)
DESCRIPTION
      Getcallerpc EI = FHJ=>A M=O J @EI?LAH JDA 2+ J MDE?D JDA ?KHHAJ BK?JE ME HAJKH Firstarg
      IDK@ >A = FEJAH J JDA BEHIJ =HCKAJ J JDA BK?JE E GKAIJE
EXAMPLE
              void
              printpc(int arg)
              {
                   print("Called from %p\n", getcallerpc(&arg));
              }

              void
              main(int argc, char *argv[])
              {
                   printpc(0);
                   printpc(0);
                   printpc(0);
              }
SOURCE
     /sys/src/libc/$objtype/getcallerpc.[cs]
BUGS
       6DA firstarg F=H=AJAH IDK@ J >A A?AII=HO




                                                    ""
/-6-8                                                                                    /-6-8 




NAME
       CAJAL FKJAL   =??AII ALEHAJ L=HE=>AI
SYNOPSIS
     #include <u.h>
     #include <libc.h>
       char* getenv(char *name)
       int   putenv(char *name, char *val)
DESCRIPTION
      Getenv HA=@I JDA ?JAJI B /env/name IAA env! EJ AHO =?=JA@ MEJD malloc  
      JAHE=JAI EJ =@ HAJKHI = FEJAH J JD=J =HA= 1B  BEA ANEIJI  EI HAJKHA@
       Putenv ?HA=JAI JDA BEA /env/name =@ MHEJAI JDA IJHEC val J EJ 6DA JAHE=JEC 0 EI J MHEJ
       JA 1B JDA BEA L=KA ?=J >A MHEJJA  EI HAJKHA@
SOURCE
     /sys/src/libc/9sys
SEE ALSO
      env!
DIAGNOSTICS
     5AJI errstr




                                                 "#
/-6.+4                                                                                          /-6.+4 




NAME
       CAJB?H IAJB?H CAJBIH IAJBIH   ?JH B=JEC FEJ
SYNOPSIS
     #include <u.h>
     #include <libc.h>
       ulong getfcr(void)
       void setfcr(ulong fcr)
       ulong getfsr(void)
       void setfsr(ulong fsr)
DESCRIPTION
      6DAIA HKJEAI FHLE@A = B=EHO FHJ=>A EJAHB=?A J ?JH JDA HK@EC =@ AN?AFJE ?D=H=?JAH
      EIJE?I B 1--- %#" B=JEC FEJ KEJI 1 ABBA?J JDAO @ABEA = F=EH B FIAK@HACEIJAHI JDA B=JEC
      FEJ ?JH HACEIJAH fcr MDE?D =BBA?JI HK@EC FHA?EIE =@ AN?AFJEI =@ JDA B=JEC
      FEJ IJ=JKI HACEIJAH fsr MDE?D D@I JDA =??HKA@ AN?AFJE >EJI -=?D HACEIJAH D=I = get HKJEA
      J HAJHEALA EJI L=KA = set HKJEA J @EBO EJ =@ =?HI JD=J E@AJEBO EJI ?JAJI
       6DA fcr ?J=EI >EJI JD=J MDA IAJ D=J ANA?KJE KF AN?AFJEI FPINEX A=>A EAN=?J
       AN?AFJEI FPOVFL A=>A LAHBM AN?AFJEI FPUNFL A=>A K@AHBM AN?AFJEI
       FPZDIV A=>A AH @ELE@A AN?AFJEI =@ FPINVAL A=>A EL=E@ FAH=JE AN?AFJEI
       4K@EC EI ?JHA@ >O EIJ=EC E fcr K@AH =I FPRMASK A B JDA L=KAI FPRNR
       HK@ J A=HAIJ FPRZ HK@ JM=H@I AH FPRPINF HK@ JM=H@I FIEJELA EBEEJO =@
       FPRNINF HK@ JM=H@I AC=JELA EBEEJO 2HA?EIE EI ?JHA@ >O EIJ=EC E fcr K@AH
       =I FPPMASK A B JDA L=KAI FPPEXT ANJA@A@ FHA?EIE FPPSGL IECA FHA?EIE =@
       FPPDBL @K>A FHA?EIE
       6DA fsr D@I JDA =??HKA@ AN?AFJE >EJI FPAINEX FPAOVFL FPAUNFL FPAZDIV =@
       FPAINVAL ?HHAIF@EC J JDA fsr >EJI MEJDKJ JDA A E JDA =A
       J = =?DEAI IKFFHJ = @AI 1B JDA ?HHAIF@EC =I EI AH JDA =?DEA @AI J IKF
       FHJ JDA HK@EC H FHA?EIE @AI  IA =?DEAI EJ EI J FIIE>A J ?A=H IAA?JELA
       =??HKA@ AN?AFJE >EJI = setfsr ?A=HI JDA = 6DA AN?AFJE >EJI @ABEA@ DAHA MH  = =H?DE
       JA?JKHAI 9DAHA FIIE>A JDA EEJE= IJ=JA EI AGKEL=AJ J
               setfcr(FPPDBL|FPRNR|FPINVAL|FPZDIV|FPOVFL);
       0MALAH JDEI =O L=HO >AJMAA =H?DEJA?JKHAI JDA @AB=KJ EI J FHLE@A MD=J JDA D=H@M=HA @AI
       IJ ABBE?EAJO 7IA JDAIA HKJEAI EB OK AA@ CK=H=JAA@ >AD=LEH )I CH=@K= K@AHBM EI
       J =L=E=>A  IA =?DEAI
EXAMPLE
     6 A=>A LAHBM JH=FI =@ =A IKHA HACEIJAHI =HA HK@A@ J @K>A FHA?EIE BH AN=FA 
     JDA +$&  MDAHA JDA EJAH= HACEIJAHI =HA & >EJI C
               setfcr((getfcr() & ~FPPMASK) | FPPDBL | FPOVFL);
SOURCE
     /sys/src/libc/$objtype/getfcr.s




                                                       "$
/-6.1-,5                                                                                   /-6.1-,5  




NAME
       CAJBEA@I CAJJAI JAEA   >HA= = IJHEC EJ BEA@I
SYNOPSIS
     #include <u.h>
     #include <libc.h>
       int      getfields(char *str, char **args, int maxargs, int multiflag,
                    char *delims)
       int      gettokens(char *str, char **args, int maxargs, char *delims)
       int      tokenize(char *str, char **args, int maxargs)
DESCRIPTION
      Getfields F=?AI EJ JDA =HH=O args FEJAHI J JDA BEHIJ maxargs BEA@I B JDA K JAHE=JA@ 76.
      IJHEC str ,AEEJAHI >AJMAA JDAIA BEA@I =HA IAJ J K
       .EA@I =HA IK>IJHECI B str MDIA @ABEEJE @AFA@I  JDA L=KA B multiflag. 1B multiflag EI AH
       =@=?AJ BEA@I =HA IAF=H=JA@ >O AN=?JO A @AEEJAH .H AN=FA

                getfields("#alice#bob##charles###", arg, 3, 0, "#");

       OEA@I JDHAA IK>IJHECI KIJHEC  alice =@ bob##charles### 1B JDA multiflag =HCKAJ
       EI J AH = BEA@ EI = AFJO IJHEC B @AEEJAHI .H AN=FA

                getfields("#alice#bob##charles###", arg, 3, 1, "#");

       OEA@I JDA JDHAA IK>IJHECI alice bob =@ charles###
       /AJBEA@I HAJKHI JDA K>AH B BEA@I FEJA@ J
       Gettokens EI JDA I=A =I getfields MEJD multiflag AH AN?AFJ JD=J BEA@I =O >A GKJA@ KIEC
       IECA GKJAI E JDA =AH B rc )O IK?D GKJAI HA=E E JDA HAIKJEC args 5AA quote 
       BH HA=JA@ GKJAD=@EC IBJM=HA
       Tokenize EI IEE=H J gettokens MEJD delims IAJ J "\t\r\n " AN?AFJ JD=J GKJAI =HA EJAHFHAJA@
       >KJ @ J =FFA=H E JDA HAIKJEC args
SOURCE
     /sys/src/libc/port/tokenize.c
SEE ALSO
      strtok E strcat  quote 




                                                    "%
/-621,                                                                                     /-621, 




NAME
       CAJFE@ CAJFFE@   CAJ FH?AII E@I
SYNOPSIS
     #include <u.h>
     #include <libc.h>
       int getpid(void)
       int getppid(void)
DESCRIPTION
      Getpid HA=@I /dev/pid IAA cons! =@ ?LAHJI EJ J CAJ JDA FH?AII E@ B JDA ?KHHAJ FH?AII
      = K>AH CK=H=JAA@ J >A KEGKA =C = HKEC FH?AIIAI  JDA =?DEA ANA?KJEC getpid
       Getppid HA=@I /dev/ppid IAA cons! =@ ?LAHJI EJ J CAJ JDA E@ B JDA F=HAJ B JDA ?KHHAJ
       FH?AII
SOURCE
     /sys/src/libc/9sys
SEE ALSO
      intro  exec  cons! proc!
DIAGNOSTICS
     4AJKHI  =@ IAJI errstr EB KIK??AIIBK




                                                  "&
/-675-4                                                                                 /-675-4 




NAME
       CAJKIAH IOI=A   CAJ KIAH H IOIJA =A
SYNOPSIS
     #include <u.h>
     #include <libc.h>
       char*         getuser(void)
       char*         sysname(void)
DESCRIPTION
      Getuser HAJKHI = FEJAH J IJ=JE? @=J= MDE?D ?J=EI JDA KJAHE=JA@ =A B JDA KIAH MD
      MI JDA ?KHHAJ FH?AII Getuser HA=@I /dev/user J BE@ JDA =A
       Sysname FHLE@AI JDA I=A IAHLE?A BH JDA BEA #c/sysname MDE?D ?J=EI JDA =A B JDA
       =?DEA 7EA getuser sysname ?=?DAI JDA IJHEC HA=@EC JDA BEA O ?A
SOURCE
     /sys/src/libc/port/getuser.c
SEE ALSO
      intro  cons!