From b21aa04ca9b13848c3f6940e360c35154e0abb38 Mon Sep 17 00:00:00 2001 From: Devin Reade Date: Sat, 8 Sep 2012 09:38:18 -0600 Subject: [PATCH] Added original word document formats of v2.0.4 manuals. --- refs.aug96/gnokernelref-95.doc | 1421 ++++++++++++++ refs.aug96/gnomev20-95.doc | 464 +++++ refs.aug96/gnoshell-95.doc | 2326 +++++++++++++++++++++++ refs.aug96/section1234-95.doc | 3270 ++++++++++++++++++++++++++++++++ refs.html | 18 +- 5 files changed, 7495 insertions(+), 4 deletions(-) create mode 100644 refs.aug96/gnokernelref-95.doc create mode 100644 refs.aug96/gnomev20-95.doc create mode 100644 refs.aug96/gnoshell-95.doc create mode 100644 refs.aug96/section1234-95.doc diff --git a/refs.aug96/gnokernelref-95.doc b/refs.aug96/gnokernelref-95.doc new file mode 100644 index 0000000..f2826a0 --- /dev/null +++ b/refs.aug96/gnokernelref-95.doc @@ -0,0 +1,1421 @@ +{\rtf1\ansi\ansicpg1252\uc1 \deff0\deflang1033\deflangfe1033{\fonttbl{\f0\froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f1\fswiss\fcharset0\fprq2{\*\panose 020b0604020202020204}Arial;}{\f2\fmodern\fcharset0\fprq1{\*\panose 02070309020205020404}Courier New;}{\f3\froman\fcharset2\fprq2{\*\panose 05050102010706020507}Symbol;}{\f4\froman\fcharset0\fprq2{\*\panose 00000000000000000000}Times;}{\f5\fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}Helvetica{\*\falt Arial};}{\f6\fmodern\fcharset0\fprq1{\*\panose 00000000000000000000}Courier;}{\f7\fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}Geneva{\*\falt Arial};}{\f8\froman\fcharset0\fprq2{\*\panose 00000000000000000000}Tms Rmn;}{\f9\fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}Helv;}{\f10\froman\fcharset0\fprq2{\*\panose 00000000000000000000}MS Serif;}{\f11\fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}MS Sans Serif;}{\f12\froman\fcharset0\fprq2{\*\panose 00000000000000000000}New York{\*\falt Times New Roman};}{\f13\fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}System;}{\f14\fnil\fcharset2\fprq2{\*\panose 05000000000000000000}Wingdings;}{\f15\fswiss\fcharset0\fprq2{\*\panose 020b0604030504040204}Tahoma;}{\f16\froman\fcharset0\fprq2{\*\panose 00000000000000000000}Bookman;}{\f17\fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}TektoMM_240 RG 564 NO;}{\f18\fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}TektoMM;}{\f19\froman\fcharset0\fprq2{\*\panose 00000000000000000000}ACaslon Bold;}{\f20\froman\fcharset0\fprq2{\*\panose 00000000000000000000}ACaslon Regular;}{\f21\froman\fcharset0\fprq2{\*\panose 00000000000000000000}Bodoni BoldCondensed;}{\f22\fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}BrushScript;}{\f23\fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}GillSans;}{\f24\fmodern\fcharset0\fprq1{\*\panose 00000000000000000000}LetterGothic;}{\f25\fswiss\fcharset0\fprq2{\*\panose 020b0600000000000000}LotusLineDraw;}{\f26\fnil\fcharset2\fprq2{\*\panose 00000000000000000000}LotusWPSet;}{\f27\fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}NewsGothic;}{\f28\froman\fcharset0\fprq2{\*\panose 00000000000000000000}Perpetua;}{\f29\fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}Anna;}{\f30\fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}Poppl-Laudatio Regular;}{\f31\fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}Boulevard;}{\f32\froman\fcharset0\fprq2{\*\panose 00000000000000000000}Boton Regular;}{\f33\froman\fcharset0\fprq2{\*\panose 00000000000000000000}Baskerville BE Regular;}{\f34\fdecor\fcharset0\fprq2{\*\panose 00000000000000000000}Giddyup Thangs;}{\f35\fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}Giddyup;}{\f36\fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}TektoMM_100 LT 250 CN;}{\f37\fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}TektoMM_100 LT 564 NO;}{\f38\fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}TektoMM_100 LT 850 EX;}{\f39\fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}TektoMM_240 RG 250 CN;}{\f40\fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}TektoMM_240 RG 850 EX;}{\f41\fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}TektoMM_503 BD 250 CN;}{\f42\fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}TektoMM_503 BD 488 NO;}{\f43\fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}TektoMM_503 BD 850 EX;}{\f44\fnil\fcharset2\fprq2{\*\panose 00000000000000000000}Marlett;}{\f45\fswiss\fcharset0\fprq2{\*\panose 020f0704030504030204}Arial Rounded MT Bold;}{\f46\froman\fcharset0\fprq2{\*\panose 02040602050305030304}Book Antiqua;}{\f47\fswiss\fcharset0\fprq2{\*\panose 020b0502020202020204}Century Gothic;}{\f48\froman\fcharset0\fprq2{\*\panose 02040604050505020304}Century Schoolbook;}{\f49\froman\fcharset0\fprq2{\*\panose 00050102010706020507}Map Symbols;}{\f50\fswiss\fcharset0\fprq2{\*\panose 020b0706040902060204}Haettenschweiler;}{\f51\fdecor\fcharset0\fprq2{\*\panose 04020705040a02060702}Algerian;}{\f52\fdecor\fcharset0\fprq2{\*\panose 04030b070d0b02020403}Braggadocio;}{\f53\fswiss\fcharset0\fprq2{\*\panose 020b0903060703020204}Britannic Bold;}{\f54\fscript\fcharset0\fprq2{\*\panose 03060802040406070304}Brush Script MT;}{\f55\fdecor\fcharset0\fprq2{\*\panose 04020805060202030203}Colonna MT;}{\f56\fdecor\fcharset0\fprq2{\*\panose 04020505020e03040504}Desdemona;}{\f57\froman\fcharset0\fprq2{\*\panose 0204060206030a020304}Footlight MT Light;}{\f58\fdecor\fcharset0\fprq2{\*\panose 040307050d0c02020703}Kino MT;}{\f59\froman\fcharset0\fprq2{\*\panose 020a0a07050505020404}Wide Latin;}{\f60\fscript\fcharset0\fprq2{\*\panose 03020802060602070202}Matura MT Script Capitals;}{\f61\fdecor\fcharset0\fprq2{\*\panose 040506030a0602020202}Playbill;}{\f62\froman\fcharset2\fprq2{\*\panose 05050102010205020202}MT Extra;}{\f63\fswiss\fcharset0\fprq2{\*\panose 020e0602030304020304}Albertus Medium;}{\f64\fswiss\fcharset0\fprq2{\*\panose 020e0802040304020204}Albertus Extra Bold;}{\f65\fswiss\fcharset0\fprq2{\*\panose 020b0603020204030204}Antique Olive;}{\f66\fswiss\fcharset0\fprq2{\*\panose 020b0502050508020304}CG Omega;}{\f67\froman\fcharset0\fprq2{\*\panose 02020603050405020304}CG Times;}{\f68\froman\fcharset0\fprq2{\*\panose 02040706040705040204}Clarendon Condensed;}{\f69\fscript\fcharset238\fprq2{\*\panose 03030502040406070605}Coronet;}{\f70\froman\fcharset0\fprq2{\*\panose 02020404030301010803}Garamond;}{\f71\fmodern\fcharset0\fprq1{\*\panose 020b0409020202030204}Letter Gothic;}{\f72\fscript\fcharset0\fprq2{\*\panose 03020702040402020504}Marigold;}{\f73\fswiss\fcharset0\fprq2{\*\panose 020b0603020202030204}Univers;}{\f74\fswiss\fcharset0\fprq2{\*\panose 020b0606020202060204}Univers Condensed;}{\f75\fswiss\fcharset0\fprq2{\*\panose 020e0702040304020204}Albertus;}{\f76\fswiss\fcharset0\fprq2{\*\panose 020b0504020202050204}Metrostyle;}{\f77\fswiss\fcharset0\fprq2{\*\panose 020b0507020202060204}Metrostyle Extended;}{\f78\froman\fcharset0\fprq2{\*\panose 0208090404030b020404}Ozzie Black;}{\f79\fswiss\fcharset0\fprq2{\*\panose 020b0604030504040204}Verdana;}{\f80\froman\fcharset0\fprq2{\*\panose 02020500000000000000}CODABAR1;}{\f81\froman\fcharset0\fprq2{\*\panose 02020500000000000000}CODE3OF9X1;}{\f82\fswiss\fcharset0\fprq2{\*\panose 020b0500000000000000}INT2OF5X1;}{\f83\fnil\fcharset0\fprq2{\*\panose 00000000000000000000}USPS Bar Code;}{\f84\fmodern\fcharset2\fprq1{\*\panose 050b0009000000000000}OCR-A;}{\f85\fswiss\fcharset0\fprq2{\*\panose 020b0000000000000000}QuickType;}{\f86\fswiss\fcharset0\fprq2{\*\panose 020b0506030403020203}QuickType Condensed;}{\f87\fnil\fcharset2\fprq2{\*\panose 05000000000000000000}QuickType Pi;}{\f88\fdecor\fcharset0\fprq2{\*\panose 04040a05050d02020502}Beesknees ITC;}{\f89\fscript\fcharset0\fprq2{\*\panose 03070402050302030203}Bradley Hand ITC;}{\f90\froman\fcharset0\fprq2{\*\panose 02040603050505030304}Calisto MT;}{\f91\fdecor\fcharset0\fprq2{\*\panose 04040404050702020202}Curlz MT;}{\f92\froman\fcharset0\fprq2{\*\panose 02020904090505020303}Elephant;}{\f93\fswiss\fcharset0\fprq2{\*\panose 020b0907030504020204}Eras Bold ITC;}{\f94\fswiss\fcharset0\fprq2{\*\panose 020b0805030504020804}Eras Demi ITC;}{\f95\fswiss\fcharset0\fprq2{\*\panose 020b0402030504020804}Eras Light ITC;}{\f96\fswiss\fcharset0\fprq2{\*\panose 020b0602030504020804}Eras Medium ITC;}{\f97\fswiss\fcharset0\fprq2{\*\panose 020b0a07030504020204}Eras Ultra ITC;}{\f98\fdecor\fcharset0\fprq2{\*\panose 04040403040a02020202}Juice ITC;}{\f99\fdecor\fcharset0\fprq2{\*\panose 04040403030d02020704}Matisse ITC;}{\f100\froman\fcharset0\fprq2{\*\panose 02060603020205020403}Rockwell;}{\f101\froman\fcharset0\fprq2{\*\panose 02060903040505020403}Rockwell Extra Bold;}{\f102\fdecor\fcharset0\fprq2{\*\panose 04040a07060a02020202}Snap ITC;}{\f103\fdecor\fcharset0\fprq2{\*\panose 04020404030d07020202}Tempus Sans ITC;}{\f104\fscript\fcharset0\fprq2{\*\panose 03070502030502020203}Viner Hand ITC;}{\f105\fswiss\fcharset0\fprq2{\*\panose 020b0500000000000000}Anson;}{\f106\fnil\fcharset0\fprq2{\*\panose 00000000000000000000}Andes;}{\f107\fnil\fcharset0\fprq2{\*\panose 00000000000000000000}Fences;}{\f108\fnil\fcharset0\fprq2{\*\panose 00000000000000000000}BlackChancery;}{\f109\fmodern\fcharset0\fprq1{\*\panose 020b0009000000000000}QuickType Mono;}{\f110\fscript\fcharset238\fprq2{\*\panose 03010101010201010101}Monotype Corsiva;}{\f111\fnil\fcharset0\fprq2{\*\panose 00000000000000000000}MICRSSK;}{\f112\fswiss\fcharset0\fprq2{\*\panose 020b0506020202030204}Arial Narrow;}{\f113\fswiss\fcharset0\fprq2{\*\panose 020b0a04020102020204}Arial Black;}{\f114\froman\fcharset0\fprq2{\*\panose 02050604050505020204}Bookman Old Style;}{\f115\fnil\fcharset2\fprq2{\*\panose 01010601010101010101}Monotype Sorts;}{\f116\fswiss\fcharset0\fprq2{\*\panose 020b0806030902050204}Impact;}{\f117\froman\fcharset2\fprq2{\*\panose 05050102010706020507}Bookshelf Symbol 3;}{\f118\fscript\fcharset0\fprq2{\*\panose 030f0702030302020204}Comic Sans MS;}{\f119\fnil\fcharset2\fprq2{\*\panose 05000000000000000000}MS Outlook;}{\f120\fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}AvantGarde;}{\f121\fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}Helvetica-Narrow;}{\f122\froman\fcharset0\fprq2{\*\panose 00000000000000000000}NewCenturySchlbk;}{\f123\froman\fcharset0\fprq2{\*\panose 00000000000000000000}Palatino;}{\f124\froman\fcharset0\fprq2{\*\panose 00000000000000000000}ZapfChancery;}{\f125\fdecor\fcharset2\fprq2{\*\panose 00000000000000000000}ZapfDingbats;}{\f216\fswiss\fcharset238\fprq2 Tahoma CE;}{\f217\fswiss\fcharset204\fprq2 Tahoma Cyr;}{\f219\fswiss\fcharset161\fprq2 Tahoma Greek;}{\f220\fswiss\fcharset162\fprq2 Tahoma Tur;}{\f221\fswiss\fcharset186\fprq2 Tahoma Baltic;}{\f408\fswiss\fcharset238\fprq2 Century Gothic CE;}{\f409\fswiss\fcharset204\fprq2 Century Gothic Cyr;}{\f412\fswiss\fcharset162\fprq2 Century Gothic Tur;}{\f413\fswiss\fcharset186\fprq2 Century Gothic Baltic;}{\f504\fswiss\fcharset238\fprq2 Albertus Medium CE;}{\f505\fswiss\fcharset204\fprq2 Albertus Medium Cyr;}{\f508\fswiss\fcharset162\fprq2 Albertus Medium Tur;}{\f509\fswiss\fcharset186\fprq2 Albertus Medium Baltic;}{\f510\fswiss\fcharset238\fprq2 Albertus Extra Bold CE;}{\f511\fswiss\fcharset204\fprq2 Albertus Extra Bold Cyr;}{\f514\fswiss\fcharset162\fprq2 Albertus Extra Bold Tur;}{\f515\fswiss\fcharset186\fprq2 Albertus Extra Bold Baltic;}{\f516\fswiss\fcharset238\fprq2 Antique Olive CE;}{\f517\fswiss\fcharset204\fprq2 Antique Olive Cyr;}{\f520\fswiss\fcharset162\fprq2 Antique Olive Tur;}{\f521\fswiss\fcharset186\fprq2 Antique Olive Baltic;}{\f522\fswiss\fcharset238\fprq2 CG Omega CE;}{\f523\fswiss\fcharset204\fprq2 CG Omega Cyr;}{\f526\fswiss\fcharset162\fprq2 CG Omega Tur;}{\f527\fswiss\fcharset186\fprq2 CG Omega Baltic;}{\f528\froman\fcharset238\fprq2 CG Times CE;}{\f529\froman\fcharset204\fprq2 CG Times Cyr;}{\f532\froman\fcharset162\fprq2 CG Times Tur;}{\f533\froman\fcharset186\fprq2 CG Times Baltic;}{\f534\froman\fcharset238\fprq2 Clarendon Condensed CE;}{\f535\froman\fcharset204\fprq2 Clarendon Condensed Cyr;}{\f538\froman\fcharset162\fprq2 Clarendon Condensed Tur;}{\f539\froman\fcharset186\fprq2 Clarendon Condensed Baltic;}{\f546\froman\fcharset238\fprq2 Garamond CE;}{\f547\froman\fcharset204\fprq2 Garamond Cyr;}{\f549\froman\fcharset161\fprq2 Garamond Greek;}{\f550\froman\fcharset162\fprq2 Garamond Tur;}{\f551\froman\fcharset186\fprq2 Garamond Baltic;}{\f552\fmodern\fcharset238\fprq1 Letter Gothic CE;}{\f553\fmodern\fcharset204\fprq1 Letter Gothic Cyr;}{\f556\fmodern\fcharset162\fprq1 Letter Gothic Tur;}{\f557\fmodern\fcharset186\fprq1 Letter Gothic Baltic;}{\f558\fscript\fcharset238\fprq2 Marigold CE;}{\f562\fscript\fcharset162\fprq2 Marigold Tur;}{\f564\fswiss\fcharset238\fprq2 Univers CE;}{\f565\fswiss\fcharset204\fprq2 Univers Cyr;}{\f568\fswiss\fcharset162\fprq2 Univers Tur;}{\f569\fswiss\fcharset186\fprq2 Univers Baltic;}{\f570\fswiss\fcharset238\fprq2 Univers Condensed CE;}{\f571\fswiss\fcharset204\fprq2 Univers Condensed Cyr;}{\f574\fswiss\fcharset162\fprq2 Univers Condensed Tur;}{\f575\fswiss\fcharset186\fprq2 Univers Condensed Baltic;}{\f576\fswiss\fcharset238\fprq2 Albertus CE;}{\f577\fswiss\fcharset204\fprq2 Albertus Cyr;}{\f580\fswiss\fcharset162\fprq2 Albertus Tur;}{\f581\fswiss\fcharset186\fprq2 Albertus Baltic;}{\f582\fswiss\fcharset238\fprq2 Metrostyle CE;}{\f583\fswiss\fcharset204\fprq2 Metrostyle Cyr;}{\f586\fswiss\fcharset162\fprq2 Metrostyle Tur;}{\f587\fswiss\fcharset186\fprq2 Metrostyle Baltic;}{\f588\fswiss\fcharset238\fprq2 Metrostyle Extended CE;}{\f589\fswiss\fcharset204\fprq2 Metrostyle Extended Cyr;}{\f592\fswiss\fcharset162\fprq2 Metrostyle Extended Tur;}{\f593\fswiss\fcharset186\fprq2 Metrostyle Extended Baltic;}{\f594\froman\fcharset238\fprq2 Ozzie Black CE;}{\f595\froman\fcharset204\fprq2 Ozzie Black Cyr;}{\f598\froman\fcharset162\fprq2 Ozzie Black Tur;}{\f599\froman\fcharset186\fprq2 Ozzie Black Baltic;}{\f624\fnil\fcharset238\fprq2 USPS Bar Code CE;}{\f628\fnil\fcharset162\fprq2 USPS Bar Code Tur;}{\f762\fnil\fcharset238\fprq2 Andes CE;}{\f766\fnil\fcharset162\fprq2 Andes Tur;}{\f774\fnil\fcharset238\fprq2 BlackChancery CE;}{\f778\fnil\fcharset162\fprq2 BlackChancery Tur;}{\f798\fswiss\fcharset238\fprq2 Arial Narrow CE;}{\f799\fswiss\fcharset204\fprq2 Arial Narrow Cyr;}{\f801\fswiss\fcharset161\fprq2 Arial Narrow Greek;}{\f802\fswiss\fcharset162\fprq2 Arial Narrow Tur;}{\f803\fswiss\fcharset186\fprq2 Arial Narrow Baltic;}{\f804\fswiss\fcharset238\fprq2 Arial Black CE;}{\f805\fswiss\fcharset204\fprq2 Arial Black Cyr;}{\f807\fswiss\fcharset161\fprq2 Arial Black Greek;}{\f808\fswiss\fcharset162\fprq2 Arial Black Tur;}{\f809\fswiss\fcharset186\fprq2 Arial Black Baltic;}{\f810\froman\fcharset238\fprq2 Bookman Old Style CE;}{\f811\froman\fcharset204\fprq2 Bookman Old Style Cyr;}{\f813\froman\fcharset161\fprq2 Bookman Old Style Greek;}{\f814\froman\fcharset162\fprq2 Bookman Old Style Tur;}{\f815\froman\fcharset186\fprq2 Bookman Old Style Baltic;}{\f822\fswiss\fcharset238\fprq2 Impact CE;}{\f823\fswiss\fcharset204\fprq2 Impact Cyr;}{\f825\fswiss\fcharset161\fprq2 Impact Greek;}{\f826\fswiss\fcharset162\fprq2 Impact Tur;}{\f827\fswiss\fcharset186\fprq2 Impact Baltic;}}{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;}{\stylesheet{\nowidctlpar\widctlpar\adjustright \f12\cgrid \snext0 Normal;}{\*\cs10 \additive Default Paragraph Font;}{\s15\nowidctlpar\widctlpar\tx2160\tqr\tldot\tx10080\adjustright \b\cgrid \sbasedon0 \snext0 toc 1;}{\s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright \f12\cgrid \sbasedon0 \snext16 footer;}{\s17\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright \f12\cgrid \sbasedon0 \snext17 header;}{\s18\li720\nowidctlpar\widctlpar\adjustright \f12\cgrid \sbasedon0 \snext18 Indented;}{\s19\nowidctlpar\widctlpar\tx2160\tqr\tldot\tx10080\adjustright \cgrid \sbasedon0 \snext0 toc 2;}{\s20\qj\nowidctlpar\widctlpar\adjustright \f4\fs48\cgrid \sbasedon0 \snext20 chap head;}{\s21\qj\nowidctlpar\widctlpar\adjustright \b\f4\cgrid \sbasedon20 \snext21 subchap;}{\s22\li480\nowidctlpar\widctlpar\tqr\tldot\tx10080\adjustright \i\fs20\cgrid \sbasedon0 \snext0 toc 3;}{\s23\li720\nowidctlpar\widctlpar\tqr\tldot\tx10080\adjustright \fs18\cgrid \sbasedon0 \snext0 toc 4;}{\s24\li960\nowidctlpar\widctlpar\tqr\tldot\tx10080\adjustright \fs18\cgrid \sbasedon0 \snext0 toc 5;}{\s25\li1200\nowidctlpar\widctlpar\tqr\tldot\tx10080\adjustright \fs18\cgrid \sbasedon0 \snext0 toc 6;}{\s26\li1440\nowidctlpar\widctlpar\tqr\tldot\tx10080\adjustright \fs18\cgrid \sbasedon0 \snext0 toc 7;}{\s27\li1680\nowidctlpar\widctlpar\tqr\tldot\tx10080\adjustright \fs18\cgrid \sbasedon0 \snext0 toc 8;}{\s28\li1920\nowidctlpar\widctlpar\tqr\tldot\tx10080\adjustright \fs18\cgrid \sbasedon0 \snext0 toc 9;}{\s29\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright \fs18\cgrid \sbasedon0 \snext0 index 1;}{\s30\nowidctlpar\widctlpar\tx2160\tqr\tldot\tx10080\adjustright \lang1024\cgrid \sbasedon0 \snext30 TOC 1a;}{\s31\fi-240\li480\nowidctlpar\widctlpar\tqr\tx4680\adjustright \fs18\cgrid \sbasedon0 \snext0 index 2;}{\s32\fi-240\li720\nowidctlpar\widctlpar\tqr\tx4680\adjustright \fs18\cgrid \sbasedon0 \snext0 index 3;}{\s33\fi-240\li960\nowidctlpar\widctlpar\tqr\tx4680\adjustright \fs18\cgrid \sbasedon0 \snext0 index 4;}{\s34\fi-240\li1200\nowidctlpar\widctlpar\tqr\tx4680\adjustright \fs18\cgrid \sbasedon0 \snext0 index 5;}{\s35\fi-240\li1440\nowidctlpar\widctlpar\tqr\tx4680\adjustright \fs18\cgrid \sbasedon0 \snext0 index 6;}{\s36\fi-240\li1680\nowidctlpar\widctlpar\tqr\tx4680\adjustright \fs18\cgrid \sbasedon0 \snext0 index 7;}{\s37\fi-240\li1920\nowidctlpar\widctlpar\tqr\tx4680\adjustright \fs18\cgrid \sbasedon0 \snext0 index 8;}{\s38\fi-240\li2160\nowidctlpar\widctlpar\tqr\tx4680\adjustright \fs18\cgrid \sbasedon0 \snext0 index 9;}{\s39\li140\sb240\sa120\nowidctlpar\widctlpar\adjustright \b\f1\fs28\cgrid \sbasedon0 \snext29 index heading;}}{\*\revtbl {Unknown;}}{\info{\title GNO Kernel Reference Manual}{\author Lisa K Holsberg}{\operator Lisa K Holsberg}{\creatim\yr1997\mo8\dy27\hr16\min8}{\revtim\yr1997\mo8\dy27\hr16\min8}{\printim\yr1996\mo8\dy7\hr23\min22}{\version2}{\edmins0}{\nofpages14}{\nofwords15715}{\nofchars89578}{\*\company Promethean Enterprises}{\nofcharsws110008}{\vern71}}\margl1080\margr1080\margb720 \facingp\widowctrl\ftnbj\aenddoc\hyphhotz0\margmirror\sprstsp\otblrul\brkfrm\sprstsm\truncex\nolead\msmcap\lytprtmet\hyphcaps0\viewkind1\viewscale90\pgbrdrhead\pgbrdrfoot \fet0\sectd \pgnrestart\linex0\endnhere\sectdefaultcl {\*\pnseclvl1\pnucrm\pnstart1\pnindent720\pnhang{\pntxta .}}{\*\pnseclvl2\pnucltr\pnstart1\pnindent720\pnhang{\pntxta .}}{\*\pnseclvl3\pndec\pnstart1\pnindent720\pnhang{\pntxta .}}{\*\pnseclvl4\pnlcltr\pnstart1\pnindent720\pnhang{\pntxta )}}{\*\pnseclvl5\pndec\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}{\*\pnseclvl6\pnlcltr\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}{\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}{\*\pnseclvl8\pnlcltr\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}{\*\pnseclvl9\pnlcrm\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}\pard\plain \nowidctlpar\widctlpar\adjustright \f12\cgrid { +\par }\pard \nowidctlpar\widctlpar\adjustright { +\par +\par +\par +\par +\par +\par +\par +\par +\par +\par +\par +\par +\par +\par +\par +\par +\par +\par +\par +\par +\par +\par +\par +\par +\par }\pard \ri-1440\nowidctlpar\widctlpar\adjustright { +\par }\pard \nowidctlpar\widctlpar\adjustright { +\par +\par +\par +\par +\par +\par +\par +\par +\par +\par }\pard \qr\nowidctlpar\widctlpar\adjustright {\b\f4\fs76 GNO Kernel Reference Manual +\par }\pard \qr\nowidctlpar\widctlpar\adjustright {\f4\fs36 By Jawaid Bazyar +\par Edited by Andrew Roughan}{\f4\fs36 +\par }\pard \nowidctlpar\widctlpar\adjustright {\f4\fs36 \page \page }{\f4\fs48 Table of Contents +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 +\par }\pard\plain \s15\nowidctlpar\widctlpar\tx2160\tqr\tldot\tx10080\adjustright \b\cgrid { +\par }{\field\fldedit{\*\fldinst {\f4 TOC \\f }}{\fldrslt {\lang1024 Chapter 1\tab Introducing the GNO Kernel\tab }{\field{\*\fldinst {\lang1024 GOTOBUTTON _Toc364074581 }{\field{\*\fldinst {\lang1024 PAGEREF _Toc364074581 }}{\fldrslt {\lang1024 5}}}}}{\lang1024 +\par }\pard \s15\nowidctlpar\widctlpar\tx2160\tqr\tldot\tx10080\adjustright {\lang1024 Chapter 2\tab GNO/ME Compliance\tab }{\field{\*\fldinst {\lang1024 GOTOBUTTON _Toc364074582 }{\field{\*\fldinst {\lang1024 PAGEREF _Toc364074582 }}{\fldrslt {\lang1024 7}}}}}{\lang1024 +\par }\pard\plain \s19\nowidctlpar\widctlpar\tx2160\tqr\tldot\tx10080\adjustright \cgrid {\lang1024 \tab Detecting the GNO Environment\tab }{\field\flddirty{\*\fldinst {\lang1024 GOTOBUTTON _Toc364074583 }{\field{\*\fldinst {\lang1024 PAGEREF _Toc364074583 }}{\fldrslt {\lang1024 7}}}}}{\lang1024 +\par }\pard \s19\nowidctlpar\widctlpar\tx2160\tqr\tldot\tx10080\adjustright {\lang1024 \tab Terminal I/O\tab }{\field\flddirty{\*\fldinst {\lang1024 GOTOBUTTON _Toc364074584 }{\field{\*\fldinst {\lang1024 PAGEREF _Toc364074584 }}{\fldrslt {\lang1024 7}}}}}{\lang1024 +\par \tab Stack Usage\tab }{\field\flddirty{\*\fldinst {\lang1024 GOTOBUTTON _Toc364074585 }{\field{\*\fldinst {\lang1024 PAGEREF _Toc364074585 }}{\fldrslt {\lang1024 8}}}}}{\lang1024 +\par \tab Disk I/O\tab }{\field\flddirty{\*\fldinst {\lang1024 GOTOBUTTON _Toc364074586 }{\field{\*\fldinst {\lang1024 PAGEREF _Toc364074586 }}{\fldrslt {\lang1024 9}}}}}{\lang1024 +\par \tab Non-Compliant Applications\tab }{\field\flddirty{\*\fldinst {\lang1024 GOTOBUTTON _Toc364074587 }{\field{\*\fldinst {\lang1024 PAGEREF _Toc364074587 }}{\fldrslt {\lang1024 9}}}}}{\lang1024 +\par }\pard\plain \s15\nowidctlpar\widctlpar\tx2160\tqr\tldot\tx10080\adjustright \b\cgrid {\lang1024 Chapter 3\tab Modifications to GS/OS\tab }{\field{\*\fldinst {\lang1024 GOTOBUTTON _Toc364074588 }{\field{\*\fldinst {\lang1024 PAGEREF _Toc364074588 }}{\fldrslt {\lang1024 11}}}}}{\lang1024 +\par }\pard\plain \s30\nowidctlpar\widctlpar\tx2160\tqr\tldot\tx10080\adjustright \lang1024\cgrid {\tab Mutual Exclusion in GS/OS and ToolBox calls\tab }{\field\flddirty{\*\fldinst { GOTOBUTTON _Toc364074589 }{\field{\*\fldinst { PAGEREF _Toc364074589 }}{\fldrslt {11}}}}}{ +\par }\pard \s30\nowidctlpar\widctlpar\tx2160\tqr\tldot\tx10080\adjustright {\tab Pathnames and Prefixes\tab }{\field\flddirty{\*\fldinst { GOTOBUTTON _Toc364074590 }{\field{\*\fldinst { PAGEREF _Toc364074590 }}{\fldrslt {11}}}}}{ +\par \tab Named prefixes\tab }{\field\flddirty{\*\fldinst { GOTOBUTTON _Toc364074591 }{\field{\*\fldinst { PAGEREF _Toc364074591 }}{\fldrslt {12}}}}}{ +\par \tab Open File Tracking\tab }{\field\flddirty{\*\fldinst { GOTOBUTTON _Toc364074592 }{\field{\*\fldinst { PAGEREF _Toc364074592 }}{\fldrslt {12}}}}}{ +\par \tab Refnums and file descriptors\tab }{\field\flddirty{\*\fldinst { GOTOBUTTON _Toc364074593 }{\field{\*\fldinst { PAGEREF _Toc364074593 }}{\fldrslt {13}}}}}{ +\par \tab GNO/ME Character Devices\tab }{\field\flddirty{\*\fldinst { GOTOBUTTON _Toc364074594 }{\field{\*\fldinst { PAGEREF _Toc364074594 }}{\fldrslt {13}}}}}{ +\par \tab Restartability\tab }{\field\flddirty{\*\fldinst { GOTOBUTTON _Toc364074595 }{\field{\*\fldinst { PAGEREF _Toc364074595 }}{\fldrslt {14}}}}}{ +\par \tab Miscellaneous\tab }{\field\flddirty{\*\fldinst { GOTOBUTTON _Toc364074596 }{\field{\*\fldinst { PAGEREF _Toc364074596 }}{\fldrslt {15}}}}}{ +\par }\pard\plain \s15\nowidctlpar\widctlpar\tx2160\tqr\tldot\tx10080\adjustright \b\cgrid {\lang1024 Chapter 4\tab Modifications to the ToolBox\tab }{\field{\*\fldinst {\lang1024 GOTOBUTTON _Toc364074597 }{\field{\*\fldinst {\lang1024 PAGEREF _Toc364074597 }}{\fldrslt {\lang1024 17}}}}}{\lang1024 +\par }\pard\plain \s30\nowidctlpar\widctlpar\tx2160\tqr\tldot\tx10080\adjustright \lang1024\cgrid {\tab TextTools Replacement\tab }{\field\flddirty{\*\fldinst { GOTOBUTTON _Toc364074598 }{\field{\*\fldinst { PAGEREF _Toc364074598 }}{\fldrslt {17}}}}}{ +\par }\pard \s30\nowidctlpar\widctlpar\tx2160\tqr\tldot\tx10080\adjustright {\tab SysFailMgr ($1503)\tab }{\field\flddirty{\*\fldinst { GOTOBUTTON _Toc364074599 }{\field{\*\fldinst { PAGEREF _Toc364074599 }}{\fldrslt {19}}}}}{ +\par \tab The Resource Manager\tab }{\field\flddirty{\*\fldinst { GOTOBUTTON _Toc364074600 }{\field{\*\fldinst { PAGEREF _Toc364074600 }}{\fldrslt {20}}}}}{ +\par \tab The Control Panel\tab }{\field\flddirty{\*\fldinst { GOTOBUTTON _Toc364074601 }{\field{\*\fldinst { PAGEREF _Toc364074601 }}{\fldrslt {20}}}}}{ +\par \tab QDStartup($0204)\tab }{\field\flddirty{\*\fldinst { GOTOBUTTON _Toc364074602 }{\field{\*\fldinst { PAGEREF _Toc364074602 }}{\fldrslt {21}}}}}{ +\par }\pard\plain \s15\nowidctlpar\widctlpar\tx2160\tqr\tldot\tx10080\adjustright \b\cgrid {\lang1024 Chapter 5\tab Process Management\tab }{\field{\*\fldinst {\lang1024 GOTOBUTTON _Toc364074603 }{\field{\*\fldinst {\lang1024 PAGEREF _Toc364074603 }}{\fldrslt {\lang1024 23}}}}}{\lang1024 +\par }\pard\plain \s30\nowidctlpar\widctlpar\tx2160\tqr\tldot\tx10080\adjustright \lang1024\cgrid {\tab Process Table\tab }{\field\flddirty{\*\fldinst { GOTOBUTTON _Toc364074604 }{\field{\*\fldinst { PAGEREF _Toc364074604 }}{\fldrslt {24}}}}}{ +\par }\pard \s30\nowidctlpar\widctlpar\tx2160\tqr\tldot\tx10080\adjustright {\tab Task Switching\tab }{\field\flddirty{\*\fldinst { GOTOBUTTON _Toc364074605 }{\field{\*\fldinst { PAGEREF _Toc364074605 }}{\fldrslt {25}}}}}{ +\par }\pard\plain \s15\nowidctlpar\widctlpar\tx2160\tqr\tldot\tx10080\adjustright \b\cgrid {\lang1024 Chapter 6\tab Interprocess Communication\tab }{\field{\*\fldinst {\lang1024 GOTOBUTTON _Toc364074606 }{\field{\*\fldinst {\lang1024 PAGEREF _Toc364074606 }}{\fldrslt {\lang1024 27}}}}}{\lang1024 +\par }\pard\plain \s30\nowidctlpar\widctlpar\tx2160\tqr\tldot\tx10080\adjustright \lang1024\cgrid {\tab Semaphores\tab }{\field\flddirty{\*\fldinst { GOTOBUTTON _Toc364074607 }{\field{\*\fldinst { PAGEREF _Toc364074607 }}{\fldrslt {27}}}}}{ +\par }\pard \s30\nowidctlpar\widctlpar\tx2160\tqr\tldot\tx10080\adjustright {\tab Signals\tab }{\field\flddirty{\*\fldinst { GOTOBUTTON _Toc364074608 }{\field{\*\fldinst { PAGEREF _Toc364074608 }}{\fldrslt {28}}}}}{ +\par \tab Pipes\tab }{\field\flddirty{\*\fldinst { GOTOBUTTON _Toc364074609 }{\field{\*\fldinst { PAGEREF _Toc364074609 }}{\fldrslt {30}}}}}{ +\par \tab Messages\tab }{\field\flddirty{\*\fldinst { GOTOBUTTON _Toc364074610 }{\field{\*\fldinst { PAGEREF _Toc364074610 }}{\fldrslt {32}}}}}{ +\par \tab Ports\tab }{\field\flddirty{\*\fldinst { GOTOBUTTON _Toc364074611 }{\field{\*\fldinst { PAGEREF _Toc364074611 }}{\fldrslt {32}}}}}{ +\par \tab Pseudo-Terminals (PTYs)\tab }{\field\flddirty{\*\fldinst { GOTOBUTTON _Toc364074612 }{\field{\*\fldinst { PAGEREF _Toc364074612 }}{\fldrslt {33}}}}}{ +\par \tab Deadlock\tab }{\field\flddirty{\*\fldinst { GOTOBUTTON _Toc364074613 }{\field{\*\fldinst { PAGEREF _Toc364074613 }}{\fldrslt {35}}}}}{ +\par }\pard\plain \s15\nowidctlpar\widctlpar\tx2160\tqr\tldot\tx10080\adjustright \b\cgrid {\lang1024 Appendix A\tab Making System Calls\tab }{\field{\*\fldinst {\lang1024 GOTOBUTTON _Toc364074614 }{\field{\*\fldinst {\lang1024 PAGEREF _Toc364074614 }}{\fldrslt {\lang1024 37}}}}}{\lang1024 +\par }\pard\plain \s30\nowidctlpar\widctlpar\tx2160\tqr\tldot\tx10080\adjustright \lang1024\cgrid {\tab System Call Interface\tab }{\field\flddirty{\*\fldinst { GOTOBUTTON _Toc364074615 }{\field{\*\fldinst { PAGEREF _Toc364074615 }}{\fldrslt {37}}}}}{ +\par }\pard \s30\nowidctlpar\widctlpar\tx2160\tqr\tldot\tx10080\adjustright {\tab System Call Error Codes\tab }{\field\flddirty{\*\fldinst { GOTOBUTTON _Toc364074616 }{\field{\*\fldinst { PAGEREF _Toc364074616 }}{\fldrslt {38}}}}}{ +\par \tab System Panics\tab }{\field\flddirty{\*\fldinst { GOTOBUTTON _Toc364074617 }{\field{\*\fldinst { PAGEREF _Toc364074617 }}{\fldrslt {39}}}}}{ +\par }\pard\plain \s15\nowidctlpar\widctlpar\tx2160\tqr\tldot\tx10080\adjustright \b\cgrid {\lang1024 Appendix B\tab Miscellaneous Programming Issues\tab }{\field{\*\fldinst {\lang1024 GOTOBUTTON _Toc364074618 }{\field{\*\fldinst {\lang1024 PAGEREF _Toc364074618 }}{\fldrslt {\lang1024 40}}}}}{\lang1024 +\par }\pard\plain \s30\nowidctlpar\widctlpar\tx2160\tqr\tldot\tx10080\adjustright \lang1024\cgrid {\tab Option Arguments\tab }{\field\flddirty{\*\fldinst { GOTOBUTTON _Toc364074619 }{\field{\*\fldinst { PAGEREF _Toc364074619 }}{\fldrslt {40}}}}}{ +\par }\pard \s30\nowidctlpar\widctlpar\tx2160\tqr\tldot\tx10080\adjustright {\tab Pathname Expansion\tab }{\field\flddirty{\*\fldinst { GOTOBUTTON _Toc364074620 }{\field{\*\fldinst { PAGEREF _Toc364074620 }}{\fldrslt {40}}}}}{ +\par }\pard\plain \s15\nowidctlpar\widctlpar\tx2160\tqr\tldot\tx10080\adjustright \b\cgrid {\lang1024 Glossary\tab \tab }{\field{\*\fldinst {\lang1024 GOTOBUTTON _Toc364074621 }{\field{\*\fldinst {\lang1024 PAGEREF _Toc364074621 }}{\fldrslt {\lang1024 41}}}}}{\lang1024 +\par }\pard \s15\nowidctlpar\widctlpar\tx2160\tqr\tldot\tx10080\adjustright {Index\tab \tab 43 +\par }\pard \s15\nowidctlpar\widctlpar\tx2160\tqr\tldot\tx10080\adjustright }}\pard\plain \s15\nowidctlpar\widctlpar\tx2160\tqr\tldot\tx10080\adjustright \b\cgrid {\f4 \page }{\b0\f4 \sect }\sectd \linex0\endnhere\sectdefaultcl {\headerl \pard\plain \s17\nowidctlpar\widctlpar\tqr\tx10080\adjustright \f12\cgrid {\f5\ul Introducing the GNO Kernel\tab Chapter 1 +\par }\pard \s17\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}{\headerr \pard\plain \s17\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright \f12\cgrid { +\par }}{\footerl \pard\plain \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright \f12\cgrid {\ul \tab \tab +\par }\pard \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright {\chpgn +\par }\pard \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}{\footerr \pard\plain \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright \f12\cgrid {\ul \tab \tab +\par }{\tab \tab \chpgn +\par }\pard \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}\pard\plain \s20\qj\nowidctlpar\widctlpar\adjustright \f4\fs48\cgrid {Chapter 1 +\par Introducing the GNO Kernel}{\pard\plain \s20\qj\nowidctlpar\widctlpar\adjustright \v\f4\fs48\cgrid {\tc {{\*\bkmkstart _Toc364074581}Introducing the GNO Kernel{\*\bkmkend _Toc364074581}\tcl1}}}{ +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \f12\cgrid {\f4 +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 +\par +\par The GNO kernel}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GNO kernel}}}{\f4 is the heart of the GNO Multitasking Environment (GNO/ME}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GNO/ME}}}{\f4 ). The GNO kernel}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GNO kernel}}}{\f4 provides a layer of communication between the shell (and shell-based programs) and the operating system, GS/OS}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GS/OS}}}{\f4 . The kernel handles such things as multitasking}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 multitasking}}}{\f4 , background}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 background}}}{\f4 processes, foreground}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 foreground}}}{\f4 processes and many other features that were not previously available on the Apple IIGS. It is these features which make GNO/ME}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GNO/ME}}}{\f4 very powerful. +\par }\pard \nowidctlpar\widctlpar\adjustright { +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 This reference manual is highly technical in nature and is provided to help programmers develop utilities for the GNO Multitasking Environment. The beginner has no need to read this manual and is certainly not expected to understand its contents. However, Chapter 5 }{\b\f4 Process Management}{\f4 and Chapter 6 }{\b\f4 Interprocess Communication}{\f4 provide a good background discussion for anyone who is interested in the internal workings of the kernel.}{ +\par }\pard \nowidctlpar\widctlpar\adjustright {\page +\par +\par +\par }{\fs10 (We're sorry, but you did pay 1 cent extra for this blank page) +\par }\pard\plain \s15\nowidctlpar\widctlpar\tx2160\tqr\tldot\tx10080\adjustright \b\cgrid {\sect }\sectd \linex0\endnhere\titlepg\sectdefaultcl {\headerl \pard\plain \s17\nowidctlpar\widctlpar\tqr\tx10080\adjustright \f12\cgrid {\f5\ul GNO/ME Compliance\tab Chapter 2}{\f5\ul +\par }\pard \s17\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}{\headerr \pard\plain \s17\nowidctlpar\widctlpar\tqr\tx10080\adjustright \f12\cgrid {\f5\ul Chapter }{\f5\ul 2}{\f5\ul \tab }{\f5\ul GNO/ME Compliance}{\f5\ul +\par }\pard \s17\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}{\footerl \pard\plain \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright \f12\cgrid {\ul \tab \tab +\par }\pard \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright {\chpgn +\par }\pard \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}{\footerr \pard\plain \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright \f12\cgrid {\ul \tab \tab +\par }\pard \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright {\tab \tab \chpgn +\par }\pard \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}{\footerf \pard\plain \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright \f12\cgrid {\ul \tab \tab +\par }\pard \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright {\tab \tab \chpgn +\par }\pard \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}\pard\plain \s20\qj\nowidctlpar\widctlpar\adjustright \f4\fs48\cgrid {Chapter 2 +\par }\pard \s20\qj\nowidctlpar\widctlpar\adjustright {GNO/ME Compliance}{\pard\plain \s20\qj\nowidctlpar\widctlpar\adjustright \v\f4\fs48\cgrid {\tc {{\*\bkmkstart _Toc364074582}GNO/ME Compliance{\*\bkmkend _Toc364074582}\tcl1}}}{ +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \f12\cgrid {\f4 +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 +\par +\par For a program to work effectively under GNO/ME}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GNO/ME}}}{\f4 , certain rules must be followed. Most of these rules boil down to one underlying concept - }{\b\f4 never directly access features of the machine}{\f4 . Always use GS/OS}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GS/OS}}}{\f4 , the ToolBox}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 ToolBox}}}{\f4 , or GNO/ME}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GNO/ME}}}{\f4 to accomplish what you need. We have taken great care to provide the sorts of services you might need, such as checking for input without having to wait for it. GNO/ME compliance}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GNO/ME compliance}}}{\f4 isn't just a matter of trying to make applications work well under the environment; it ensures that those applications stay compatible, no matter what changes the system goes through. Below are summarized the points you must consider when you're writing a GNO/ME}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GNO/ME}}}{\f4 compliant application. +\par +\par +\par }\pard\plain \s21\qj\nowidctlpar\widctlpar\adjustright \b\f4\cgrid {Detecting the GNO Environment}{\pard\plain \s21\qj\nowidctlpar\widctlpar\adjustright \b\v\f4\cgrid {\tc {{\*\bkmkstart _Toc364074583}Detecting the GNO Environment{\*\bkmkend _Toc364074583}\tcl1}}}{ +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \f12\cgrid {\f4 +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 If your application requires the GNO Kernel}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GNO Kernel}}}{\f4 to be active (if it makes any kernel calls), you can make sure of this by making a }{\b\f4 kernStatus}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 kernStatus}}}{\f4 call at the beginning of your program. The call will return no error if the kernel is active, or it will return an error code of $0001 (Tool locator}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 Tool locator}}}{\f4 - tool not found), in which case the value returned will be invalid. The call actually returns a 1 if no error occurs, but the value returned will be indeterminate if the kernel}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 kernel}}}{\f4 is not active, so you should only check for an error (the function }{\b\f4 toolerror}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 toolerror}}}{\f4 () or the variable }{\b\f4 _toolErr}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 _toolErr}}}{\f4 in C, the value in the A register in assembly). +\par +\par You can also determine the current version of the GNO Kernel }{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GNO Kernel }}}{\f4 by making the }{\b\f4 kernVersion}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 kernVersion}}}{\f4 call. The format of the version number returned is the same as the standard ToolBox}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 ToolBox}}}{\f4 calls. For example a return value of $0201 indicates a version of 2.1. +\par +\par }{\b\f4 kernStatus}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 kernStatus}}}{\f4 and }{\b\f4 kernVersion}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 kernVersion}}}{\f4 are defined in the }{\f6 }{\f4 header file. +\par +\par +\par }\pard\plain \s21\qj\nowidctlpar\widctlpar\adjustright \b\f4\cgrid {Terminal I/O}{\pard\plain \s21\qj\nowidctlpar\widctlpar\adjustright \b\v\f4\cgrid {\tc {{\*\bkmkstart _Toc364074584}Terminal I/O{\*\bkmkend _Toc364074584}\tcl1}}}{ +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \f12\cgrid {\f4 +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 The Apple II has always been lacking in standardized methods for reading keyboard input and controlling the text screen. This problem was compounded when Apple stopped supporting the TextTools}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 TextTools}}}{\f4 in favor of the GS/OS}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GS/OS}}}{\f4 console driver}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 console driver}}}{\f4 . The console driver}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 console driver}}}{\f4 has a number of problems that prevent it from being a good solution under GNO/ME}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GNO/ME}}}{\f4 . There is high overhead involved in using it. It is generally accessed like a regular file, which means any I/O}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 I/O}}}{\f4 on it must filter through several layers before being handled. Even though in System 6.0.1}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 System 6.0.1}}}{\f4 there is a provision for patching the low-level routines the special high-level user input features of the driver cannot be used over a modem}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 modem}}}{\f4 or in a desktop}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 desktop}}}{\f4 program. And GS/OS}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GS/OS}}}{\f4 must be called to access it, which means that while a console driver}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 console driver}}}{\f4 access is occurring, no other processes can execute. See Chapter 3 }{\b\f4 Mutual Exclusion in GS/OS and ToolBox calls}{\f4 . +\par +\par GNO/ME}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GNO/ME}}}{\f4 ignores the GS/OS}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GS/OS}}}{\f4 '}{\f6 .CONSOLE}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f6\cgrid {\xe {\v\f6 }{\f6 .CONSOLE}}}{\f6 '}{\f4 driver and replaces the TextTools}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 TextTools}}}{\f4 with a high-performance, very flexible generic terminal control system. GNO/ME}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GNO/ME}}}{\f4 directly supports the console}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 console}}}{\f4 (keyboard and screen), as well as the serial ports}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 serial ports}}}{\f4 , as terminal}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 terminal}}}{\f4 s. In order for a user program to take advantage of these features and to be GNO/ME compliant}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GNO/ME compliant}}}{\f4 , you must do terminal I/O}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 I/O}}}{\f4 only through the TextTools}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 }}}{\f4 , or through stdin}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 stdin}}}{\f4 , stdout}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 stdout}}}{\f4 , and stderr}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 stderr}}}{\f4 (refNums 1,2, and 3 initially) via GS/OS}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GS/OS}}}{\f4 . By its very nature TextTools}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 TextTools}}}{\f4 is slow, so we recommend using them only for small and simple tasks. Calls to the GS/OS}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GS/OS}}}{\f4 console driver}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 console driver}}}{\f4 will not crash the system, but they will make other processes stop until the call is completed. +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 +\par You must not get input directly from the keyboard latch}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 keyboard latch}}}{\f4 (memory location }{\f6 $E0C000}{\f4 ), nor may you write directly to the screen memory}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 screen memory}}}{\f4 . GNO/ME}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GNO/ME}}}{\f4 's terminal}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 terminal}}}{\f4 I/O}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 I/O}}}{\f4 system has been designed so you don't have to do either of these things. If you need to check for keyboard input}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 keyboard input}}}{\f4 without stopping your application, you can make the appropriate }{\b\f4 ioctl}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 ioctl}}}{\f4 (2) call to do what you need. +\par +\par In the future, GNO/ME}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GNO/ME}}}{\f4 may provide a GNO/ME-friendly version of the GS/OS}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GS/OS}}}{\f4 .CONSOLE}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 .CONSOLE}}}{\f4 driver. +\par +\par +\par }\pard\plain \s21\qj\nowidctlpar\widctlpar\adjustright \b\f4\cgrid {Stack Usage}{\pard\plain \s21\qj\nowidctlpar\widctlpar\adjustright \b\v\f4\cgrid {\tc {{\*\bkmkstart _Toc364074585}Stack Usage{\*\bkmkend _Toc364074585}\tcl1}}}{ +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \f12\cgrid {\f4 +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 Stack}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 Stack}}}{\f4 space is at a premium on the Apple II}{\f4\fs20 GS}{\f4 . Process stacks can only be located in Bank 0}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 Bank 0}}}{\f4 - a total of 64K. This theoretical limit doesn't apply, however, as GS/OS}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GS/OS}}}{\f4 and other bits of system software reserve a large chunk of this without any way to reclaim it. There is approximately 48K of usable stack}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 stack}}}{\f4 space. This space also has to be shared with direct page}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 direct page}}}{\f4 space for Tools}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 Tools}}}{\f4 and certain types of device drivers}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 device drivers}}}{\f4 , however. For a program to be GNO compliant}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GNO compliant}}}{\f4 , stack}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 stack}}}{\f4 usage analysis must be done and acted upon. Use of the stack}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 stack}}}{\f4 should be minimized so that many processes can coexist peacefully. From experience we've found that 1K usually suffices for well-written C applications, and at a maximum 4K can be allocated. +\par +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 Assembly}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 Assembly}}}{\f4 language programs tend to be very efficient when it comes to use of the stack. The 4K provided by default to applications is usually more than enough for assembly}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 assembly}}}{\f4 language programs. C programs can use up tremendous amounts of stack}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 stack}}}{\f4 space, especially if recursion}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 recursion}}}{\f4 is employed or string manipulation}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 string manipulation}}}{\f4 is done without concern for stack}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 stack}}}{\f4 usage; however, even assembly}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 assembly}}}{\f4 programs can be written poorly and use a lot of stack}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 stack}}}{\f4 space. Below are some hints to keep stack}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 stack}}}{\f4 usage at a minimum. +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 +\par }\pard \qj\fi-720\li900\nowidctlpar\widctlpar\adjustright {\f4 \bullet \tab Avoid use of large local arrays}{\pard\plain \qj\fi-720\li900\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 local arrays}}}{\f4 and character strings}{\pard\plain \qj\fi-720\li900\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 character strings}}}{\f4 . Instead, dynamically allocate large structures such as GS/OS}{\pard\plain \qj\fi-720\li900\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GS/OS}}}{\f4 strings with }{\b\f4 malloc}{\pard\plain \qj\fi-720\li900\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 malloc}}}{\f4 () or the Memory Manager}{\pard\plain \qj\fi-720\li900\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 Memory Manager}}}{\f4 . Alternatively, you can designate such items as }{\f6 'static}{\pard\plain \qj\fi-720\li900\nowidctlpar\widctlpar\adjustright \v\f6\cgrid {\xe {\v\f6 }{\f6 static}}}{\f6 '}{\f4 , which causes the C compiler}{\pard\plain \qj\fi-720\li900\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 C compiler}}}{\f4 to allocate the space for the variable}{\pard\plain \qj\fi-720\li900\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 variable}}}{\f4 from main memory}{\pard\plain \qj\fi-720\li900\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 main memory}}}{\f4 . +\par +\par \bullet \tab Try not to use recursion}{\pard\plain \qj\fi-720\li900\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 recursion}}}{\f4 unless absolutely necessary. All recursive functions can be rewritten using standard loops}{\pard\plain \qj\fi-720\li900\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 standard loops}}}{\f4 and creative programming}{\pard\plain \qj\fi-720\li900\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 creative programming}}}{\f4 . This is a good general programming rule because your program will run faster because setting up stack frames}{\pard\plain \qj\fi-720\li900\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 stack frames}}}{\f4 is expensive in terms of time and memory. +\par +\par \bullet \tab ORCA/C 1.3}{\pard\plain \qj\fi-720\li900\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 ORCA/C 1.3}}}{\f4 (and older) generates 8K of stack}{\pard\plain \qj\fi-720\li900\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 stack}}}{\f4 by default, in case the desktop is started up. Since GNO/ME compliant}{\pard\plain \qj\fi-720\li900\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GNO/ME compliant}}}{\f4 programs generally will not be desktop}{\pard\plain \qj\fi-720\li900\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 desktop}}}{\f4 -based, make sure you judge how much stack your program will require and use the }{\f6 #pragma stacksize}{\pard\plain \qj\fi-720\li900\nowidctlpar\widctlpar\adjustright \v\f6\cgrid {\xe {\v\f6 }{\f6 }{\txe pragma stacksize}}}{\f4 directive to limit how much stack space ORCA/C}{\pard\plain \qj\fi-720\li900\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 ORCA/C}}}{\f4 tries to allocate for your program. Also, since ORCA/C}{\pard\plain \qj\fi-720\li900\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 ORCA/C}}}{\f4 programs don't use the stack given them by GNO/ME}{\pard\plain \qj\fi-720\li900\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GNO/ME}}}{\f4 and GS/OS}{\pard\plain \qj\fi-720\li900\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GS/OS}}}{\f4 , when you link your program include a small (256 bytes) stack segment}{\pard\plain \qj\fi-720\li900\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 stack segment}}}{\f4 . See the utilities sources for examples of this. ORCA/C 2.0}{\pard\plain \qj\fi-720\li900\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 ORCA/C 2.0}}}{\f4 allocates stack via the GS/OS}{\pard\plain \qj\fi-720\li900\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GS/OS}}}{\f4 supported method, so ORCA/C 2.0}{\pard\plain \qj\fi-720\li900\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 ORCA/C 2.0}}}{\f4 programs use exactly the amount of stack specified by }{\f6 #pragma stacksize}{\pard\plain \qj\fi-720\li900\nowidctlpar\widctlpar\adjustright \v\f6\cgrid {\xe {\v\f6 }{\f6 }{\txe pragma stacksize}}}{\f4 . +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 +\par }{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \b\v\f4\cgrid {\tc {\b\f4 }{\f4 {\*\bkmkstart _Toc364074586}.i.Disk I/O{\*\bkmkend _Toc364074586}\tcl1}}}{\f4 Since the Apple IIgs doesn't have coprocessors to manage disk access}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 disk access}}}{\f4 and the serial ports}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 serial ports}}}{\f4 , either of these requires the complete attention of the main 65816 processor}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 65816 processor}}}{\f4 . This can wreak havoc in an environment with slow disks or high-speed serial links, as accessing disks usually results in turning off interrupts for the duration of the access. This situation is lessened considerably with a DMA}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 DMA}}}{\f4 disk controller, such as the Apple High Speed SCSI or CV Technologies RamFAST. But this isn't as bad as it sounds; the IBM PC and Apple Macintosh also suffer from this problem, and the solution is robust programming. Make sure your communications protocol can handle errors where expected data doesn't arrive quite on time, or in full. The best solution would be an add-on card with serial ports}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 serial ports}}}{\f4 and an on-board processor to make sure all serial data was received whether or not the main processor was busy (this is a hint to some enterprising hardware hacker, by the way). +\par +\par Yet another concern for GNO/ME}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GNO/ME}}}{\f4 applications is file sharing. GS/OS}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GS/OS}}}{\f4 provides support for file sharing}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 file sharing}}}{\f4 , but it is up to the application author to use it via the requestAccess}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 requestAccess}}}{\f4 field in the }{\f6 OpenGS}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f6\cgrid {\xe {\v\f6 }{\f6 OpenGS}}}{\f4 call. GS/OS}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GS/OS}}}{\f4 only allows file sharing}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 file sharing}}}{\f4 if all current references to a file (other instances of the file being opened) are read-only. GNO/ME}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GNO/ME}}}{\f4 authors should use read-only access as much as possible. For example, an editor doesn't need write permission when it's initially reading in a file. Note that the }{\b\f4 fopen}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 fopen}}}{\f4 () library routine in ORCA/C 1.2}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 ORCA/C 1.2}}}{\f4 does NOT support read-only mode (even if you open the file with a 'r' specificier), but it does in ORCA/C 1.3}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 ORCA/C 1.3}}}{\f4 and later. +\par +\par +\par }\pard\plain \s21\qj\nowidctlpar\widctlpar\adjustright \b\f4\cgrid {Non-Compliant Applications}{\pard\plain \s21\qj\nowidctlpar\widctlpar\adjustright \b\v\f4\cgrid {\tc {{\*\bkmkstart _Toc364074587}Non-Compliant Applications{\*\bkmkend _Toc364074587}\tcl1}}}{ +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \f12\cgrid {\f4 +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 GNO/ME}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GNO/ME}}}{\f4 wasn't really designed with the intention of making EVERY program you currently run work under GNO/ME; that task would have been impossible. Our main goal was to provide a UNIX}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 UNIX}}}{\f4 -based multitasking environment; that we have done. We made sure as many existing applications as we had time to track and debug worked with GNO/ME}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GNO/ME}}}{\f4 . The current list of compatible and non-compatible applications can be found in the file "RELEASE.NOTES}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 RELEASE.NOTES}}}{\f4 " on the GNO/ME}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GNO/ME}}}{\f4 disk. +\par +\par However, due to the sheer number of applications and authors, there are some programs that just plain don't work; and some that mostly work, except for annoyances such as two cursors appearing, or keyboard characters getting 'lost'. The problem here is that some programs use their own text drivers (since TextTools}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 TextTools}}}{\f4 output was very slow at one time); since GNO/ME doesn't know about these custom drivers, it goes on buffering keyboard characters and displaying the cursor. There is a way, however, to tell GNO/ME about these programs that break GNO/ME's rules. +\par +\par We've defined an auxType}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 auxType}}}{\f4 for S16}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 S16}}}{\f4 and EXE}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 EXE}}}{\f4 files, to allow distinction between programs that are GNO/ME}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GNO/ME}}}{\f4 compliant and those that are not. Setting the auxType}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 auxType}}}{\f4 of an application to $DC00 disables the interrupt driven keyboard buffering and turns off the GNO/ME cursor. Desktop}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 Desktop}}}{\f4 programs use the GNO/ME}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GNO/ME}}}{\f4 keyboard I/O}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 I/O}}}{\f4 via the Event Manager}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 Event Manager}}}{\f4 , and thus should }{\i\f4 not}{\f4 have their auxType}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 auxType}}}{\f4 changed. +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 +\par You can change a program's auxType}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 auxType}}}{\f4 with the following shell command: +\par +\par }{\f6 \tab chtyp}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f6\cgrid {\xe {\v\f6 }{\f6 chtyp}}}{\f6 -a \\$DC00 filename}{\f4 +\par +\par where filename is the name of the application. As more programmers become aware of GNO/ME and work to make their software compatible with it, this will become less of a problem, but for older applications that are unlikely to ever change (like the America OnLine software) $DC00 is a reasonable approach. +\par }{\f4 \sect }\sectd \psz1\linex0\endnhere\titlepg\sectdefaultcl {\headerl \pard\plain \s17\nowidctlpar\widctlpar\tqr\tx10080\adjustright \f12\cgrid {\f5\ul Modifications to GS/OS\tab Chapter 3}{\f5\ul +\par }\pard \s17\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}{\headerr \pard\plain \s17\nowidctlpar\widctlpar\tqr\tx10080\adjustright \f12\cgrid {\f5\ul Chapter }{\f5\ul 3}{\f5\ul \tab }{\f5\ul Modifications to GS/OS}{\f5\ul +\par }\pard \s17\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}\pard\plain \s20\qj\nowidctlpar\widctlpar\adjustright \f4\fs48\cgrid {Chapter 3 +\par }\pard \s20\qj\nowidctlpar\widctlpar\adjustright {Modifications to GS/OS}{\pard\plain \s20\qj\nowidctlpar\widctlpar\adjustright \v\f4\fs48\cgrid {\tc {{\*\bkmkstart _Toc364074588}Modifications to GS/OS{\*\bkmkend _Toc364074588}\tcl1}}}{ +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \f12\cgrid {\f4 +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 +\par +\par The GNO system modifies the behavior of a number of GS/OS call}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GS/OS call}}}{\f4 s in order to allow many programs to execute concurrently, and to effect new features. The changes are done in such a way that old software can take advantage of these new features without modification. Following is a complete description of all the changes made. Each section has details in text, followed by a list of the specific GS/OS}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GS/OS}}}{\f4 or ToolBox}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 ToolBox}}}{\f4 calls affected. +\par +\par +\par }\pard\plain \s21\qj\nowidctlpar\widctlpar\adjustright \b\f4\cgrid {Mutual Exclusion in GS/OS and ToolBox calls}{\pard\plain \s21\qj\nowidctlpar\widctlpar\adjustright \b\v\f4\cgrid {\tc {{\*\bkmkstart _Toc364074589}Mutual Exclusion in GS/OS and ToolBox calls{\*\bkmkend _Toc364074589}\tcl1}}}{ +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \f12\cgrid {\f4 +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 The Apple IIGS was not designed as a multitasking}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 multitasking}}}{\f4 machine, and GS/OS}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GS/OS}}}{\f4 and the Toolbox}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 Toolbox}}}{\f4 reflect this in their design. The most notable problem with making multitasking}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 multitasking}}}{\f4 work on the Apple IIgs is the use of global (common to all processes) information, such as prefixes}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 prefixes}}}{\f4 and direct page}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 direct page}}}{\f4 space for tool sets which includes information like SANE}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 SANE}}}{\f4 results, QuickDraw}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 QuickDraw}}}{\f4 drawing information, etc. In most cases we've corrected these deficiencies by keeping track of such information on a per-process basis, that is, each process has its own copy of the information and changes to it do not affect any other process' information. +\par +\par However, there were many other situations where this could not be done. Therefore, there is a limit of one process at a time inside either GS/OS}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GS/OS}}}{\f4 or the ToolBox}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 ToolBox}}}{\f4 . GNO/ME}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GNO/ME}}}{\f4 automatically enforces this restriction whenever a tool or GS/OS call}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GS/OS call}}}{\f4 is made. +\par +\par The method and details of making GS/OS call}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GS/OS call}}}{\f4 s does not change! The calls listed below have been expanded transparently. There are no new parameters and no new parameter values. In all cases, the corresponding ProDOS-16}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 ProDOS-16}}}{\f4 interface calls are also supported, except ExpandPath}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 ExpandPath}}}{\f4 and other calls which do not exist in ProDOS-16}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 ProDOS-16}}}{\f4 . +\par +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 +\par }\pard\plain \s21\qj\nowidctlpar\widctlpar\adjustright \b\f4\cgrid {Pathnames and Prefixes}{\pard\plain \s21\qj\nowidctlpar\widctlpar\adjustright \b\v\f4\cgrid {\tc {{\*\bkmkstart _Toc364074590}Pathnames and Prefixes{\*\bkmkend _Toc364074590}\tcl1}}}{ +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \f12\cgrid {\f4 +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 Normally under GS/OS}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GS/OS}}}{\f4 there are 32 prefixes}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 prefixes}}}{\f4 , and these are all under control of the current application. GNO/ME}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GNO/ME}}}{\f4 extends this concept to provide each process with it's own copies of all prefixes. When a process modifies one of these prefixes via the GS/OS SetPrefix}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 SetPrefix}}}{\f4 call, it modifies only it's own copy of that prefix- the same numbered prefixes of any other processes are not modified. +\par +\par Pathname processing has been expanded in GNO/ME}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GNO/ME}}}{\f4 . There are now two new special pathname operators that are accepted by any GS/OS call}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GS/OS call}}}{\f4 that takes a pathname parameter: +\par }{ +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\b\f6 .}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f6\cgrid {\xe {\v\f6 }{\b\f6 .}}}{\tab }{\f4 current working directory +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\b\f6 ..}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f6\cgrid {\xe {\v\f6 }{\b\f6 ..}}}{\tab }{\f4 parent directory +\par +\par For example, presume that the current working directory (prefix 0) is }{\f6 /foo/bar/moe}{\f4 . "}{\f6 ./ls}{"}{\f4 refers to the file "}{\f6 /foo/bar/moe/ls}{\f4 ", and since a pathname was specified, this overrides the shell's hash table. "}{\f6 ../ls}{\f4 " refers to "}{\f6 /foo/bar/ls}{\f4 ". The operators can be combined, also, as in "}{\f6 ../../ls}{\f4 " ("}{\f6 /foo/ls}{\f4 "), "}{\f6 ./.././ls}{\f4 " ("}{\f6 /foo/bar/ls}{\f4 "). As you can see, the '.' operator is simply removed and has no effect other than to force a full expansion of the pathname. +\par +\par Shorthand device names (.d2}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 .d2}}}{\f4 , .d5}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 .d5}}}{\f4 , etc) as in ORCA}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 ORCA}}}{\f4 are available only under System Software 6.0 and later. The common pathname operator '}{\b\f4 ~}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 ~}}}{\f4 ' (meaning the home directory) is handled by the shell; if the character appears in a GS/OS call}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GS/OS call}}}{\f4 it is not treated specially.}{ +\par }\pard \qj\nowidctlpar\widctlpar\adjustright { +\par }{\f6 \tab $2004 ChangePath}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f6\cgrid {\xe {\v\f6 }{\f6 ChangePath}}}{\f6 \tab \tab $2006 GetFileInfo}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f6\cgrid {\xe {\v\f6 }{\f6 GetFileInfo}}}{\f6 +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f6 \tab $200B ClearBackupBit}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f6\cgrid {\xe {\v\f6 }{\f6 ClearBackupBit}}}{\f6 \tab $200A GetPrefix}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f6\cgrid {\xe {\f6 GetPrefix}}}{\f6 +\par \tab $2001 Create}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f6\cgrid {\xe {\v\f6 }{\f6 Create}}}{\f6 \tab \tab \tab $2010 Open}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f6\cgrid {\xe {\f6 Open}}}{\f6 +\par \tab $2002 Destroy}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f6\cgrid {\xe {\v\f6 }{\f6 Destroy}}}{\f6 \tab \tab \tab $2005 SetFileInfo}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f6\cgrid {\xe {\f6 SetFileInfo}}}{\f6 +\par \tab $200E ExpandPath}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f6\cgrid {\xe {\v\f6 }{\f6 ExpandPath}}}{\f6 \tab \tab $2009 SetPrefix}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f6\cgrid {\xe {\f6 SetPrefix}}}{\f6 +\par }{ +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\b\f4 +\par }\pard\plain \s21\qj\nowidctlpar\widctlpar\adjustright \b\f4\cgrid {Named prefixes}{\pard\plain \s21\qj\nowidctlpar\widctlpar\adjustright \b\v\f4\cgrid {\tc {{\*\bkmkstart _Toc364074591}Named prefixes{\*\bkmkend _Toc364074591}\tcl1}}}{ +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \f12\cgrid {\f4 +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 In order to allow easy installation and configuration of third-party software into all systems, GNO/ME}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GNO/ME}}}{\f4 provides a feature called named prefixes. These prefixes are defined in the /etc/namespace}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 /etc/namespace}}}{\f4 file. Basically, since all UNIX}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 UNIX}}}{\f4 systems have /bin}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 /bin}}}{\f4 , /usr}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 /usr}}}{\f4 , /etc}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 /etc}}}{\f4 , and other similar standard partitions, but Apple IIgs systems generally do not have these partitions, named prefixes provide a way to simulate the UNIX}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 UNIX}}}{\f4 directories without forcing GNO/ME}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GNO/ME}}}{\f4 users to rename their partitions (an arduous and problem-filled task). +\par +\par Named prefixes are handled by the GNO kernel}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GNO kernel}}}{\f4 in the same GS/OS call}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GS/OS call}}}{\f4 s described in Chapter 3 }{\b\f4 Pathnames and Prefixes}{\f4 . +\par +\par +\par }\pard\plain \s21\qj\nowidctlpar\widctlpar\adjustright \b\f4\cgrid {Open File Tracking}{\pard\plain \s21\qj\nowidctlpar\widctlpar\adjustright \b\v\f4\cgrid {\tc {{\*\bkmkstart _Toc364074592}Open File Tracking{\*\bkmkend _Toc364074592}\tcl1}}}{ +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \f12\cgrid {\f4 +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 Previously, a major problem with the way GS/OS}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GS/OS}}}{\f4 handled open files was that unrelated programs could affect each other's open files. For example, a Desk Accessory (or a background program of any sort) could open a file and have it closed without it's knowledge by the main application program. This presented all kinds of problems for desk accessory authors. Apple presented a partial solution with System Software 5.0.4}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 System Software 5.0.4}}}{\f4 , but it wasn't enough for a true multitasking}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 multitasking}}}{\f4 environment. GNO/ME}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GNO/ME}}}{\f4 keeps track of exactly which process opened which file. It also discontinues the concept of a global File Level}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 File Level}}}{\f4 , opting instead for a per-process File Level}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 File Level}}}{\f4 . Any operations a process performs on a file (opening, closing, etc.) do not affect any other process' files. +\par +\par In addition to this behavior, when a process terminates in any manner all files that it currently has opened will be closed automatically. This prevents problems of the sort where a program under development terminates abnormally, often leaving files open and formerly necessitating a reboot. +\par +\par The Flush}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 Flush}}}{\f4 GS/OS call is not modified in this manner as its effects are basically harmless. +\par The Close}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 Close}}}{\f4 call accepts a refNum}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 refNum}}}{\f4 parameter of 0 (zero), to close all open files. This works the same way under GNO/ME}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GNO/ME}}}{\f4 , except of course that only the files of the process calling Close}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 Close}}}{\f4 are in fact closed. +\par }{ +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f6 \tab $2010 Open}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f6\cgrid {\xe {\f6 Open}}}{\f6 +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f6 \tab $2014 Close}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f6\cgrid {\xe {\f6 Close}}}{\f6 +\par \tab $201B GetLevel}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f6\cgrid {\xe {\f6 GetLevel}}}{\f6 +\par \tab $201A SetLevel}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f6\cgrid {\xe {\f6 SetLevel}}}{\f6 +\par }{ +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\tc {\v\f4 }{\f4 \tcl1}}}{\f4 +\par }\pard\plain \s21\qj\nowidctlpar\widctlpar\adjustright \b\f4\cgrid {Quitting applications +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \f12\cgrid {\f4 +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 The QUIT}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 QUIT}}}{\f4 and QuitGS}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 QuitGS}}}{\f4 calls have been modified to support the GNO/ME}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GNO/ME}}}{\f4 process scheme. Quitting to another application, whether by specifying a pathname or by popping the return stack, is accomplished with }{\b\f4 execve}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 execve}}}{\f4 (2). When there are no entries on the return stack, the process is simply killed. See the }{\i\f4 GS/OS Reference Manual}{\f4 for more details on how the Quit stack works. +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 +\par +\par }\pard\plain \s21\qj\nowidctlpar\widctlpar\adjustright \b\f4\cgrid {Refnums and file descriptors}{\pard\plain \s21\qj\nowidctlpar\widctlpar\adjustright \b\v\f4\cgrid {\tc {{\*\bkmkstart _Toc364074593}Refnums and file descriptors{\*\bkmkend _Toc364074593}\tcl1}}}{ +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \f12\cgrid {\f4 +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 GS/OS}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GS/OS}}}{\f4 tells you about open files in the form of refNum}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 refNum}}}{\f4 s (reference numbers). UNIX}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 UNIX}}}{\f4 's term for the same concept is 'file descriptor}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 file descriptor}}}{\f4 '. From a user's or programmer's view of GNO/ME}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GNO/ME}}}{\f4 , these terms are identical and will be used as such; which one depends on what seems most appropriate in context. +\par +\par For each process, GNO/ME}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GNO/ME}}}{\f4 keeps track of which files that particular process has opened. No other process can directly access a file that another process opened (unless programmed explicitly), because it doesn't have access to any file descriptors other than its own. This is different from GS/OS}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GS/OS}}}{\f4 in that GS/OS}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GS/OS}}}{\f4 allows access to a file even if a program guessed the refNum}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 refNum}}}{\f4 , either deliberately or accidentally. This is one of the aspects of process protection in GNO/ME}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GNO/ME}}}{\f4 . +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 +\par All of the various I/O}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 I/O}}}{\f4 mechanisms that GNO/ME}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GNO/ME}}}{\f4 supports (file}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 file}}}{\f4 s, pipe}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 pipe}}}{\f4 s, and TTY}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 TTY}}}{\f4 s) are handled with the same GS/OS call}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GS/OS call}}}{\f4 s you are familiar with. When you create a pipe}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 pipe}}}{\f4 , for example, you are returned file descriptors which, because of synonymity with refNum}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 refNum}}}{\f4 s, you can use in GS/OS call}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GS/OS call}}}{\f4 s. Not all GS/OS call}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GS/OS call}}}{\f4 s that deal with files are applicable to a particular file descriptor; these are detailed in the sections on pipes and TTY}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 TTY}}}{\f4 s. +\par +\par GNO/ME}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GNO/ME}}}{\f4 sets no limit on the number of files a process may have open at one time. (Most UNIX}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 UNIX}}}{\f4 's have a set limit at 32). +\par }{ +\par }\pard \qj\nowidctlpar\widctlpar\adjustright { +\par }\pard\plain \s21\qj\nowidctlpar\widctlpar\adjustright \b\f4\cgrid {GNO/ME Character Devices}{\pard\plain \s21\qj\nowidctlpar\widctlpar\adjustright \b\v\f4\cgrid {\tc {{\*\bkmkstart _Toc364074594}GNO/ME Character Devices{\*\bkmkend _Toc364074594}\tcl1}}}{ +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \f12\cgrid {\f4 +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 GNO/ME}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GNO/ME}}}{\f4 supports a new range of character device}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 character device}}}{\f4 drivers. These drivers are not installed like normal GS/OS drivers}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GS/OS drivers}}}{\f4 , but they are accessed the same way. There are the following built-in drivers: +\par }{ +\par }\pard \qj\fi-1080\li1080\nowidctlpar\widctlpar\adjustright {\f6 .TTYCO}{\pard\plain \qj\fi-1080\li1080\nowidctlpar\widctlpar\adjustright \v\f6\cgrid {\xe {\v\f6 }{\f6 .TTYCO}}}{\tab }{\f4 This is the GNO/ME}{\pard\plain \qj\fi-1080\li1080\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GNO/ME}}}{\f4 console driver}{\pard\plain \qj\fi-1080\li1080\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 console driver}}}{\f4 . The driver supports the TextTools}{\pard\plain \qj\fi-1080\li1080\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 TextTools}}}{\f4 Pascal control codes}{\pard\plain \qj\fi-1080\li1080\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 Pascal control codes}}}{\f4 , plus a few GNO/ME}{\pard\plain \qj\fi-1080\li1080\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GNO/ME}}}{\f4 -specific ones. These are documented in Chapter 4 }{\b\f4 TextTools Replacement}{\f4 . This driver is highly optimized both through the GS/OS}{\pard\plain \qj\fi-1080\li1080\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GS/OS}}}{\f4 and TextTools}{\pard\plain \qj\fi-1080\li1080\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 TextTools}}}{\f4 interfaces. +\par }\pard \qj\fi-1080\li1080\nowidctlpar\widctlpar\adjustright {\f6 .TTYA[0-9,A-F]}{\pard\plain \qj\fi-1080\li1080\nowidctlpar\widctlpar\adjustright \v\f6\cgrid {\xe {\f6 .TTYA[0-9,A-F]}}}{\f4 +\par }{\f6 .PTYQ[0-9,A-F]}{\pard\plain \qj\fi-1080\li1080\nowidctlpar\widctlpar\adjustright \v\f6\cgrid {\xe {\f6 .PTYQ[0-9,A-F]}}}{ +\par }\pard \qj\fi-1080\li1080\nowidctlpar\widctlpar\adjustright {\tab }{\f4 Pseudo-terminal devices; PTY}{\pard\plain \qj\fi-1080\li1080\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 PTY}}}{\f4 s are used for interprocess communication and in network activities. +\par }\pard \qj\fi-1080\li1080\nowidctlpar\widctlpar\adjustright {\f6 .NULL}{\pard\plain \qj\fi-1080\li1080\nowidctlpar\widctlpar\adjustright \v\f6\cgrid {\xe {\v\f6 }{\f6 .NULL}}}{\tab }{\f4 This driver is a bit bucket. Any data written to it is ignored, and any attempt to read from it results in an end-of-file error ($4C).}{ +\par }\pard \qj\nowidctlpar\widctlpar\adjustright { +\par }{\f4 Just as with GS/OS device}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GS/OS device}}}{\f4 s, these GNO/ME drivers}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GNO/ME drivers}}}{\f4 are accessed with the same Open}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 Open}}}{\f4 , Read}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 Read}}}{\f4 , Write}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 Write}}}{\f4 , and Close}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 Close}}}{\f4 calls that are used on files. Unlike GS/OS character devices}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 character devices}}}{\f4 , the characteristics of GNO/ME drivers}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GNO/ME drivers}}}{\f4 are controlled through the }{\b\f4 ioctl}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 ioctl}}}{\f4 () system call. The GS/OS Device}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GS/OS Device}}}{\f4 calls (like DInfo}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 DInfo}}}{\f4 , DStatus}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 DStatus}}}{\f4 ) are not applicable to GNO/ME drivers}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GNO/ME drivers}}}{\f4 . See the }{\b\f4 ioctl}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 ioctl}}}{\f4 (2) and }{\b\f4 tty}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 tty}}}{\f4 (4) manpage for details. +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 +\par Some GS/OS call}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GS/OS call}}}{\f4 s will return an error when given a refNum}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 refNum}}}{\f4 referring to a GNO/ME character driver or pipe because the concepts simply do not apply. The error returned will be $58 (Not a Block Device), and the calls are as follows: +\par }{ +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f6 \tab $2016 SetMark}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f6\cgrid {\xe {\v\f6 }{\f6 SetMark}}}{\f6 \tab \tab $2017 GetMark}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f6\cgrid {\xe {\f6 GetMark}}}{\f6 +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f6 \tab $2018 SetEOF}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f6\cgrid {\xe {\v\f6 }{\f6 SetEOF}}}{\f6 \tab \tab $2019 GetEOF}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f6\cgrid {\xe {\f6 GetEOF}}}{\f6 +\par \tab $2015 Flush}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f6\cgrid {\xe {\v\f6 }{\f6 Flush}}}{\f6 \tab \tab $201C GetDirEntry}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f6\cgrid {\xe {\f6 GetDirEntry}}}{\f6 +\par }{ +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 GNO/ME loaded drivers (generally for serial communications, but other uses are possible) are configured in the }{\f6 /etc/tty.config}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f6 /etc/tty.config}}}{\f4 file. Each line in }{\f6 /etc/tty.config}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f6 /etc/tty.config}}}{\f4 describes one driver. The format of each line is: +\par }\pard\plain \s18\qj\li720\nowidctlpar\widctlpar\adjustright \f12\cgrid {\f4 filename\tab slot\tab devname +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \f12\cgrid {\f4 +\par }{\b\f4 devname}{\f4 is the name of the device as it will be accessed (e.g. .ttya}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 .ttya}}}{\f4 ). }{\b\f4 slot}{\f4 is the slot in the device table where the device will be accessed from; it may refer to one of the physical expansion slots, as TextTools}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 TextTools}}}{\f4 will use the specified driver when redirecting output to a slot. The }{\b\f4 modem}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 modem}}}{\f4 and }{\b\f4 printer}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 printer}}}{\f4 port drivers}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 port drivers}}}{\f4 are configured for slots 2 and 1, respectively. +\par +\par Pseudo-terminals}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 Pseudo-terminals}}}{\f4 are pre-configured into the kernel. PTYs are discussed further in Chapter 6 }{\b\f4 Psuedo-terminals PTYs}{\f4 . +\par +\par Since .ttyco}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 .ttyco}}}{\f4 and the pseudo-terminals}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 pseudo-terminals}}}{\f4 are pre-configured in the GNO kernel}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GNO kernel}}}{\f4 , entries for these devices do not appear in }{\f6 /etc/tty.config}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f6 /etc/tty.config}}}{\f4 . +\par }{ +\par }\pard \qj\nowidctlpar\widctlpar\adjustright { +\par }\pard\plain \s21\qj\nowidctlpar\widctlpar\adjustright \b\f4\cgrid {Restartability}{\pard\plain \s21\qj\nowidctlpar\widctlpar\adjustright \b\v\f4\cgrid {\tc {{\*\bkmkstart _Toc364074595}Restartability{\*\bkmkend _Toc364074595}\tcl1}}}{ +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \f12\cgrid {\f4 +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 GS/OS}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GS/OS}}}{\f4 supports the concept of program 'restartability}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 restartability}}}{\f4 '. This allows programs which are written in a certain way to remain in memory in a purgeable state so that if they are invoked again, and their memory has not been purged, they can be restarted without any disk access. This greatly increases the speed with which restartable programs can be executed. +\par +\par The ORCA}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 ORCA}}}{\f4 environment specifies whether or not a program is restartable via a flag character in the SYSCMND}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 SYSCMND}}}{\f4 file. The GS/OS}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GS/OS}}}{\f4 standard method, however, is to set the appropriate flags bit in the GS/OS Quit}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 Quit}}}{\f4 call. This is the method that GNO/ME}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GNO/ME}}}{\f4 supports. Provided with the GNO/ME standard library is a routine }{\b\f4 rexit}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 rexit}}}{\f4 (3). }{\b\f4 rexit}{\f4 (3) only works with ORCA/C 2.0}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 ORCA/C 2.0}}}{\f4 .}{\b\f4 rexit}{\f4 (3) works just like the normal C }{\b\f4 exit}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 exit}}}{\f4 () call but it sets the restart flag when calling QuitGS}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 QuitGS}}}{\f4 . +\par +\par The standard ORCA/C 1.3}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 ORCA/C 1.3}}}{\f4 libraries are not restartable, but the ORCA/C 2.0}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 ORCA/C 2.0}}}{\f4 libraries are. +\par +\par +\par }{\b\f4 Miscellaneous}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \b\v\f4\cgrid {\tc {\b\f4 {\*\bkmkstart _Toc364074596}Miscellaneous{\*\bkmkend _Toc364074596}\tcl1}}}{\f4 +\par +\par The following miscellaneous GS/OS call}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GS/OS call}}}{\f4 s have also been modified for GNO/ME}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GNO/ME}}}{\f4 . +\par }{ +\par }\pard \qj\fi-2880\li2880\nowidctlpar\widctlpar\adjustright {\f6 $2027 GetName}{\pard\plain \qj\fi-2880\li2880\nowidctlpar\widctlpar\adjustright \v\f6\cgrid {\xe {\v\f6 }{\f6 GetName}}}{\tab }{\f4 Returns the name on disk of the process. This only returns valid information after an }{\b\f4 execve}{\pard\plain \qj\fi-2880\li2880\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 execve}}}{\f4 (2). +\par }\pard \qj\fi-2880\li2880\nowidctlpar\widctlpar\adjustright {\f6 $2003 OSShutdown}{\pard\plain \qj\fi-2880\li2880\nowidctlpar\widctlpar\adjustright \v\f6\cgrid {\xe {\v\f6 }{\f6 OSShutdown}}}{\tab }{\f4 This call has been modified to kill all processes before performing the actual shutdown operation. +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 +\par }{\page \sect }\sectd \linex0\endnhere\titlepg\sectdefaultcl {\headerl \pard\plain \s17\nowidctlpar\widctlpar\tqr\tx10080\adjustright \f12\cgrid {\f5\ul Modifications to the ToolBox\tab Chapter 4 +\par }\pard \s17\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}{\headerr \pard\plain \s17\nowidctlpar\widctlpar\tqr\tx10080\adjustright \f12\cgrid {\f5\ul Chapter 4\tab Modifications to the ToolBox +\par }\pard \s17\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}{\footerl \pard\plain \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright \f12\cgrid {\ul \tab \tab +\par }\pard \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright {\chpgn +\par }\pard \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}{\footerr \pard\plain \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright \f12\cgrid {\ul \tab \tab +\par }\pard \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright {\tab \tab \chpgn +\par }\pard \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}{\footerf \pard\plain \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright \f12\cgrid {\ul \tab \tab +\par }{\tab \tab \chpgn +\par }\pard \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}\pard\plain \s20\qj\nowidctlpar\widctlpar\adjustright \f4\fs48\cgrid {Chapter 4 +\par }\pard \s20\qj\nowidctlpar\widctlpar\adjustright {Modifications to the ToolBox}{\pard\plain \s20\qj\nowidctlpar\widctlpar\adjustright \v\f4\fs48\cgrid {\tc {{\*\bkmkstart _Toc364074597}Modifications to the ToolBox{\*\bkmkend _Toc364074597}\tcl1}}}{ +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \f12\cgrid {\f4 +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 +\par +\par Several changes have been made to the ToolBox}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 ToolBox}}}{\f4 , the most major of which is the replacement of the entire TextTools}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 TextTools}}}{\f4 tool set. The TextTools}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 TextTools}}}{\f4 were replaced for a number of reasons- better control over text I/O}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 I/O}}}{\f4 , increased speed, and emulation of ORCA}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 ORCA}}}{\f4 's redirection system with as little overhead as possible. Other changes were made to modify the behavior of some tool calls to be more consistent with the idea of a multitasking}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 multitasking}}}{\f4 environment. +\par +\par +\par }\pard\plain \s21\qj\nowidctlpar\widctlpar\adjustright \b\f4\cgrid {TextTools Replacement}{\pard\plain \s21\qj\nowidctlpar\widctlpar\adjustright \b\v\f4\cgrid {\tc {{\*\bkmkstart _Toc364074598}TextTools Replacement{\*\bkmkend _Toc364074598}\tcl1}}}{ +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \f12\cgrid {\f4 +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 The changes to the TextTools}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 TextTools}}}{\f4 have turned it into a much more powerful general I/O}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 I/O}}}{\f4 manager. The TextTools}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 TextTools}}}{\f4 now intrinsically handle pipe}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 pipe}}}{\f4 s and redirection}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 redirection}}}{\f4 , and you can install custom drivers}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 custom drivers}}}{\f4 for TextTools}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 TextTools}}}{\f4 to use. Also, the TextTools}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 TextTools}}}{\f4 have had their old slot-dependence}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 slot-dependence}}}{\f4 removed; the parameter that used to refer to 'slot' in the original texttools calls now refers to a driver number}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 driver number}}}{\f4 . A summary of driver numbers (including those that come pre-installed into GNO) are as follows: +\par +\par }\pard \qj\li720\nowidctlpar\widctlpar\adjustright {\f4 0\tab Null device driver}{\pard\plain \qj\li720\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\f4 Null device driver}}}{\f4 +\par 1\tab serial driver}{\pard\plain \qj\li720\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 serial driver}}}{\f4 (for printer port compatibility) +\par 2\tab serial driver }{\pard\plain \qj\li720\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 serial driver }}}{\f4 (for modem port compatibility) +\par 3\tab console driver}{\pard\plain \qj\li720\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 console driver}}}{\f4 (Pascal-compatible 80-column text screen) +\par 4-5\tab User installed +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 +\par See Chapter 3 }{\b\f4 GNO/ME Character Devices}{\f4 , for information on configuring these drivers. +\par +\par There are also new device types in the TextTools}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 TextTools}}}{\f4 ; the complete list of supported device types and what their slotNum}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 slotNum}}}{\f4 's (from SetInputDevice}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 SetInputDevice}}}{\f4 , SetOutputDevice}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 SetOutputDevice}}}{\f4 , etc) mean is as follows: +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 +\par }\pard \qj\fi-720\li720\nowidctlpar\widctlpar\adjustright {\f4 0\tab Used to be BASIC}{\pard\plain \qj\fi-720\li720\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 BASIC}}}{\f4 text drivers. These are no longer supported under GNO/ME}{\pard\plain \qj\fi-720\li720\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GNO/ME}}}{\f4 , and setting I/O to a basic driver actually selects a Pascal driver}{\pard\plain \qj\fi-720\li720\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 Pascal driver}}}{\f4 . +\par 1\tab Pascal text driver. This is one of the drivers specified in /etc/ttys}{\pard\plain \qj\fi-720\li720\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 /etc/ttys}}}{\f4 or built-in to GNO/ME}{\pard\plain \qj\fi-720\li720\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GNO/ME}}}{\f4 . +\par \tab slotNum: driver number as listed above +\par }\pard \qj\fi-720\li720\nowidctlpar\widctlpar\adjustright {\f4 2\tab RAM-based Driver (documented in }{\i\f4 ToolBox Reference Volume 2}{\f4 ) +\par }\pard \qj\fi-720\li720\nowidctlpar\widctlpar\adjustright {\f4 \tab slotNum}{\pard\plain \qj\fi-720\li720\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 slotNum}}}{\f4 : pointer to the RAM-based driver's jump table +\par 3\tab file redirection +\par \tab slotNum}{\pard\plain \qj\fi-720\li720\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 slotNum}}}{\f4 : refNum}{\pard\plain \qj\fi-720\li720\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 refNum}}}{\f4 (file descriptor}{\pard\plain \qj\fi-720\li720\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 file descriptor}}}{\f4 ) of the file to access through TextTools}{\pard\plain \qj\fi-720\li720\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\f4 TextTools}}}{\f4 +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 +\par The new console driver}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 console driver}}}{\f4 supports all the features of the old 80-column Pascal firmware}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 Pascal firmware}}}{\f4 , and adds a few extensions, with one exception - the codes that switched between 40 and 80 columns modes are not supported. It is not compatible with the GS/OS '}{\f6 .console}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f6\cgrid {\xe {\v\f6 }{\f6 .console}}}{\f4 ' driver. The control codes supported are as follows: +\par +\par }\pard \qj\li720\nowidctlpar\widctlpar\tx1800\tx3600\adjustright {\f4\ul Hex\tab ASCII\tab Action +\par }{\f4 01\tab CTRL-A\tab set cursor to flashing block +\par 02\tab CTRL-B\tab set cursor to flashing underscore +\par 03\tab CTRL-C\tab Begin "Set Text Window" sequence +\par 05\tab CTRL-E\tab Cursor on +\par 06\tab CTRL-F\tab Cursor off +\par 07\tab CTRL-G\tab Perform FlexBeep +\par 08\tab CTRL-H\tab Move left one character +\par 09\tab CTRL-I\tab Tab +\par 0A\tab CTRL-J\tab Move down a line +\par 0B\tab CTRL-K\tab Clear to EOP (end of screen) +\par 0C\tab CTRL-L\tab Clear screen, home cursor +\par 0D\tab CTRL-M\tab Move cursor to left edge of line +\par 0E\tab CTRL-N\tab Normal text +\par 0F\tab CTRL-O\tab Inverse text +\par 11\tab CTRL-Q\tab Insert a blank line at the current cursor position +\par 12\tab CTRL-R\tab Delete the line at the current cursor position. +\par 15\tab CTRL-U\tab Move cursor right one character +\par 16\tab CTRL-V\tab Scroll display down one line +\par 17\tab CTRL-W\tab Scroll display up one line +\par 18\tab CTRL-X\tab Normal text, mousetext off +\par 19\tab CTRL-Y\tab Home cursor +\par 1A\tab CTRL-Z\tab Clear entire line +\par 1B\tab CTRL-[\tab MouseText on +\par 1C\tab CTRL-\\\tab Move cursor one character to the right +\par 1D\tab CTRL-]\tab Clear to end of line +\par 1E\tab CTRL-^\tab Goto XY +\par 1F\tab CTRL-_\tab Move up one line +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 +\par (Note: the }{\i\f4 Apple IIgs Firmware Reference}{\f4 incorrectly has codes 05 and 06 reversed. The codes listed here are correct for both GNO/ME and the Apple IIgs 80-column firmware) +\par +\par FlexBeep}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 FlexBeep}}}{\f4 is a custom beep routine that doesn't turn off interrupts for the duration of the noise as does the default Apple IIgs beep. This means that the beep could sound funny from time to time, but it allows other processes to keep running. We also added two control codes to control what kind of cursor is used. There are two types available as in most text-based software; they are underscore for 'insert' mode, and block for 'overstrike'. You may, of course, use whichever cursor you like. For example, a communications program won't have need of insert mode, so it can leave the choice up to the user. +\par +\par The Set Text Window sequence (begun by a $03 code) works as follows: +\par +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 \tab CTRL-C '[' LEFT RIGHT TOP BOTTOM +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 +\par CTRL-C is of course hex $03, and '[' is the open bracket character ($5B). TOP, BOTTOM, LEFT, and RIGHT are single-byte ASCII values that represent the margin settings. Values for TOP and BOTTOM range from 0 to 23; LEFT and RIGHT range from 0 to 79. TOP must be numerically less than BOTTOM; LEFT must be less than RIGHT. Any impossible settings are ignored, and defaults are used instead. The extra '[' in the sequence helps prevent the screen from becoming confused in the event that random data is printed to the screen. +\par +\par After a successful Set Text Window sequence, only the portion of the screen inside the 'window' will be accessible, and only the window will scroll; any text outside the window is not affected. +\par +\par The cursor blinks at a rate defined by the }{\b\f4 Control Panel/Options/Cursor Flash}{\f4 setting. Far left is no blinking (solid), and far right is extremely fast blinking. +\par +\par }{\f6 ReadLine}{\f4 }{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f6\cgrid {\xe {\v\f6 }{\f6 ReadLine }}}{\f4 ($240C) now sports a complete line editor unlike the old TextTools version. Following is a list of the editor commands. +\par +\par }\pard \qj\fi-2880\li3600\nowidctlpar\widctlpar\adjustright {\f4 EOL}{\pard\plain \qj\fi-2880\li3600\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 EOL}}}{\f4 \tab Terminates input (EOL is a parameter to the _ReadLine call) +\par LEFT-ARROW}{\pard\plain \qj\fi-2880\li3600\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 LEFT-ARROW}}}{\f4 \tab Move cursor to the left +\par RIGHT-ARROW}{\pard\plain \qj\fi-2880\li3600\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 RIGHT-ARROW}}}{\f4 \tab Move cursor to right. Won't go past rightmost character. +\par DELETE}{\pard\plain \qj\fi-2880\li3600\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 DELETE}}}{\f4 \tab Delete the character to the left of the cursor. +\par CTRL-D}{\pard\plain \qj\fi-2880\li3600\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 CTRL-D}}}{\f4 \tab Delete character under the cursor. +\par OA-D}{\pard\plain \qj\fi-2880\li3600\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 OA-D}}}{\f4 \tab Delete character under the cursor. +\par OA-E}{\pard\plain \qj\fi-2880\li3600\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 OA-E}}}{\f4 \tab Toggles between overwrite and insert mode. +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 +\par }{\f6 ReadChar}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f6\cgrid {\xe {\v\f6 }{\f6 ReadChar}}}{\f4 ($220C) has also been changed. The character returned may now contain the key modification flags ($C025) in the upper byte and the character typed in the lower byte. This is still compatible with the old TextTools ReadChar. To get the keyMod flags, call }{\f6 SetInGlobals}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f6\cgrid {\xe {\v\f6 }{\f6 SetInGlobals}}}{\f4 ($090C) and set the upper byte of the AND mask to $FF. Typical parameters for }{\f6 SetInGlobals}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f6 SetInGlobals}}}{\f4 to get this information are: ANDmask = $FF7F, ORmask\~=\~$0000. +\par +\par The default I/O masks}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 I/O masks}}}{\f4 have also been changed. They are now ANDmask}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 ANDmask}}}{\f4 = $00FF, ORmask}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 ORmask}}}{\f4 = $0000. They are set this way to extend the range of data that can be sent through TextTools. GNO/ME Character drivers}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 Character drivers}}}{\f4 do not, like the previous TextTools driver, require the hi-bit to be set. +\par +\par The new TextTools}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 TextTools}}}{\f4 are completely reentrant. This means that any number of processes may be executing TextTools calls at the same time, increasing system performance somewhat. The TextTools}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 TextTools}}}{\f4 are also the only toolset which is not mutexed. +\par +\par The GNO/ME console driver}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 console driver}}}{\f4 also supports flow-control in the form of Control-S and Control-Q. Control-S is used to stop screen output, and Control-Q is used to resume screen output. +\par +\par +\par }\pard\plain \s21\qj\nowidctlpar\widctlpar\adjustright \b\f4\cgrid {SysFailMgr ($1503)}{\pard\plain \s21\qj\nowidctlpar\widctlpar\adjustright \b\v\f4\cgrid {\tc {{\*\bkmkstart _Toc364074599}SysFailMgr ($1503){\*\bkmkend _Toc364074599}\tcl1}}}{ +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \f12\cgrid {\f4 +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 The MiscTool}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 MiscTool}}}{\f4 call SysFailMgr}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 SysFailMgr}}}{\f4 has been modified so that a process calling it is simply killed, instead of causing system operation to stop. This was done because many programs use SysFailMgr}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 SysFailMgr}}}{\f4 when a simple error message would have sufficed. There are, however, some tool and GS/OS errors}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GS/OS errors}}}{\f4 which are truly system failure messages, and these do cause system operation to stop. These errors are as follows: +\par +\par }\pard \qj\li720\nowidctlpar\widctlpar\adjustright {\f6 $0305}{\f4 \tab \tab Damaged heartbeat queue detected +\par }{\f6 $0308}{\f4 \tab \tab Damaged heartbeat queue detected +\par }{\f6 $0681}{\f4 \tab \tab Event queue damaged +\par }{\f6 $0682}{\f4 \tab \tab Queue handle damaged +\par }{\f6 $08FF}{\f4 \tab \tab Unclaimed sound interrupt +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 +\par What the system does after displaying the message is the same as for a system panic}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 system panic}}}{\f4 . +\par +\par +\par }\pard\plain \s21\qj\nowidctlpar\widctlpar\adjustright \b\f4\cgrid {The Resource Manager}{\pard\plain \s21\qj\nowidctlpar\widctlpar\adjustright \b\v\f4\cgrid {\tc {{\*\bkmkstart _Toc364074600}The Resource Manager{\*\bkmkend _Toc364074600}\tcl1}}}{ +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \f12\cgrid {\f4 +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 The Resource Manager}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 Resource Manager}}}{\f4 has been modified in some subtle ways. First, GNO/ME}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GNO/ME}}}{\f4 makes sure that the CurResourceApp}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 CurResourceApp}}}{\f4 value is always correct before a process makes a Resource Manager}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 Resource Manager}}}{\f4 call. Second, all open resource}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 resource}}}{\f4 files are the property of the Kernel. When a GetOpenFileRefnum}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GetOpenFileRefnum}}}{\f4 call is made, a new refnum is }{\b\f4 dup}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 dup}}}{\f4 ()'d to allow the process to access the file. Having the Kernel control resource}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 resource}}}{\f4 files also allows all processes to share SYS.RESOURCES}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 SYS.RESOURCES}}}{\f4 without requiring each process to explicitly open it. +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\tc {\v\f4 }{\f4 \tcl1}}}{\f4 +\par }\pard\plain \s21\qj\nowidctlpar\widctlpar\adjustright \b\f4\cgrid {The Event Manager +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \f12\cgrid {\f4 +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 GNO/ME starts up the Event Manager}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 Event Manager}}}{\f4 so it is always available to the kernel and shell utilities. Changes were made so that the Event Manager }{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 Event Manager }}}{\f4 obtains keystrokes from the GNO/ME console driver}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 console driver}}}{\f4 (.ttyco}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 .ttyco}}}{\f4 ). This allows UNIX}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 UNIX}}}{\f4 -style utilities and desktop applications to share the keyboard in a cooperative manner. This also makes it possible to suspend desktop}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 desktop}}}{\f4 applications; see Chapter 7, }{\b\f4 Suspend NDA}{\f4 . +\par +\par EMStartUp sets the GNO console driver to RAW mode via an }{\b\f4 ioctl}{\f4 () call, to allow the Event Manager to get single keystrokes at a time, and to prevent users from being able to kill the desktop application with ^C or other interrupt characters. The four "GetEvent" routines, GetNextEvent, GetOSEvent, EventAvail, and OSEventAvail now poll the console for input characters instead of using an interrupt handler. +\par +\par +\par }\pard\plain \s21\qj\nowidctlpar\widctlpar\adjustright \b\f4\cgrid {The Control Panel}{\pard\plain \s21\qj\nowidctlpar\widctlpar\adjustright \b\v\f4\cgrid {\tc {{\*\bkmkstart _Toc364074601}The Control Panel{\*\bkmkend _Toc364074601}\tcl1}}}{ +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \f12\cgrid {\f4 +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 In most cases, the CDA}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 CDA}}}{\f4 menu is executed as an interrupt handler. Since the Apple IIgs interrupt handler}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 interrupt handler}}}{\f4 firmware isn't reentrant, task switching is not allowed to occur while the control panel is active. This basically means that all processes grind to a halt. In many ways, however, this is not undesirable. It definitely eases debugging, since a static system is much easier to deal with than a dynamic system. Also, CDA}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 CDA}}}{\f4 s assume they have full control of the text screen; multitasking}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 multitasking}}}{\f4 CDAs would confuse and be confused in terms of output. +\par +\par During the execution of the Control Panel}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 Control Panel}}}{\f4 , the original non-GNO/ME TextTools}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 TextTools}}}{\f4 tool is reinstalled to prevent compatibility problems. Another step, taken to maintain user sanity, makes CDAs run under the kernel's process ID. +\par +\par All the changes were made to two tool calls: }{\f6 SaveAll}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f6\cgrid {\xe {\v\f6 }{\f6 SaveAll}}}{\f4 ($0B05) and }{\f6 RestAll}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f6\cgrid {\xe {\v\f6 }{\f6 RestAll}}}{\f4 ($0C05). +\par +\par }{\f4 +\par +\par }{\f4 +\par }\pard\plain \s21\qj\nowidctlpar\widctlpar\adjustright \b\f4\cgrid {QDStartup($0204)}{\pard\plain \s21\qj\nowidctlpar\widctlpar\adjustright \b\v\f4\cgrid {\tc {{\*\bkmkstart _Toc364074602}QDStartup($0204){\*\bkmkend _Toc364074602}\tcl1}}}{ +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \f12\cgrid {\f4 +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 The }{\f6 QDStartup}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f6\cgrid {\xe {\v\f6 }{\f6 QDStartup}}}{\f4 call has been modified to signal an error and terminate any process that tries to make the call when it's controlling terminal}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 controlling terminal}}}{\f4 is not the Apple IIgs console}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 console}}}{\f4 . This prevents a user on a remote terminal from bringing up a desktop application on the console, an operation he could not escape from and one that would greatly annoy the user at the console. +\par +\par Another change ensures that an attempt to execute two graphics-based applications concurrently will fail; the second process that tries to call QDStartUp is killed and a diagnostic message is displayed on the screen. +\par +\par }{\page \sect }\sectd \linex0\endnhere\titlepg\sectdefaultcl {\headerl \pard\plain \s17\nowidctlpar\widctlpar\tqr\tx10080\adjustright \f12\cgrid {\f5\ul Process Management\tab Chapter 5 +\par }\pard \s17\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}{\headerr \pard\plain \s17\nowidctlpar\widctlpar\tqr\tx10080\adjustright \f12\cgrid {\f5\ul Chapter 5\tab Process Management +\par }\pard \s17\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}{\footerl \pard\plain \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright \f12\cgrid {\ul \tab \tab +\par }\pard \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright {\chpgn +\par }\pard \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}{\footerr \pard\plain \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright \f12\cgrid {\ul \tab \tab +\par }\pard \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright {\tab \tab \chpgn +\par }\pard \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}{\footerf \pard\plain \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright \f12\cgrid {\ul \tab \tab +\par }\pard \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright {\tab \tab \chpgn +\par }\pard \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}\pard\plain \s20\qj\nowidctlpar\widctlpar\adjustright \f4\fs48\cgrid {Chapter 5 +\par }\pard \s20\qj\nowidctlpar\widctlpar\adjustright {Process Management}{\pard\plain \s20\qj\nowidctlpar\widctlpar\adjustright \v\f4\fs48\cgrid {\tc {{\*\bkmkstart _Toc364074603}Process Management{\*\bkmkend _Toc364074603}\tcl1}}}{ +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \f12\cgrid {\f4 +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 +\par +\par Before discussing process management using Kernel calls, it would be wise to define just exactly what we refer to when we say }{\i\f4 process}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\i\f4 process}}}{\f4 . A process}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 process}}}{\f4 is generally considered to be a program in execution. "A program is a passive entity, while a process}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 process}}}{\f4 is an active entity." (Operating Systems Concepts p.73, Silberschatz and Peterson, Addison-Wesley, 1989). The concept of process}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 process}}}{\f4 includes the information a computer needs to execute a program (such as the program counter, register values, etc). +\par +\par In order to execute multiple processes, the operating system (GNO/ME}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GNO/ME}}}{\f4 and GS/OS}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GS/OS}}}{\f4 in this case) has to make decisions about which process to run and when. GNO/ME}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GNO/ME}}}{\f4 supports what is termed }{\i\f4 preemptive multitasking}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\i\f4 preemptive multitasking}}}{\f4 , which means that processes are interrupted after a certain amount of time (their time slice}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 time slice}}}{\f4 ), at which point another process is allowed to run. The changing of machine registers to make the processor execute a different process is called a }{\i\f4 context switch}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\i\f4 context switch}}}{\f4 , and the information the operating system needs to do this is called its }{\i\f4 context}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\i\f4 context}}}{\f4 . The GNO kernel}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GNO kernel}}}{\f4 maintains a list of all active processes, and assigns time slices to each process according to their order in the list. When the kernel has run through all the processes, it starts again at the beginning of the list. This is called }{\i\f4 round-robin scheduling}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\i\f4 round-robin scheduling}}}{\f4 . Under certain circumstances, a process can actually execute longer than its allotted time slice because task switches are not allowed during a GS/OS}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GS/OS}}}{\f4 or ToolBox call}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 ToolBox call}}}{\f4 . In these cases, as soon as the system call}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 system call}}}{\f4 is finished the process is interrupted. +\par +\par Processes can give up the rest of their time slice voluntarily (but not necessarily explicitly) in a number of ways, terminal input being the most common. In this case, the rest of the time slice}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 time slice}}}{\f4 is allocated to the next process in line (to help smooth out scheduling). A process waiting on some event to happen is termed }{\i\f4 blocked}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\i\f4 blocked}}}{\f4 . There are many ways this can happen, and each will be mentioned in its place. +\par +\par An important item to remember is the }{\i\f4 process ID}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\i\f4 process ID}}}{\f4 . This is a number which uniquely identifies a process. The ID is assigned when the process is created, and is made available for reassignment when the process terminates. A great many system call}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 system call}}}{\f4 s require process IDs as input. Do not confuse this with a userID}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 userID}}}{\f4 , which is a system for keeping track of memory allocation by various parts of the system, and is handled (pardon the pun) by the Memory Manager}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 Memory Manager}}}{\f4 tool set. Also, do not confuse Memory Manager userID's with Unix user ID's - numbers which are assigned to the various human users of a multiuser machine. +\par +\par There are two methods for creating new processes: the system call }{\b\f4 fork}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 fork}}}{\f4 () and the library routine }{\b\f4 exec}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 exec}}}{\f4 () (specifics for calling these functions and others is in Appendix A }{\b\f4 Making System Calls}{\f4 ). }{\b\f4 fork}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 fork}}}{\f4 starts up a process which begins execution at an address you specify. }{\b\f4 exec}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 exec}}}{\f4 starts up a process by loading an executable file (S16}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 S16}}}{\f4 or EXE}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 EXE}}}{\f4 ). }{\b\f4 fork}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 fork}}}{\v\f4 ()}{\f4 is used mainly for use inside a specific application, such as running shell built-ins in the background, or setting up independent entities inside a program. Forked processes have some limitations, due to the hardware design of the Apple IIgs. The parent process}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 parent process}}}{\f4 (the process which called fork) must still exist when the children die, either via }{\b\f4 kill}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 kill}}}{\f4 () or by simply exiting. This is because the forked children share the same memory space as the parent; the memory the children execute from is tagged with the parent's userID. If the parent terminated before the children, the children's code would be deallocated and likely overwritten. A second caveat with }{\b\f4 fork}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 fork}}}{\v\f4 ()}{\f4 is the difference between it's UNIX}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 UNIX}}}{\f4 counterpart. UNIX}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 UNIX}}}{\f4 }{\b\f4 fork}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 fork}}}{\v\f4 ()}{\f4 begins executing the child at a point directly after the call to }{\b\f4 fork}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 fork}}}{\v\f4 ()}{\f4 . This cannot be accomplished on the Apple IIgs because virtual memory is required for such an operation; thus the need to specify a }{\b\f4 fork}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 fork}}}{\v\f4 ()}{\f4 child as a C function. Note that an appropriately written assembly language program need not necessarily have these restrictions. When a process is forked, the child process}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 child process}}}{\f4 is given it's own direct page}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 direct page}}}{\f4 and stack space}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 stack space}}}{\f4 under a newly allocated userID}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 userID}}}{\f4 , so that when the child terminates this memory is automatically freed. +\par +\par }{\b\f4 exec}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 exec}}}{\v\f4 ()}{\f4 is used when the process you wish to start is a GS/OS load file (file type S16}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 S16}}}{\f4 and EXE}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 EXE}}}{\f4 ). }{\b\f4 exec}{\f4 follows the procedure outlined in the }{\i\f4 GS/OS Reference Manual}{\f4 for executing a program, and sets up the new program's environment as it expects. After }{\b\f4 exec}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 exec}}}{\v\f4 ()}{\f4 has loaded the program and set up it's environment, the new process is started and }{\b\f4 exec}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 exec}}}{\v\f4 ()}{\f4 returns immediately. +\par +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 Both }{\b\f4 fork}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 fork}}}{\v\f4 ()}{\f4 and }{\b\f4 exec}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 exec}}}{\v\f4 ()}{\f4 return the process ID of the child. The parent may use this process ID to send }{\i\f4 signal}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\i\f4 signal}}}{\i\f4 s}{\f4 to the child, or simply wait for the child to exit with the }{\b\f4 wait}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 wait}}}{\v\f4 ()}{\f4 system call; indeed, this is the most common use. Whenever a child process terminates or is stopped (See Chapter 6 }{\b\f4 Signals}{\f4 ), the kernel creates a packet of information which is then made available to the process' parent. If the parent is currently inside a wait call, the call returns with the information. If the parent is off doing something else, the kernel sends the parent process a }{\f6 SIGCHLD}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f6\cgrid {\xe {\v\f6 }{\f6 SIGCHLD}}}{\f4 signal. The default is to ignore }{\f6 SIGCHLD}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f6\cgrid {\xe {\v\f6 }{\f6 SIGCHLD}}}{\f4 , but a common technique is to install a handler for }{\f6 SIGCHLD}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f6\cgrid {\xe {\v\f6 }{\f6 SIGCHLD}}}{\f4 , and to make a }{\b\f4 wait}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 wait}}}{\v\f4 ()}{\f4 call inside the handler to retrieve the relevant information. +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 +\par }{\b\f4 exec}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 exec}}}{\v\f4 ()}{\f4 is actually implemented as two other system calls: }{\b\f4 fork}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 fork}}}{\v\f4 ()}{\f4 , and one called }{\b\f4 execve}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 execve}}}{\v\f4 ()}{\f4 . }{\b\f4 execve}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 execve}}}{\v\f4 ()}{\f4 loads a program from an executable file, and begins executing it. The current process' memory is deallocated. The shell uses a }{\b\f4 fork}{\f4 ()/}{\b\f4 execve}{\f4 () pair explicitly, so it can set up redirection and handle job control. +\par +\par +\par }\pard\plain \s21\qj\nowidctlpar\widctlpar\adjustright \b\f4\cgrid {Process Table}{\pard\plain \s21\qj\nowidctlpar\widctlpar\adjustright \b\v\f4\cgrid {\tc {{\*\bkmkstart _Toc364074604}Process Table{\*\bkmkend _Toc364074604}\tcl1}}}{ +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \f12\cgrid {\f4 +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 Information about processes is maintained in the process table}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 process table}}}{\f4 , which contains one entry for each possible process (}{\b\f4 NPROC}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 NPROC}}}{\f4 , defined in the C header file <}{\f6 gno/conf.h}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f6\cgrid {\xe {\v\f6 }{\f6 conf.h}}}{\f6 >}{\f4 ). There is other per-process information spread about the kernel, but those are usually used for maintaining compatibility with older software, and thus are not described here. Please note that the data in this section is informational only (e.g. for programs like '}{\b\f4 ps}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 ps}}}{\f4 '). Do not attempt to modify kernel data structures or the GNO Kernel}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GNO Kernel}}}{\f4 will likely respond with a resounding crash. Only 'interesting' fields are documented. +\par +\par Copies of process entries should be obtained by using the Kernel Virtual Memory (KVM}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 KVM}}}{\f4 ) routines (kvm_open}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 kvm_open}}}{\f4 , etc.) These are documented in the electronic manual pages. +\par +\par }{\b\f4 processState}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 processState}}}{\f4 - processes have a state associate with them. The state of the process is a description of what the process is doing. The possible process states (as listed in }{\f6 }{\f4 and described here) are: +\par }\pard \qj\fi-1440\li2160\nowidctlpar\widctlpar\adjustright {\f6 RUNNING}{\pard\plain \qj\fi-1440\li2160\nowidctlpar\widctlpar\adjustright \v\f6\cgrid {\xe {\v\f6 }{\f6 RUNNING}}}{\f4 \tab the process is currently in execution. +\par }{\f6 READY}{\pard\plain \qj\fi-1440\li2160\nowidctlpar\widctlpar\adjustright \v\f6\cgrid {\xe {\v\f6 }{\f6 READY}}}{\f4 \tab the process is not currently executing, but is ready to be executed as soon as it is assigned a time slice. +\par }{\f6 BLOCKED}{\pard\plain \qj\fi-1440\li2160\nowidctlpar\widctlpar\adjustright \v\f6\cgrid {\xe {\v\f6 }{\f6 BLOCKED}}}{\f4 \tab the process is waiting for a slow I/O}{\pard\plain \qj\fi-1440\li2160\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 I/O}}}{\f4 operation to complete (for instance, a read from a TTY}{\pard\plain \qj\fi-1440\li2160\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 TTY}}}{\f4 ). +\par }{\f6 NEW}{\pard\plain \qj\fi-1440\li2160\nowidctlpar\widctlpar\adjustright \v\f6\cgrid {\xe {\v\f6 }{\f6 NEW}}}{\f4 \tab the process has been created, but has not executed yet. +\par }{\f6 SUSPENDED}{\pard\plain \qj\fi-1440\li2160\nowidctlpar\widctlpar\adjustright \v\f6\cgrid {\xe {\v\f6 }{\f6 SUSPENDED}}}{\f4 \tab the process was stopped with SIGSTOP}{\pard\plain \qj\fi-1440\li2160\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 SIGSTOP}}}{\f4 , SIGTSTP}{\pard\plain \qj\fi-1440\li2160\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 SIGTSTP}}}{\f4 , SIGTTIN}{\pard\plain \qj\fi-1440\li2160\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 SIGTTIN}}}{\f4 , or SIGTTOU}{\pard\plain \qj\fi-1440\li2160\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 SIGTTOU}}}{\f4 . +\par }{\f6 WAITING}{\pard\plain \qj\fi-1440\li2160\nowidctlpar\widctlpar\adjustright \v\f6\cgrid {\xe {\v\f6 }{\f6 WAITING}}}{\f4 \tab the process is waiting on a semaphore 'signal}{\pard\plain \qj\fi-1440\li2160\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 signal}}}{\f4 ' operation. Programs waiting for data from a pipe}{\pard\plain \qj\fi-1440\li2160\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 pipe}}}{\f4 have this state. +\par }{\f6 WAITSIGCH}{\pard\plain \qj\fi-1440\li2160\nowidctlpar\widctlpar\adjustright \v\f6\cgrid {\xe {\v\f6 }{\f6 WAITSIGCH}}}{\f4 \tab the process is waiting to receive a SIGCHLD}{\pard\plain \qj\fi-1440\li2160\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 SIGCHLD}}}{\f4 signal. +\par }{\f6 PAUSED}{\pard\plain \qj\fi-1440\li2160\nowidctlpar\widctlpar\adjustright \v\f6\cgrid {\xe {\v\f6 }{\f6 PAUSED}}}{\f4 \tab the process is waiting for any signal. +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 +\par }\pard \qj\fi-1080\li1080\nowidctlpar\widctlpar\adjustright {\b\f4 ttyID}{\pard\plain \qj\fi-1080\li1080\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 ttyID}}}{\f4 \tab the device number of the controlling TTY}{\pard\plain \qj\fi-1080\li1080\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 TTY}}}{\f4 for this process. This is not a GS/OS refnum}{\pard\plain \qj\fi-1080\li1080\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 refnum}}}{\f4 ; rather, it is an index into the kernel's internal character device}{\pard\plain \qj\fi-1080\li1080\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 character device}}}{\f4 table. See below for a mapping of ttyID}{\pard\plain \qj\fi-1080\li1080\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 ttyID}}}{\f4 s to devices. +\par }{\b\f4 ticks}{\pard\plain \qj\fi-1080\li1080\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 ticks}}}{\f4 \tab the number of full ticks this process has executed. If a process gives up it's time slice due to an I/O}{\pard\plain \qj\fi-1080\li1080\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 I/O}}}{\f4 operation, this value is not incremented. A tick is 1/60 second. +\par }{\b\f4 alarmCount}{\pard\plain \qj\fi-1080\li1080\nowidctlpar\widctlpar\adjustright \b\v\f4\cgrid {\xe {\b\f4 alarmCount}}}{\f4 +\par \tab if an }{\b\f4 alarm}{\pard\plain \qj\fi-1080\li1080\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 alarm}}}{\f4 (2) request was made, this is the number of seconds remaining until the process is sent SIGALRM}{\pard\plain \qj\fi-1080\li1080\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 SIGALRM}}}{\f4 . +\par }{\b\f4 openFiles}{\pard\plain \qj\fi-1080\li1080\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 openFiles}}}{\f4 \tab this is a structure which stores information about the files a process has open. See }{\f6 struct ftable}{\pard\plain \qj\fi-1080\li1080\nowidctlpar\widctlpar\adjustright \v\f6\cgrid {\xe {\v\f6 }{\f6 struct ftable}}}{\f4 and }{\f6 struct fdentry}{\pard\plain \qj\fi-1080\li1080\nowidctlpar\widctlpar\adjustright \v\f6\cgrid {\xe {\v\f6 }{\f6 struct fdentry}}}{\f4 in }{\f6 }{\f4 . +\par }{\b\f4 irq_A}{\pard\plain \qj\fi-1080\li1080\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 irq_A}}}{\b\f4 , irq_X}{\pard\plain \qj\fi-1080\li1080\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 irq_X}}}{\b\f4 , irq_Y}{\pard\plain \qj\fi-1080\li1080\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 irq_Y}}}{\b\f4 , irq_S}{\pard\plain \qj\fi-1080\li1080\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 irq_S}}}{\b\f4 , irq_D}{\pard\plain \qj\fi-1080\li1080\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 irq_D}}}{\b\f4 , irq_B}{\pard\plain \qj\fi-1080\li1080\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 irq_B}}}{\b\f4 , irq_P}{\pard\plain \qj\fi-1080\li1080\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 irq_P}}}{\b\f4 , irq_state}{\pard\plain \qj\fi-1080\li1080\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 irq_state}}}{\b\f4 , irq_PC}{\pard\plain \qj\fi-1080\li1080\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 irq_PC}}}{\b\f4 , irq_K}{\pard\plain \qj\fi-1080\li1080\nowidctlpar\widctlpar\adjustright \b\v\f4\cgrid {\xe {\b\f4 irq_K}}}{\f4 +\par \tab Context information for the process. These fields are the values of the 65816 registers}{\pard\plain \qj\fi-1080\li1080\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 65816 registers}}}{\f4 at the last context switch}{\pard\plain \qj\fi-1080\li1080\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 context switch}}}{\f4 . They only truly represent the machine state of the process if the process is not }{\f6 RUNNING}{\pard\plain \qj\fi-1080\li1080\nowidctlpar\widctlpar\adjustright \v\f6\cgrid {\xe {\v\f6 }{\f6 RUNNING}}}{\f4 . +\par }{\b\f4 args}{\pard\plain \qj\fi-1080\li1080\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 args}}}{\f4 \tab a NUL-terminated (C-style) string that contains the command line the process was ivoked with. This string begins with 'BYTEWRKS}{\pard\plain \qj\fi-1080\li1080\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 BYTEWRKS}}}{\f4 ', the shell identifier. +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 +\par For more details and an example of how to investigate process information, look at the source code for 'GNO Snooper CDA}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GNO Snooper CDA}}}{\f4 ' (}{\b\f4 GNOSnooper.c}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 GNOSnooper.c}}}{\f4 ). +\par +\par The value in ttyID can be interpreted as follows: +\par \tab 0 - .null}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\f4 .null}}}{\f4 +\par \tab 1 - .ttya}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\f4 .ttya}}}{\f4 +\par \tab 2 - .ttyb}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\f4 .ttyb}}}{\f4 +\par \tab 3 - .ttyco}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\f4 .ttyco}}}{\f4 +\par \tab 6 - .ptyq0}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 .ptyq0}}}{\f4 \tab pty0 master side +\par \tab 7 - .ttyq0}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 .ttyq0}}}{\f4 \tab pty0 slave side +\par Other values may be appropriate depending on the tty.config}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 tty.config}}}{\f4 file. Namely, 1 and 2 (by default the modem}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 modem}}}{\f4 and printer}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 printer}}}{\f4 port drivers}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 port drivers}}}{\f4 ), and 4 and 5 (unassigned by default) may be assigned to different devices. +\par +\par +\par }\pard\plain \s21\qj\nowidctlpar\widctlpar\adjustright \b\f4\cgrid {Task Switching}{\pard\plain \s21\qj\nowidctlpar\widctlpar\adjustright \b\v\f4\cgrid {\tc {{\*\bkmkstart _Toc364074605}Task Switching{\*\bkmkend _Toc364074605}\tcl1}}}{ +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \f12\cgrid {\f4 +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 As mentioned earlier, user code can often unwittingly initiate a context switch}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 context switch}}}{\f4 by reading from the console (and other miscellaneous things). There are a few situations where this can cause a problem, namely inside interrupt handler}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 interrupt handler}}}{\f4 s. While the kernel makes an attempt to prevent this, it cannot predict every conceivable problem. The kernel attempts to detect and prevent context switches inside interrupt handler}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 interrupt handler}}}{\f4 s by checking for the following situations. +\par +\par \bullet \tab Is the system busy flag non-zero? (the busy flag is located at address }{\f6 $E100FF}{\f4 ). +\par \bullet \tab Is the "No-Compact" flag set? (Located at }{\f6 $E100CB}{\f4 ) +\par \bullet \tab Does the stack pointer point to $0100-$01FF? +\par \bullet \tab Is the interrupt bit in the processor status register set? +\par +\par If any of these conditions are met, a context switch will not take place. This can cause problems in certain circumstances. The basic rule is to avoid making Kernel calls that might cause a context switch}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 context switch}}}{\f4 or change in process state from inside an interrupt handler. This includes the following: +\par +\par reading from the console or acessing a pipe +\par }{\b\f4 wait}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 wait}}}{\f4 (), }{\b\f4 pause}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 pause}}}{\f4 (), }{\b\f4 sigpause}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 sigpause}}}{\f4 (), }{\b\f4 kill}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 kill}}}{\f4 (), }{\b\f4 fork}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 fork}}}{\f4 (), }{\b\f4 execve}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 execve}}}{\f4 (), }{\b\f4 receive}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 receive}}}{\f4 () +\par +\par Calls such as }{\b\f4 send}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 send}}}{\f4 (), however, are okay to use from an interrupt handler}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 interrupt handler}}}{\f4 , and in fact are very useful in such situations. +\par +\par +\par }{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\tc {\v\f4 }{\f4 \tcl1}}}{\f4 +\par +\par }\pard\plain \s21\qj\nowidctlpar\widctlpar\adjustright \b\f4\cgrid {Job Control +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \f12\cgrid {\f4 +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 Job control}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 Job control}}}{\f4 is a feature of the kernel that helps processes orderly share a terminal. It prevents such quandaries as "What happens when two processes try to read from the terminal at the same time?". +\par +\par Job control}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 Job control}}}{\f4 works by assigning related process}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 process}}}{\f4 es to a }{\i\f4 process group}{\f4 .}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\i\f4 process group.}}}{\f4 For example, all of the processes in a pipeline}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 pipeline}}}{\f4 belong to one process group. Terminal device drivers}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 device drivers}}}{\f4 also belong to process groups, and when the process group of a job does not match that of its }{\i\f4 controlling terminal}{\f4 }{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\i\f4 controlling terminal }}}{\f4 the job is said to be in the background}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 background}}}{\f4 . Background}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 Background}}}{\f4 jobs have access to their controlling terminal restricted in certain ways. +\par +\par }\pard \qj\fi-720\li1440\nowidctlpar\widctlpar\adjustright {\f4 \bullet \tab If a background job attempts to read from the terminal, the kernel suspends the process by sending the }{\f6 SIGTTIN}{\pard\plain \qj\fi-720\li1440\nowidctlpar\widctlpar\adjustright \v\f6\cgrid {\xe {\v\f6 }{\f6 SIGTTIN}}}{\f4 signal. +\par \bullet \tab The interrupt signals }{\f6 SIGTSTP}{\pard\plain \qj\fi-720\li1440\nowidctlpar\widctlpar\adjustright \v\f6\cgrid {\xe {\v\f6 }{\f6 SIGTSTP}}}{\f4 and }{\f6 SIGINT}{\pard\plain \qj\fi-720\li1440\nowidctlpar\widctlpar\adjustright \v\f6\cgrid {\xe {\v\f6 }{\f6 SIGINT}}}{\f4 , generated by ^Z}{\pard\plain \qj\fi-720\li1440\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 ^Z}}}{\f4 and ^C}{\pard\plain \qj\fi-720\li1440\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 ^C}}}{\f4 respectively, are sent only to the foregound job. This allows backgrounded jobs to proceed without interruption. +\par \bullet \tab Certain }{\b\f4 ioctl}{\pard\plain \qj\fi-720\li1440\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 ioctl}}}{\f4 () calls cannot be made by a background job; the result is a }{\f6 SIGTTIN}{\pard\plain \qj\fi-720\li1440\nowidctlpar\widctlpar\adjustright \v\f6\cgrid {\xe {\v\f6 }{\f6 SIGTTIN}}}{\f4 signal. +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 +\par Job control is accessed by software through the }{\b\f4 tcnewpgrp}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 tcnewpgrp}}}{\f4 , }{\b\f4 tctpgrp}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 tctpgrp}}}{\f4 , and }{\b\f4 settpgrp}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 settpgrp}}}{\f4 system calls. See the }{\b\f4 JOB CONTROL}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 JOB CONTROL}}}{\f4 (2) and }{\b\f4 ioctl}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 ioctl}}}{\f4 (2) manpages. +\par +\par }{\sect }\sectd \linex0\endnhere\titlepg\sectdefaultcl {\headerl \pard\plain \s17\nowidctlpar\widctlpar\tqr\tx10080\adjustright \f12\cgrid {\f5\ul Interprocess Communication\tab Chapter 6 +\par }\pard \s17\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}{\headerr \pard\plain \s17\nowidctlpar\widctlpar\tqr\tx10080\adjustright \f12\cgrid {\f5\ul Chapter 6\tab Interprocess Communication +\par }\pard \s17\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}{\footerl \pard\plain \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright \f12\cgrid {\ul \tab \tab +\par }\pard \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright {\chpgn +\par }\pard \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}{\footerr \pard\plain \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright \f12\cgrid {\ul \tab \tab +\par }\pard \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright {\tab \tab \chpgn +\par }\pard \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}{\footerf \pard\plain \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright \f12\cgrid {\ul \tab \tab +\par }\pard \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright {\tab \tab \chpgn +\par }\pard \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}\pard\plain \s20\qj\nowidctlpar\widctlpar\adjustright \f4\fs48\cgrid {Chapter 6 +\par }\pard \s20\qj\nowidctlpar\widctlpar\adjustright {Interprocess Communication}{\pard\plain \s20\qj\nowidctlpar\widctlpar\adjustright \v\f4\fs48\cgrid {\tc {{\*\bkmkstart _Toc364074606}Interprocess Communication{\*\bkmkend _Toc364074606}\tcl1}}}{ +\par }\pard\plain \qj\nowidctlpar\widctlpar\tqr\tx10080\adjustright \f12\cgrid {\f4\fs18 \tab "Oh, give me a home where the semaphores roam, and the pipes are not deadlocked all day..."}{\f4\fs14 +\par }\pard \qj\nowidctlpar\widctlpar\tqr\tx10080\adjustright {\f4 \tab }{\f4\fs18 Unknown western hero}{\f4 +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 +\par The term Interprocess Communication}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 Interprocess Communication}}}{\f4 (}{\i\f4 IPC}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\i\f4 IPC}}}{\f4 ) covers a large range of operating system features. Any time a process needs to send information to another process some form of IPC}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 IPC}}}{\f4 is used. The GNO Kernel}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GNO Kernel}}}{\f4 provides several basic types: semaphore}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 semaphore}}}{\f4 s, signal}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 signal}}}{\f4 s, pipe}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 pipe}}}{\f4 s, messages}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 messages}}}{\f4 , ports}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 ports}}}{\f4 , and pseudo-terminals}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 pseudo-terminals}}}{\f4 . These IPC}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 IPC}}}{\f4 mechanisms cover almost every conceivable communication task a program could possibly need to do. +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 +\par +\par }\pard\plain \s21\qj\nowidctlpar\widctlpar\adjustright \b\f4\cgrid {Semaphores}{\pard\plain \s21\qj\nowidctlpar\widctlpar\adjustright \b\v\f4\cgrid {\tc {{\*\bkmkstart _Toc364074607}Semaphores{\*\bkmkend _Toc364074607}\tcl1}}}{ +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \f12\cgrid {\f4 +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 In the days before radio, when two ships wished to communicate with each other to decide who was going first to traverse a channel wide enough only for one, they used multicolored flags called semaphore}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 semaphore}}}{\f4 s. Computer scientists, being great lovers of anachronistic terms, adopted the term and meaning of the word semaphore to create a way for processes to communicate when accessing shared information. +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 GNO/ME}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GNO/ME}}}{\f4 , like other multitasking}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 multitasking}}}{\f4 systems, provides applications with semaphore routines. Semaphore}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 Semaphore}}}{\f4 s sequentialize access to data by concurrently executing process}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 process}}}{\f4 es. You should use semaphore}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 semaphore}}}{\f4 s whenever two or more processes want to access shared information}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 shared information}}}{\f4 . For example, suppose there were three process}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 process}}}{\f4 es, each of which accepted input from user terminals and stored this input into a buffer in memory. Suppose also that there is another process which reads the information out of the buffer and stores it on disk. If one of the processes putting information in the buffer (writer process) was in the middle of storing information in the buffer when a context switch}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 context switch}}}{\f4 occurred, and one of the other processes then accessed the buffer, things would get really confused. Code that accesses the buffer should not be interrupted by another process that manipulates the buffer; this code is called a }{\i\f4 critical section}{\f4 ;}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\i\f4 critical section\;}}}{\f4 in order to operate properly, this code must not be interrupted by any other attempts to access the buffer. +\par +\par To prevent the buffer from becoming corrupted, a semaphore}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 semaphore}}}{\f4 would be employed. As part of it's startup, the application that started up the other processes would also create a semaphore}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 semaphore}}}{\f4 using the }{\b\f4 screate}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 screate}}}{\f4 (2) system call}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 system call}}}{\f4 with a parameter of 1. This number means (among other things) that only one process at a time can enter the critical section}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 critical section}}}{\f4 , and is called the }{\i\f4 count}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\i\f4 count}}}{\f4 . +\par When a process wishes to access the buffer, it makes a }{\b\f4 swait}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 swait}}}{\f4 (2), giving as argument the semaphore number returned by }{\b\f4 screate}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 screate}}}{\v\f4 ()}{\f4 . When it's done with the buffer, it makes an }{\b\f4 ssignal}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 ssignal}}}{\f4 (2) call to indicate this fact. +\par +\par This is what happens when }{\b\f4 swait}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 swait}}}{\v\f4 ()}{\f4 is called: the kernel}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 kernel}}}{\f4 first decrements the count. If the count is then less than zero, the kernel}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 kernel}}}{\f4 suspends the process}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 process}}}{\f4 , because a count of less than zero indicates that another process is already inside a critical section}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 critical section}}}{\f4 . This suspended}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 suspended}}}{\f4 state is called 'waiting' (hence the name of }{\b\f4 swait}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 swait}}}{\v\f4 ()}{\f4 ). Every process that tries to call }{\b\f4 swait}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 swait}}}{\v\f4 ()}{\f4 with count < 0 will be suspended; a queue of all the processes currently waiting on the semaphore}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 semaphore}}}{\f4 is associated with the semaphore}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 semaphore}}}{\f4 . +\par +\par Now, when the process inside the critical section leaves and executes }{\b\f4 ssignal}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 ssignal}}}{\v\f4 ()}{\f4 , the kernel increments the count. If there are processes waiting for the semaphore}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 semaphore}}}{\f4 , the kernel}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 kernel}}}{\f4 chooses one arbitrarily and restarts it. When the process resumes execution at its next time slice, its }{\b\f4 swait}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 swait}}}{\v\f4 ()}{\f4 call will finish executing and it will have exclusive control of the critical section}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 critical section}}}{\f4 . This cycle continues until there are no processes waiting on the semaphore}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 semaphore}}}{\f4 , at which point its count will have returned to 1. +\par +\par When the semaphore}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 semaphore}}}{\f4 is no longer needed, you should dispose of it with the }{\b\f4 sdelete}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 sdelete}}}{\f4 (2) call. This call frees any processes that might be waiting on the semaphore}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 semaphore}}}{\f4 and returns the semaphore}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 semaphore}}}{\f4 to the semaphore pool}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 semaphore pool}}}{\f4 . +\par +\par One must be careful in use of semaphore}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 semaphore}}}{\f4 s or }{\i\f4 deadlock}{\f4 }{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\i\f4 deadlock }}}{\f4 can occur. +\par +\par There are (believe it or not) many situations in everyday programming when you may need semaphores}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 semaphores}}}{\f4 , moreso than real UNIX}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 UNIX}}}{\f4 systems due to the Apple IIgs's lack of virtual memory}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 virtual memory}}}{\f4 . The most common of these is your C or Pascal compiler}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 Pascal compiler}}}{\f4 's stdio library}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 stdio library}}}{\f4 ; these are routines like }{\b\f4 printf}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 printf}}}{\v\f4 ()}{\f4 and }{\b\f4 writeln}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 writeln}}}{\v\f4 ()}{\f4 . In many cases, these libraries use global variables and buffers. If you write a program which forks a child process}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 child process}}}{\f4 that shares program code with the parent process}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 parent process}}}{\f4 (i.e. doesn't }{\b\f4 execve}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 execve}}}{\v\f4 ()}{\f4 to another executable), and that child and the parent both use non-}{\i\f4 reentrant}{\f4 }{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\i\f4 reentrant }}}{\f4 library calls, the library will become confused. In the case of text output routines, this usually results in garbaged output. +\par +\par Other library routines can have more disastrous results. For example, if a parent's }{\b\f4 free}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 free}}}{\f4 () or }{\b\f4 dispose}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 dispose}}}{\f4 () memory management call is interrupted, and the child makes a similar call during this time, the linked lists that the library maintains to keep track of allocated memory could become corrupted, resulting most likely in a program crash. +\par +\par GNO/ME provides }{\i\f4 mutual exclusion}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\i\f4 mutual exclusion}}}{\f4 (i.e., lets a maximum of one process at a time execute the code) automatically around all Toolbox}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 Toolbox}}}{\f4 and GS/OS call}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GS/OS call}}}{\f4 s as described in Chapter 3, and also uses semaphore}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 semaphore}}}{\f4 s internally in many other places. Any budding GNO/ME}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GNO/ME}}}{\f4 programmer is well advised to experiment with semaphore}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 semaphore}}}{\f4 s to get a feel for when and where they should be used. Examples of semaphore}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 semaphore}}}{\f4 use can be found in the sample source code, notably }{\f6 dp.c}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f6\cgrid {\xe {\v\f6 }{\f6 dp.c}}}{\f4 (Dining Philosophers demo) and and }{\f6 pipe*.c}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f6\cgrid {\xe {\v\f6 }{\f6 pipe*.c}}}{\f4 (a sample implementation of pipes written entirely in C). +\par +\par +\par }\pard\plain \s21\qj\nowidctlpar\widctlpar\adjustright \b\f4\cgrid {Signals}{\pard\plain \s21\qj\nowidctlpar\widctlpar\adjustright \b\v\f4\cgrid {\tc {{\*\bkmkstart _Toc364074608}Signals{\*\bkmkend _Toc364074608}\tcl1}}}{ +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \f12\cgrid {\f4 +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 Another method of IPC}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 IPC}}}{\f4 is software signals. Signal}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 Signal}}}{\f4 s are similar to hardware interrupts in that they are asynchronous; that is, a process receiving a signal does not have to be in a special mode, does not have to wait for it. Also like hardware interrupt}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 hardware interrupt}}}{\f4 s, a process can install signal handler}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 signal handler}}}{\f4 s to take special action when a signal arrives. Unlike hardware interrupt}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 hardware interrupt}}}{\f4 s, signals are defined and handled entirely through software. +\par +\par Signals are generally used to tell a process of some event that has occurred. Between the system-defined and user-defined signals, there is a lot of things you can do. GNO/ME currently defines 32 different signal}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 signal}}}{\f4 s. A list of signals and their codes can be found in }{\b\f4 signal}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 signal}}}{\f4 (2) and the header file }{\f6 }{\f4 . +\par +\par There are three types of default actions that occur upon receipt of a signal. The process receiving the signal might be terminated, or stopped; or, the signal might be ignored. The default action of any signal can be changed by a process}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 process}}}{\f4 , with some exceptions. Not all of the defined signals are currently used by GNO/ME}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GNO/ME}}}{\f4 , as some are not applicable to the Apple IIgs, or represent UNIX}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 UNIX}}}{\f4 features not yet implemented in GNO/ME}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GNO/ME}}}{\f4 . Here is a list of the signal}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 signal}}}{\f4 s that are used by GNO/ME}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GNO/ME}}}{\f4 . +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 +\par }\pard \qj\fi-1440\li2160\nowidctlpar\widctlpar\adjustright {\f4 SIGINT}{\pard\plain \qj\fi-1440\li2160\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 SIGINT}}}{\f4 \tab This signal is sent to the foreground job when a user types ^C}{\pard\plain \qj\fi-1440\li2160\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 ^C}}}{\f4 at the terminal keyboard. +\par SIGKILL}{\pard\plain \qj\fi-1440\li2160\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 SIGKILL}}}{\f4 \tab The default action of this signal (termination) cannot be changed. This provides a sure-fire means of stopping an otherwise unstoppable process. +\par SIGPIPE}{\pard\plain \qj\fi-1440\li2160\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 SIGPIPE}}}{\f4 \tab Whenever a process tries to write on a pipe}{\pard\plain \qj\fi-1440\li2160\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 pipe}}}{\f4 with no readers, it is sent this signal. +\par SIGALRM}{\pard\plain \qj\fi-1440\li2160\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 SIGALRM}}}{\f4 \tab SIGALRM}{\pard\plain \qj\fi-1440\li2160\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 SIGALRM}}}{\f4 is sent when an alarm timer expires (counts down to zero). An application can start an alarm timer with the }{\b\f4 alarm}{\pard\plain \qj\fi-1440\li2160\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 alarm}}}{\f4 (2) system call. +\par SIGTERM}{\pard\plain \qj\fi-1440\li2160\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 SIGTERM}}}{\f4 \tab This is the default signal sent by }{\b\f4 kill}{\pard\plain \qj\fi-1440\li2160\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 kill}}}{\f4 (1). Use of this signal allows applications to clean up (delete temporary files, free system resources like semaphores, etc) before terminating at the user's bequest. +\par SIGSTOP}{\pard\plain \qj\fi-1440\li2160\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 SIGSTOP}}}{\f4 \tab This signal is used to stop a process' execution temporarily. Like SIGKILL}{\pard\plain \qj\fi-1440\li2160\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 SIGKILL}}}{\f4 , processes are not allowed to install a handler for this signal. +\par SIGCONT}{\pard\plain \qj\fi-1440\li2160\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 SIGCONT}}}{\f4 \tab To restart a stopped process, send this signal. +\par SIGTSTP}{\pard\plain \qj\fi-1440\li2160\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 SIGTSTP}}}{\f4 \tab This is similar to SIGSTOP}{\pard\plain \qj\fi-1440\li2160\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 SIGSTOP}}}{\f4 , but is sent when the user types ^Z}{\pard\plain \qj\fi-1440\li2160\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 ^Z}}}{\f4 at the keyboard. Unlike SIGSTOP}{\pard\plain \qj\fi-1440\li2160\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 SIGSTOP}}}{\f4 , this signal can be ignored, caught, or blocked. +\par SIGCHLD}{\pard\plain \qj\fi-1440\li2160\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 SIGCHLD}}}{\f4 \tab A process receives this signal whenever a child process is stopped or terminates. }{\b\f4 gsh}{\pard\plain \qj\fi-1440\li2160\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 gsh}}}{\f4 uses this to keep track of jobs, and the wait system call}{\pard\plain \qj\fi-1440\li2160\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 system call}}}{\f4 waits for this signal to arrive before exiting. +\par SIGTTIN}{\pard\plain \qj\fi-1440\li2160\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 SIGTTIN}}}{\f4 \tab This signal also stops a process. It is sent to background}{\pard\plain \qj\fi-1440\li2160\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 background}}}{\f4 jobs that try to get input from the terminal. +\par SIGTTOU}{\pard\plain \qj\fi-1440\li2160\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 SIGTTOU}}}{\f4 \tab Similar to SIGTTIN}{\pard\plain \qj\fi-1440\li2160\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 SIGTTIN}}}{\f4 , but is sent when a background process tries to write to the terminal. This behavior is optional and is by default turned off. +\par SIGUSR1}{\pard\plain \qj\fi-1440\li2160\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 SIGUSR1}}}{\f4 \tab +\par SIGUSR2}{\pard\plain \qj\fi-1440\li2160\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 SIGUSR2}}}{\f4 \tab These two signals are reserved for application authors. Their meaning will change from application to application. +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 +\par As you can see, signals are used by many aspects of the system. For detailed information on what various signal}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 signal}}}{\f4 s mean, consult the appropriate electronic manual page - see }{\b\f4 tty}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 tty}}}{\f4 (4), }{\b\f4 wait}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 wait}}}{\f4 (2), and }{\b\f4 signal}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 signal}}}{\f4 (2). +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 For an example of signal}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 signal}}}{\f4 usage, consider a print spooler}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 print spooler}}}{\f4 . A print spooler takes files that are put in the spool directory on a disk and sends the data in the files to a printer}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 printer}}}{\f4 . There are generally two parts to a print spooler: the }{\i\f4 daemon}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\i\f4 daemon}}}{\f4 , a process that resides in memory and performs the transfer of data to the printer in the background}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 background}}}{\f4 ; and the spooler}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 spooler}}}{\f4 . There can be many different types of spoolers, say one for desktop printing, one for printing source code, etc. To communicate to the daemon}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 daemon}}}{\f4 that they have just placed a new file in the spool directory, the spoolers could send the daemon }{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 daemon }}}{\f4 SIGUSR}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 SIGUSR}}}{\f4 . The daemon will have a handler for SIGUSR}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 SIGUSR}}}{\f4 , and that handler will locate the file and set things up so the print will begin. Note that the actual implementation of the print spooling system in GNO/ME}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GNO/ME}}}{\f4 , }{\b\f4 lpr}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 lpr}}}{\f4 (1) and }{\b\f4 lpd}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 lpd}}}{\f4 (8), is somewhat more complex and uses messages and ports instead of signals. However, an earlier version of the spooler software }{\i\f4 did}{\f4 use signals for communication. +\par +\par Signal}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 Signal}}}{\f4 s should not be sent from inside an interrupt handler}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 interrupt handler}}}{\f4 , nor from inside a GS/OS}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GS/OS}}}{\f4 or Toolbox call}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 Toolbox call}}}{\f4 . Window Manager}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 Window Manager}}}{\f4 update routines are a prime example of code that should not send signals; they are executed as part of a tool call. The GS/OS}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GS/OS}}}{\f4 aspect of this limitation is a little harder to come up against. GS/OS}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GS/OS}}}{\f4 does maintain a software signal facility of it's own, used to notify programs when certain low-level events have occurred. Do not confuse these GS/OS signals}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GS/OS signals}}}{\f4 with GNO/ME signal}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GNO/ME signal}}}{\f4 s, and above all, don't send a GNO/ME signal}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GNO/ME signal}}}{\f4 from a GS/OS signal handler}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GS/OS signal handler}}}{\f4 . +\par +\par When a process receives a signal for which it has installed a handler, what occurs is similar to a context switch}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 context switch}}}{\f4 . The process' context is saved on the stack, and the context is set so that the signal handler}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 signal handler}}}{\f4 routine will be executed. Since the old context is stored on the stack, the signal handler may if it wishes return to some other part of the program. It accomplishes this by setting the stack pointer}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 stack pointer}}}{\f4 to a value saved earlier in the program and jumping to the appropriate place. Jumps like this can be made with C's }{\b\f4 setjmp}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 setjmp}}}{\f4 and }{\b\f4 longjmp}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 longjmp}}}{\f4 functions. The following bit of code demonstrates this ability. +\par +\par }{\f6\fs20 void sighandler(int sig, int code) +\par \{ +\par \tab printf("Got a signal!"); +\par \tab longjmp(jmp_buf); +\par \} +\par +\par void routine(void) +\par \{ +\par \tab signal(SIGUSR,sighandler); +\par \tab if (setjmp(jmp_buf)) \{ +\par \tab \tab printf("Finally done! Sorry for all that...."); +\par \tab \} +\par \tab else \{ while (1) \{ +\par \tab \tab printf("While I wait I will annoy you!"); +\par \tab \tab \} +\par \tab \} +\par \} +\par }{\f4 +\par This program basically prints an annoying message over and over until SIGUSR }{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 SIGUSR }}}{\f4 is received. At that point, the handler prints "Got a Signal!" and jumps back to the part of the if statement that prints an apology. If the signal handler}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 signal handler}}}{\f4 hadn't made the }{\b\f4 longjmp}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 longjmp}}}{\f4 , when the handler exited control would have returned to the exact place in the }{\b\f4 while}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 while}}}{\f4 (1) loop that was interrupted. +\par +\par Similar techniques can be applied in assembly language. +\par +\par +\par }\pard\plain \s21\qj\nowidctlpar\widctlpar\adjustright \b\f4\cgrid {Pipes}{\pard\plain \s21\qj\nowidctlpar\widctlpar\adjustright \b\v\f4\cgrid {\tc {{\*\bkmkstart _Toc364074609}Pipes{\*\bkmkend _Toc364074609}\tcl1}}}{ +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \f12\cgrid {\f4 +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 This third form of IPC}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 IPC}}}{\f4 implemented in GNO/ME}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GNO/ME}}}{\f4 is one of the most powerful features ever put into an operating system. A pipe}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 pipe}}}{\f4 is a conduit for information from one process to another. Pipes are accessed just like regular files; the same GS/OS}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GS/OS}}}{\f4 and ToolBox call}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 ToolBox call}}}{\f4 s currently used to manipulate files are also used to manipulate pipe}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 pipe}}}{\f4 s. When combined with GNO/ME standard I/O}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 I/O}}}{\f4 features, pipe}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 pipe}}}{\f4 s become very powerful indeed. For examples on how to use }{\b\f4 gsh}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 gsh}}}{\f4 to connect applications with pipes, see the }{\i\f4 GNO Shell Reference Manual}{\f4 . +\par +\par Pipe}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 Pipe}}}{\f4 s are uni-directional channels between processes. Pipe}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 Pipe}}}{\f4 s are created with the }{\b\f4 pipe}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 pipe}}}{\f4 (2) system call, which returns two GS/OS refNum}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GS/OS refNum}}}{\f4 s; one for the write end, and one for the read end. An attempt to read from the write end or vice-versa results in an error. +\par +\par Pipe}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 Pipe}}}{\f4 s under GNO/ME}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GNO/ME}}}{\f4 are implemented as a circular buffer of 4096 bytes. Semaphore}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 Semaphore}}}{\f4 s are employed to prevent the buffer from overflowing, and to maintain synchronization between the processes accessing the pipe. This is done by creating two semaphores; their counts indicate how many bytes are available to be read and how many bytes may be written to the buffer (0 and 4096 initially). If an I/O operation on the pipe would result in the buffer being emptied or filled, the calling process is blocked until the data (or space) becomes available. +\par +\par The usual method of setting up a pipeline}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 pipeline}}}{\f4 between processes, used by }{\b\f4 gsh}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 gsh}}}{\f4 and utilities such as script}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 script}}}{\f4 , is to make the }{\b\f4 pipe}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 pipe}}}{\f4 () call and then }{\b\f4 fork}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 fork}}}{\v\f4 ()}{\f4 off the processes to be connected by the pipe}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 pipe}}}{\f4 . +\par +\par }{\f6\fs20 int fd[2]; +\par int testPipe(void) +\par \{ +\par \tab pipe(fd);\tab \tab /* create the pipe */ +\par \tab fork(proc1);\tab /* create the writer process */ +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f6\fs20 \tab fork(proc2);\tab /* create the reader process */ +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f6\fs20 \tab close(fd[1]);\tab /* we don't need the pipe anymore, because */ +\par \tab close(fd[0]);\tab /* the children inherited them */ +\par \tab \{ wait for processes to terminate ... \} +\par \} +\par +\par +\par void proc1(void) +\par \{ +\par \tab dup2(STDOUT_FILENO,fd[1]);\tab /* reset standard output to the write pipe */ +\par \tab close(fd[0]);\tab \tab \tab /* we don't need the read end */ +\par \tab \{ exec writer process ... \} +\par \} +\par void proc2(void) +\par \{ +\par \tab dup2(STDIN_FILENO,fd[0]);\tab /* reset standard input to the pipe */ +\par \tab close(fd[1]);\tab \tab \tab /* we don't need the write end */ +\par \tab \{ exec reader process ... \} +\par \} +\par }{\f4 +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 Recall that when a new process is forked, it inherits all of the open files of it's parent; thus, the two children here inherit not only standard I/O}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 I/O}}}{\f4 but also the pipe. After the forks, the parent process}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 parent process}}}{\f4 closes the pipe and each of the child process}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 child process}}}{\f4 es closes the end of the pipe it doesn't use. This is actually a necessary step because the kernel must know when the reader has terminated in order to also stop the writer (by sending }{\f6 SIGPIPE}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f6\cgrid {\xe {\v\f6 }{\f6 SIGPIPE}}}{\f4 ). Since each open refNum}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 refNum}}}{\f4 to the read end of the pipe is counted as a reader, any unnecessary copies must be closed. +\par +\par For further examples of implementing and programming pipes, see the sample source code for }{\f6 pipe*.c}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f6\cgrid {\xe {\v\f6 }{\f6 pipe*.c}}}{\f6 .}{\f4 +\par +\par }{\f4 +\par }{\f4 +\par }\pard\plain \s21\qj\nowidctlpar\widctlpar\adjustright \b\f4\cgrid {Messages}{\pard\plain \s21\qj\nowidctlpar\widctlpar\adjustright \b\v\f4\cgrid {\tc {{\*\bkmkstart _Toc364074610}Messages{\*\bkmkend _Toc364074610}\tcl1}}}{ +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \f12\cgrid {\f4 +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 GNO's Message IPC}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 IPC}}}{\f4 is borrowed from the XINU Operating System, designed by Douglas Comer. It is a simple way to send a datum (a message) to another process. Messages are 32-bit (4-byte) longwords. +\par +\par The Message IPC}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 IPC}}}{\f4 is centered around two calls, }{\b\f4 send}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 send}}}{\f4 () and }{\b\f4 receive}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 receive}}}{\f4 (). }{\b\f4 send}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 send}}}{\f4 () sends a message to a specified process ID}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 process ID}}}{\f4 . To access that message, a process must use }{\b\f4 receive}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 receive}}}{\f4 (). If no message is waiting for a process when it calls }{\b\f4 receive}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 receive}}}{\f4 (), it is put to sleep until a message becomes available. +\par +\par Since a process can only have one pending message, the Message IPC}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 IPC}}}{\f4 is useful mostly in applications where two or more cooperating processes only occasionally need to signal each other; for example, the }{\b\f4 init}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 init}}}{\f4 (8) program communicates with the Init daemon by sending messages. Various attributes are encoded in the 32-bit value sent to }{\b\f4 init}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 init}}}{\f4 (8) to instruct it on how to change its state. +\par +\par If a process doesn't want to indefinitely block waiting for a message, it can call }{\b\f4 recvtim}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 recvtim}}}{\f4 (). }{\b\f4 recvtim}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 recvtim}}}{\f4 () accepts a timeout parameter which indicates the maximum amount of time to wait for a message. +\par +\par +\par }\pard\plain \s21\qj\nowidctlpar\widctlpar\adjustright \b\f4\cgrid {Ports}{\pard\plain \s21\qj\nowidctlpar\widctlpar\adjustright \b\v\f4\cgrid {\tc {{\*\bkmkstart _Toc364074611}Ports{\*\bkmkend _Toc364074611}\tcl1}}}{ +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \f12\cgrid {\f4 +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 GNO/ME Ports}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 Ports}}}{\f4 IPC}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 IPC}}}{\f4 can be thought of as an extended version of Messages}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 Messages}}}{\f4 . Whereas only one message can be pending at once, a port can contain any number of pending messages (up to a limit defined when an application creates a port). +\par +\par Like Messages, Ports transmit 32-bit values between processes. The calls }{\b\f4 psend}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 psend}}}{\f4 () and }{\b\f4 preceive}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 preceive}}}{\f4 () work similarly to their Message counterparts. +\par +\par A Port is created with the }{\b\f4 pcreate}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 pcreate}}}{\f4 () call. The application specifies the size of the port in this call. When the application is done with the port, it should call }{\b\f4 pdelete}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 pdelete}}}{\f4 () to free up the resources used by the port. +\par +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 One of the most important aspects of ports is the ability to bind a }{\i\f4 name}{\f4 to a port. Whereas many of GNO/ME IPC}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 IPC}}}{\f4 mechanisms require the communicating processes to be related in some way (common children of the same parent, for instance) being able to give a port a name means that totally unrelated processes can communicate. For example, the GNO/ME print spooling system uses a named port for communicating information about the addition of new jobs to the print queue. The printer daemon, }{\b\f4 lpd}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 lpd}}}{\f4 (8), creates a port with a specific name; the name is defined by the author of the print daemon; any application that wishes to have the daemon print a spool file also knows this name. (The standard print daemon uses the name "LPDPrinter"). The name allows an application to find lpd's port regardless of the actual numeric port ID (which might be different from system to system, or even from session to session on the same machine). +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 +\par Names are bound to ports with the }{\b\f4 pbind}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 pbind}}}{\f4 () call. The numeric port ID}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 port ID}}}{\f4 can be obtained by passing a name to }{\b\f4 pgetport}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 pgetport}}}{\f4 (). +\par }\pard\plain \s21\qj\nowidctlpar\widctlpar\adjustright \b\f4\cgrid {\page }{Pseudo-Terminals (PTYs)}{\pard\plain \s21\qj\nowidctlpar\widctlpar\adjustright \b\v\f4\cgrid {\tc {{\*\bkmkstart _Toc364074612}Pseudo-Terminals (PTYs){\*\bkmkend _Toc364074612}\tcl1}}}{ +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \f12\cgrid {\f4 +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 Pseudo-terminals}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 Pseudo-terminals}}}{\f4 are a bi-directional communication channel that can be used to connect two processes (or more correctly, a process group to another process). You may (correctly) ask why two pipes would not do the same thing; the answer is that a lot of modern UNIX}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 UNIX}}}{\f4 software relies on the way the terminal interface works, and thus would malfunction when presented with a pipe as standard input. What PTYs provide is a lot like two pipes, but with a TTY}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 TTY}}}{\f4 interface. +\par +\par PTY}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 PTY}}}{\f4 s can be used in a number of important and exciting applications, such as windowing systems and 'script-driven' interfaces. +\par +\par Windowing systems like the UNIX}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 UNIX}}}{\f4 X-Windows use PTYs to give a process group an interface that looks exactly like a real terminal; however, the 'terminal' in this case is actually a window in a graphics-based system. The program that manages the window ('xterm' in X-Windows) is called the }{\i\f4 master}{\f4 .}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\i\f4 master.}}}{\f4 It is responsible for setting up the PTY}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 PTY}}}{\f4 , and starting up the process with redirection}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 redirection}}}{\f4 (usually a shell) that is to run in the window. The process running in the window is called the }{\i\f4 slave}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\i\f4 slave}}}{\f4 . +\par +\par To allocate a PTY}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 PTY}}}{\f4 , the master opens in turn each PTY device starting with .ptyq0}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 .ptyq0}}}{\f4 . If a PTY is already in use, the open call will return an error (the kernel uses the EXCL }{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 EXCL }}}{\f4 flag internally). When an open succeeds, the master then has exclusive access to that PTY}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 PTY}}}{\f4 . At this point, the master}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 master}}}{\f4 opens the corresponding TTY}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 TTY}}}{\f4 file (.ttyq0}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 .ttyq0}}}{\f4 - .ttyqf}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 .ttyqf}}}{\f4 ), or the slave}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 slave}}}{\f4 device. It then forks off a process, which sets redirection}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 redirection}}}{\f4 up in the normal fashion and then exec}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 exec}}}{\f4 's the program to run on the PTY}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 PTY}}}{\f4 . The following is taken from the source code for the Graphical Shell Interface (GSI) NDA. +\par }{\f6\fs20 initPipe}{\f4 }{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 initPipe }}}{\f4 scans the PTY}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 PTY}}}{\f4 devices, looking for a free one as discussed above. Note that the master}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 master}}}{\f4 side of a PTY}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 PTY}}}{\f4 does _not_ have (by default) a terminal}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 terminal}}}{\f4 interface; it is a very raw device, with only a few ioctl's to be able to send signals and handle other such low-level tasks.}{\f6\fs20 +\par +\par char buffer[1024]; +\par int ptyno, master; +\par +\par int initPipe(void) +\par \{ +\par int cl[2]; +\par struct sgttyb sb; +\par char *ptyname = ".ptyq0"; +\par unsigned i; +\par +\par /* We have to open the master first */ +\par +\par for (i = 0; i < 2; i++) \{ +\par ptyname[5] = intToHex(i); /* generate a PTY name from the index */ +\par master = open(ptyname,O_RDWR); +\par if (master > 0) break; /* successful open */ +\par \} +\par if (master < 1) \{ return -1; \} +\par ptyno = i; +\par pid1 = fork(producer); +\par return 0; +\par \} +\par }{\f4 +\par }{\f6\fs20 producer}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 producer}}}{\f4 () sets up redirection for the shell, and also opens the slave}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 slave}}}{\f4 side of the PTY}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 PTY}}}{\f4 . The slave processes must not have any access whatsoever to the master}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 master}}}{\f4 side of the PTY}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 PTY}}}{\f4 , so }{\b\f4 close}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 close}}}{\f4 (0) is used to close all open files (which includes, at this point, the master PTY}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 PTY}}}{\f4 file descriptor}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 file descriptor}}}{\f4 from initPipe}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 initPipe}}}{\f4 ). Note that as in many pipe applications, the file descriptor that will be assigned to a newly opened file is assumed, and that can be safely done in this case because it is clear that with no files open the next file descriptor will be 1. +\par +\par }{\f6\fs20 /* the shell is executed here */ +\par #pragma databank 1 +\par void producer(void) +\par \{ +\par char *ptyname = ".ttyq0"; +\par +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f6\fs20 \tab /* we must not have access to ANY other ttys */ +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f6\fs20 \tab close(0); /* close ALL open files */ +\par \tab ptyname[5] = intToHex(ptyno); +\par \tab /* modify the tty slave name to correspond to the master */ +\par \tab slave = open(ptyname,O_RDWR); /* file descriptor 1 */ +\par \tab dup(slave); /* fd 2 */ +\par \tab dup(slave); /* fd 3 */ +\par \tab SetOutputDevice(3,2l); /* Set up the TextTools redirection */ +\par \tab SetErrorDevice(3,3l); +\par \tab SetInputDevice(3,1l); +\par \tab WriteCString("Welcome to GNO GSI\\r\\n"); +\par \tab execve(":bin:gsh","gsh -f"); +\par \tab /* If we get here, we were unable to run the shell */ +\par \tab printf("Could not locate :bin:gsh : %d",errno); +\par \} +\par #pragma databank 0 +\par +\par consume}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 consume}}}{\f6\fs20 () }{\f4 is called as part of GSI's event loop. It simply checks to see if there is any data for the master by using the FIONREAD}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 FIONREAD}}}{\f4 ioctl}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 ioctl}}}{\f4 , one of the few ioctl}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 ioctl}}}{\f4 's supported by the master}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 master}}}{\f4 side. See PTY}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 PTY}}}{\f4 (4) for details. Any data that is available is sent to the window via a routine toOut}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 toOut}}}{\f4 , which inserts the new data into a TextEdit record.}{\f6\fs20 +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f6\fs20 +\par void consume(CtlRecHndl teH) +\par \{ +\par char ch; +\par int fio,fio1,i; +\par +\par ioctl(master,FIONREAD,&fio); +\par if (fio) \{ +\par \tab if (fio > 256) fio = 256; +\par \tab fio1 = read(master,buffer,fio); +\par \tab buffer[fio] = 0; +\par \tab toOut(buffer,fio,teH); +\par \tab updateWind1(fio,fio1); +\par \} +\par \} +\par +\par }{\f4 \page }{\f4 When the user types a key, the keypress is sent to the slave by simply writing the data with a write call. +\par +\par }{\f6\fs20 void writedata(char k) +\par \{ +\par write(master, &k, 1); +\par \} +\par }{\f4 +\par When the user is done with the window and closes it, GSI}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GSI}}}{\f4 closes the master end of the PTY}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 PTY}}}{\f4 . +\par +\par }{\f6\fs20 void closePipe(void) +\par \{ +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f6\fs20 int cl[2]; +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f6\fs20 +\par close(master); +\par \} +\par }{\f4 +\par When this is done, the slave }{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 slave }}}{\f4 process }{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 process }}}{\f4 receives a SIGHUP }{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 SIGHUP }}}{\f4 signal, to indicate that the connection was lost. Since the standard behavior of SIGHUP }{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 SIGHUP }}}{\f4 is to terminate the process, the slave }{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 slave }}}{\f4 dies and either the slave }{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 slave }}}{\f4 or the kernel }{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 kernel }}}{\f4 closes the slave }{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 slave }}}{\f4 end. At this point, the PTY }{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 PTY }}}{\f4 is available for re-use by another application. +\par +\par As you can see, PTY}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 PTY}}}{\f4 s are very simple to program and use. The simplicity can be misleading, for PTY}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 PTY}}}{\f4 s are a very powerful method of IPC}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 IPC}}}{\f4 . As another example of the use of PTY}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 PTY}}}{\f4 s, we point out that PTYs can be used to drive programs with 'script}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 script}}}{\f4 s'. These scripts are a series of 'wait-for' and 'print' operations, much like auto-logon macros in communications programs such as ProTERM. Script-driving a program can be used to automate testing or use of an application. +\par +\par PTY}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 PTY}}}{\f4 s can be used to test software that would normally work over a regular terminal (such as a modem). Since PTYs are identical (to the slave) to terminals, the application being tested doesn't know the difference. What this means to the programmer is incredible power and flexibility in testing the application. For example, a communications program could be nearly completely tested without ever dialing to another computer with a modem! +\par +\par There are so many applications of PTY}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 PTY}}}{\f4 s that to attempt to discuss them all here would be impossible; as PTYs are discovered by more GNO/ME programmers we expect that more useful PTY}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 PTY}}}{\f4 applications will become available. +\par +\par }\pard\plain \s21\qj\nowidctlpar\widctlpar\adjustright \b\f4\cgrid {Deadlock}{\pard\plain \s21\qj\nowidctlpar\widctlpar\adjustright \b\v\f4\cgrid {\tc {{\*\bkmkstart _Toc364074613}Deadlock{\*\bkmkend _Toc364074613}\tcl1}}}{ +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \f12\cgrid {\f4 +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 With interprocess communication comes the problem of }{\i\f4 deadlock}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\i\f4 deadlock}}}{\f4 . If a situation arises where two or more processes are all waiting for an signal }{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 signal }}}{\f4 from one of the other waiting processes, the processes are said to be deadlocked. +\par +\par The best way to explain deadlock }{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 deadlock }}}{\f4 is to give an example. Suppose that two processes are connected with two pipes so that they can communicate bidirectionally. Also suppose that each of the pipes are full, and that when each process writes into one of the pipes they are blocked. Both processes are blocked waiting for the other to unblock them. +\par +\par There is no way for the operating system to detect every conceivable deadlock condition without expending large amounts of CPU time. Thus, the only way to recover from a deadlock }{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 deadlock }}}{\f4 is to kill }{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 kill }}}{\f4 the processes in question. Responsibility for preventing deadlock }{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 deadlock }}}{\f4 situations is placed on the programmer. Fortunately, situations where deadlock can occur are infrequent; however, you should keep an eye out for them and try to work around them when they do occur. +\par }{\sect }\sectd \linex0\endnhere\titlepg\sectdefaultcl {\headerl \pard\plain \s17\nowidctlpar\widctlpar\tqr\tx10080\adjustright \f12\cgrid {\f5\ul Miscellaneous Programming Issues\tab Appendix B +\par }\pard \s17\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}{\headerr \pard\plain \s17\nowidctlpar\widctlpar\tqr\tx10080\adjustright \f12\cgrid {\f5\ul Appendix B\tab Miscellaneous Programming Issues +\par }\pard \s17\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}{\footerl \pard\plain \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright \f12\cgrid {\ul \tab \tab +\par }\pard \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright {\chpgn +\par }\pard \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}{\footerr \pard\plain \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright \f12\cgrid {\ul \tab \tab +\par }\pard \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright {\tab \tab \chpgn +\par }\pard \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}{\footerf \pard\plain \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright \f12\cgrid {\ul \tab \tab +\par }\pard \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright {\tab \tab \chpgn +\par }\pard \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}\pard\plain \s20\qj\nowidctlpar\widctlpar\adjustright \f4\fs48\cgrid {Appendix A +\par }\pard \s20\qj\nowidctlpar\widctlpar\adjustright {Making System Calls}{\pard\plain \s20\qj\nowidctlpar\widctlpar\adjustright \v\f4\fs48\cgrid {\tc {{\*\bkmkstart _Toc364074614}Making System Calls{\*\bkmkend _Toc364074614}\tcl1}}}{ +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \f12\cgrid {\f4 +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 +\par +\par The GNO Kernel}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GNO Kernel}}}{\f4 is accessed through system call}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 system call}}}{\f4 s. The actual procedure is very simple from C: simply #include}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 }{\txe include}}}{\f4 the appropriate header file as noted in the synopsis of the call's manual page, and call it as you would any other C function. From assembly language the procedure is no more difficult, using the advanced macros provided for the APW}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 APW}}}{\f4 and ORCA}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 ORCA}}}{\f4 assemblers. Make sure, however, that you have defined a word variable }{\b\f4 errno}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 errno}}}{\f4 . Lowercase is important, use the 'case on' and 'case off' directives to ensure that the definition of }{\b\f4 errno}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 errno}}}{\f4 is case-sensitive. The system call interface libraries store any error codes returned by the kernel in this variable. +\par +\par If you are going to be accessing the kernel from a language other than those for which interfaces are provided, then the following information is for you. +\par +\par +\par }\pard\plain \s21\qj\nowidctlpar\widctlpar\adjustright \b\f4\cgrid {System Call Interface}{\pard\plain \s21\qj\nowidctlpar\widctlpar\adjustright \b\v\f4\cgrid {\tc {{\*\bkmkstart _Toc364074615}System Call Interface{\*\bkmkend _Toc364074615}\tcl1}}}{ +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \f12\cgrid {\f4 +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 The system calls}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 system calls}}}{\f4 are implemented as a user toolset, tool number 3. These tools are called the same way regular system tools (such as QuickDraw}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 QuickDraw}}}{\f4 ) are called, except that you must JSL }{\f6 $E10008}{\f4 instead of }{\f6 JSL\~$E10000}{\f4 (or }{\f6 $E1000C}{\f4 instead of }{\f6 $E10004}{\f4 for the alternate entry point). The function numbers for the currently defined tools are as follows: +\par +\par }\trowd \trgaph80\trleft-80\trkeep \clvertalt\cltxlrtb \cellx4960\clvertalt\cltxlrtb \cellx10000\pard \qj\li720\nowidctlpar\widctlpar\intbl\tx3960\adjustright {\v\f6 *}{\f6 getpid}{\pard\plain \qj\li720\nowidctlpar\widctlpar\intbl\tx3960\adjustright \v\f6\cgrid {\xe {\v\f6 }{\f6 getpid}}}{\f6 \tab $0903\cell kill}{\pard\plain \qj\li720\nowidctlpar\widctlpar\intbl\tx3960\adjustright \v\f6\cgrid {\xe {\v\f6 }{\f6 kill}}}{\f6 \tab $0A03\cell }\pard \nowidctlpar\widctlpar\intbl\adjustright {\f6 \row }\trowd \trgaph80\trleft-80\trkeep \clvertalt\cltxlrtb \cellx4960\clvertalt\cltxlrtb \cellx10000\pard \qj\li720\nowidctlpar\widctlpar\intbl\tx3960\adjustright {\f6 fork}{\pard\plain \qj\li720\nowidctlpar\widctlpar\intbl\tx3960\adjustright \v\f6\cgrid {\xe {\v\f6 }{\f6 fork}}}{\f6 \tab $0B03\cell swait}{\pard\plain \qj\li720\nowidctlpar\widctlpar\intbl\tx3960\adjustright \v\f6\cgrid {\xe {\v\f6 }{\f6 swait}}}{\f6 \tab $0D03\cell }\pard \nowidctlpar\widctlpar\intbl\adjustright {\f6 \row }\pard \qj\li720\nowidctlpar\widctlpar\intbl\tx3960\adjustright {\f6 ssignal}{\pard\plain \qj\li720\nowidctlpar\widctlpar\intbl\tx3960\adjustright \v\f6\cgrid {\xe {\v\f6 }{\f6 ssignal}}}{\f6 \tab $0E03\cell }\pard \qj\li720\nowidctlpar\widctlpar\intbl\tx3960\adjustright {\f6 screate}{\pard\plain \qj\li720\nowidctlpar\widctlpar\intbl\tx3960\adjustright \v\f6\cgrid {\xe {\v\f6 }{\f6 screate}}}{\f6 \tab $0F03\cell }\pard \nowidctlpar\widctlpar\intbl\adjustright {\f6 \row }\pard \qj\li720\nowidctlpar\widctlpar\intbl\tx3960\adjustright {\f6 sdelete}{\pard\plain \qj\li720\nowidctlpar\widctlpar\intbl\tx3960\adjustright \v\f6\cgrid {\xe {\v\f6 }{\f6 sdelete}}}{\f6 \tab $1003\cell kvm_open}{\pard\plain \qj\li720\nowidctlpar\widctlpar\intbl\tx3960\adjustright \v\f6\cgrid {\xe {\v\f6 }{\f6 kvm_open}}}{\f6 \tab $1103\cell }\pard \nowidctlpar\widctlpar\intbl\adjustright {\f6 \row }\pard \qj\li720\nowidctlpar\widctlpar\intbl\tx3960\adjustright {\f6 kvm_close}{\pard\plain \qj\li720\nowidctlpar\widctlpar\intbl\tx3960\adjustright \v\f6\cgrid {\xe {\v\f6 }{\f6 kvm_close}}}{\f6 \tab $1203\cell kvm_getproc}{\pard\plain \qj\li720\nowidctlpar\widctlpar\intbl\tx3960\adjustright \v\f6\cgrid {\xe {\v\f6 }{\f6 kvm_getproc}}}{\f6 \tab $1303\cell }\pard \nowidctlpar\widctlpar\intbl\adjustright {\f6 \row }\pard \qj\li720\nowidctlpar\widctlpar\intbl\tx3960\adjustright {\f6 kvm_nextproc}{\pard\plain \qj\li720\nowidctlpar\widctlpar\intbl\tx3960\adjustright \v\f6\cgrid {\xe {\v\f6 }{\f6 kvm_nextproc}}}{\f6 \tab $1403\cell kvm_setproc}{\pard\plain \qj\li720\nowidctlpar\widctlpar\intbl\tx3960\adjustright \v\f6\cgrid {\xe {\v\f6 }{\f6 kvm_setproc}}}{\f6 \tab $1503\cell }\pard \nowidctlpar\widctlpar\intbl\adjustright {\f6 \row }\pard \qj\li720\nowidctlpar\widctlpar\intbl\tx3960\adjustright {\f6 signal}{\pard\plain \qj\li720\nowidctlpar\widctlpar\intbl\tx3960\adjustright \v\f6\cgrid {\xe {\v\f6 }{\f6 signal}}}{\f6 \tab $1603\cell wait}{\pard\plain \qj\li720\nowidctlpar\widctlpar\intbl\tx3960\adjustright \v\f6\cgrid {\xe {\v\f6 }{\f6 wait}}}{\f6 \tab $1703\cell }\pard \nowidctlpar\widctlpar\intbl\adjustright {\f6 \row }\pard \qj\li720\nowidctlpar\widctlpar\intbl\tx3960\adjustright {\f6 tcnewpgrp}{\pard\plain \qj\li720\nowidctlpar\widctlpar\intbl\tx3960\adjustright \v\f6\cgrid {\xe {\v\f6 }{\f6 tcnewpgrp}}}{\f6 \tab $1803\cell settpgrp}{\pard\plain \qj\li720\nowidctlpar\widctlpar\intbl\tx3960\adjustright \v\f6\cgrid {\xe {\v\f6 }{\f6 settpgrp}}}{\f6 \tab $1903\cell }\pard \nowidctlpar\widctlpar\intbl\adjustright {\f6 \row }\pard \qj\li720\nowidctlpar\widctlpar\intbl\tx3960\adjustright {\f6 tctpgrp}{\pard\plain \qj\li720\nowidctlpar\widctlpar\intbl\tx3960\adjustright \v\f6\cgrid {\xe {\v\f6 }{\f6 tctpgrp}}}{\f6 \tab $1A03\cell sigsetmask}{\pard\plain \qj\li720\nowidctlpar\widctlpar\intbl\tx3960\adjustright \v\f6\cgrid {\xe {\v\f6 }{\f6 sigsetmask}}}{\f6 \tab $1B03\cell }\pard \nowidctlpar\widctlpar\intbl\adjustright {\f6 \row }\pard \qj\li720\nowidctlpar\widctlpar\intbl\tx3960\adjustright {\f6 sigblock}{\pard\plain \qj\li720\nowidctlpar\widctlpar\intbl\tx3960\adjustright \v\f6\cgrid {\xe {\v\f6 }{\f6 sigblock}}}{\f6 \tab $1C03\cell execve}{\pard\plain \qj\li720\nowidctlpar\widctlpar\intbl\tx3960\adjustright \v\f6\cgrid {\xe {\v\f6 }{\f6 execve}}}{\f6 \tab $1D03\cell }\pard \nowidctlpar\widctlpar\intbl\adjustright {\f6 \row }\pard \qj\li720\nowidctlpar\widctlpar\intbl\tx3960\adjustright {\f6 alarm}{\pard\plain \qj\li720\nowidctlpar\widctlpar\intbl\tx3960\adjustright \v\f6\cgrid {\xe {\v\f6 }{\f6 alarm}}}{\f6 \tab $1E03\cell }{\v\f6 *}{\f6 setdebug}{\pard\plain \qj\li720\nowidctlpar\widctlpar\intbl\tx3960\adjustright \v\f6\cgrid {\xe {\v\f6 }{\f6 setdebug}}}{\f6 \tab $1F03\cell }\pard \nowidctlpar\widctlpar\intbl\adjustright {\f6 \row }\pard \qj\li720\nowidctlpar\widctlpar\intbl\tx3960\adjustright {\v\f6 *}{\f6 setsystemvector}{\pard\plain \qj\li720\nowidctlpar\widctlpar\intbl\tx3960\adjustright \v\f6\cgrid {\xe {\v\f6 }{\f6 setsystemvector}}}{\f6 \tab $2003\cell sigpause}{\pard\plain \qj\li720\nowidctlpar\widctlpar\intbl\tx3960\adjustright \v\f6\cgrid {\xe {\v\f6 }{\f6 sigpause}}}{\f6 \tab $2103\cell }\pard \nowidctlpar\widctlpar\intbl\adjustright {\f6 \row }\pard \qj\li720\nowidctlpar\widctlpar\intbl\tx3960\adjustright {\f6 dup}{\pard\plain \qj\li720\nowidctlpar\widctlpar\intbl\tx3960\adjustright \v\f6\cgrid {\xe {\v\f6 }{\f6 dup}}}{\f6 \tab $2203\cell dup2}{\pard\plain \qj\li720\nowidctlpar\widctlpar\intbl\tx3960\adjustright \v\f6\cgrid {\xe {\v\f6 }{\f6 dup2}}}{\f6 \tab $2303\cell }\pard \nowidctlpar\widctlpar\intbl\adjustright {\f6 \row }\pard \qj\li720\nowidctlpar\widctlpar\intbl\tx3960\adjustright {\f6 pipe}{\pard\plain \qj\li720\nowidctlpar\widctlpar\intbl\tx3960\adjustright \v\f6\cgrid {\xe {\v\f6 }{\f6 pipe}}}{\f6 \tab $2403\cell getpgrp}{\pard\plain \qj\li720\nowidctlpar\widctlpar\intbl\tx3960\adjustright \v\f6\cgrid {\xe {\v\f6 }{\f6 getpgrp}}}{\f6 \tab $2503\cell }\pard \nowidctlpar\widctlpar\intbl\adjustright {\f6 \row }\pard \qj\li720\nowidctlpar\widctlpar\intbl\tx3960\adjustright {\f6 ioctl}{\pard\plain \qj\li720\nowidctlpar\widctlpar\intbl\tx3960\adjustright \v\f6\cgrid {\xe {\v\f6 }{\f6 ioctl}}}{\f6 \tab $2603\cell stat}{\pard\plain \qj\li720\nowidctlpar\widctlpar\intbl\tx3960\adjustright \v\f6\cgrid {\xe {\v\f6 }{\f6 stat}}}{\f6 \tab $2703\cell }\pard \nowidctlpar\widctlpar\intbl\adjustright {\f6 \row }\pard \qj\li720\nowidctlpar\widctlpar\intbl\tx3960\adjustright {\f6 fstat}{\pard\plain \qj\li720\nowidctlpar\widctlpar\intbl\tx3960\adjustright \v\f6\cgrid {\xe {\v\f6 }{\f6 fstat}}}{\f6 \tab $2803\cell lstat}{\pard\plain \qj\li720\nowidctlpar\widctlpar\intbl\tx3960\adjustright \v\f6\cgrid {\xe {\v\f6 }{\f6 lstat}}}{\f6 \tab $2903\cell }\pard \nowidctlpar\widctlpar\intbl\adjustright {\f6 \row }\pard \qj\li720\nowidctlpar\widctlpar\intbl\tx3960\adjustright {\f6 getuid}{\pard\plain \qj\li720\nowidctlpar\widctlpar\intbl\tx3960\adjustright \v\f6\cgrid {\xe {\v\f6 }{\f6 getuid}}}{\f6 \tab $2A03\cell }\pard \qj\li720\nowidctlpar\widctlpar\intbl\tx3960\adjustright {\f6 getgid}{\pard\plain \qj\li720\nowidctlpar\widctlpar\intbl\tx3960\adjustright \v\f6\cgrid {\xe {\v\f6 }{\f6 getgid}}}{\f6 \tab $2B03\cell }\pard \nowidctlpar\widctlpar\intbl\adjustright {\f6 \row }\pard \qj\li720\nowidctlpar\widctlpar\intbl\tx3960\adjustright {\f6 geteuid}{\pard\plain \qj\li720\nowidctlpar\widctlpar\intbl\tx3960\adjustright \v\f6\cgrid {\xe {\v\f6 }{\f6 geteuid}}}{\f6 \tab $2C03\cell getegid}{\pard\plain \qj\li720\nowidctlpar\widctlpar\intbl\tx3960\adjustright \v\f6\cgrid {\xe {\v\f6 }{\f6 getegid}}}{\f6 \tab $2D03\cell }\pard \nowidctlpar\widctlpar\intbl\adjustright {\f6 \row }\pard \qj\li720\nowidctlpar\widctlpar\intbl\tx3960\adjustright {\f6 setuid}{\pard\plain \qj\li720\nowidctlpar\widctlpar\intbl\tx3960\adjustright \v\f6\cgrid {\xe {\v\f6 }{\f6 setuid}}}{\f6 \tab $2E03\cell setgid}{\pard\plain \qj\li720\nowidctlpar\widctlpar\intbl\tx3960\adjustright \v\f6\cgrid {\xe {\v\f6 }{\f6 setgid}}}{\f6 \tab $2F03\cell }\pard \nowidctlpar\widctlpar\intbl\adjustright {\f6 \row }\pard \qj\li720\nowidctlpar\widctlpar\intbl\tx3960\adjustright {\f6 send}{\pard\plain \qj\li720\nowidctlpar\widctlpar\intbl\tx3960\adjustright \v\f6\cgrid {\xe {\v\f6 }{\f6 send}}}{\f6 \tab $3003\cell receive}{\pard\plain \qj\li720\nowidctlpar\widctlpar\intbl\tx3960\adjustright \v\f6\cgrid {\xe {\v\f6 }{\f6 receive}}}{\f6 \tab $3103\cell }\pard \nowidctlpar\widctlpar\intbl\adjustright {\f6 \row }\pard \qj\li720\nowidctlpar\widctlpar\intbl\tx3960\adjustright {\f6 recvclr}{\pard\plain \qj\li720\nowidctlpar\widctlpar\intbl\tx3960\adjustright \v\f6\cgrid {\xe {\v\f6 }{\f6 recvclr}}}{\f6 \tab $3203\cell recvtim}{\pard\plain \qj\li720\nowidctlpar\widctlpar\intbl\tx3960\adjustright \v\f6\cgrid {\xe {\v\f6 }{\f6 recvtim}}}{\f6 \tab $3303\cell }\pard \nowidctlpar\widctlpar\intbl\adjustright {\f6 \row }\pard \qj\li720\nowidctlpar\widctlpar\intbl\tx3960\adjustright {\f6 setpgrp}{\pard\plain \qj\li720\nowidctlpar\widctlpar\intbl\tx3960\adjustright \v\f6\cgrid {\xe {\v\f6 }{\f6 setpgrp}}}{\f6 \tab $3403\cell times}{\pard\plain \qj\li720\nowidctlpar\widctlpar\intbl\tx3960\adjustright \v\f6\cgrid {\xe {\v\f6 }{\f6 times}}}{\f6 \tab $3503\cell }\pard \nowidctlpar\widctlpar\intbl\adjustright {\f6 \row }\pard \qj\li720\nowidctlpar\widctlpar\intbl\tx3960\adjustright {\f6 pcreate}{\pard\plain \qj\li720\nowidctlpar\widctlpar\intbl\tx3960\adjustright \v\f6\cgrid {\xe {\v\f6 }{\f6 pcreate}}}{\f6 \tab $3603\cell psend}{\pard\plain \qj\li720\nowidctlpar\widctlpar\intbl\tx3960\adjustright \v\f6\cgrid {\xe {\v\f6 }{\f6 psend}}}{\f6 \tab $3703\cell }\pard \nowidctlpar\widctlpar\intbl\adjustright {\f6 \row }\pard \qj\li720\nowidctlpar\widctlpar\intbl\tx3960\adjustright {\f6 preceive}{\pard\plain \qj\li720\nowidctlpar\widctlpar\intbl\tx3960\adjustright \v\f6\cgrid {\xe {\v\f6 }{\f6 preceive}}}{\f6 \tab $3803\cell pdelete}{\pard\plain \qj\li720\nowidctlpar\widctlpar\intbl\tx3960\adjustright \v\f6\cgrid {\xe {\v\f6 }{\f6 pdelete}}}{\f6 \tab $3903\cell }\pard \nowidctlpar\widctlpar\intbl\adjustright {\f6 \row }\pard \qj\li720\nowidctlpar\widctlpar\intbl\tx3960\adjustright {\f6 preset}{\pard\plain \qj\li720\nowidctlpar\widctlpar\intbl\tx3960\adjustright \v\f6\cgrid {\xe {\v\f6 }{\f6 preset}}}{\f6 \tab $3A03\cell pbind}{\pard\plain \qj\li720\nowidctlpar\widctlpar\intbl\tx3960\adjustright \v\f6\cgrid {\xe {\v\f6 }{\f6 pbind}}}{\f6 \tab $3B03\cell }\pard \nowidctlpar\widctlpar\intbl\adjustright {\f6 \row }\pard \qj\li720\nowidctlpar\widctlpar\intbl\tx3960\adjustright {\f6 pgetport}{\pard\plain \qj\li720\nowidctlpar\widctlpar\intbl\tx3960\adjustright \v\f6\cgrid {\xe {\v\f6 }{\f6 pgetport}}}{\f6 \tab $3C03\cell pgetcount}{\pard\plain \qj\li720\nowidctlpar\widctlpar\intbl\tx3960\adjustright \v\f6\cgrid {\xe {\v\f6 }{\f6 pgetcount}}}{\f6 \tab $3D03\cell }\pard \nowidctlpar\widctlpar\intbl\adjustright {\f6 \row }\pard \qj\li720\nowidctlpar\widctlpar\intbl\tx3960\adjustright {\f6 scount}{\pard\plain \qj\li720\nowidctlpar\widctlpar\intbl\tx3960\adjustright \v\f6\cgrid {\xe {\v\f6 }{\f6 scount}}}{\f6 \tab $3E03\cell fork2}{\pard\plain \qj\li720\nowidctlpar\widctlpar\intbl\tx3960\adjustright \v\f6\cgrid {\xe {\v\f6 }{\f6 fork2}}}{\f6 \tab $3F03\cell }\pard \nowidctlpar\widctlpar\intbl\adjustright {\f6 \row }\pard \qj\li720\nowidctlpar\widctlpar\intbl\tx3960\adjustright {\f6 getppid}{\pard\plain \qj\li720\nowidctlpar\widctlpar\intbl\tx3960\adjustright \v\f6\cgrid {\xe {\v\f6 }{\f6 getppid}}}{\f6 \tab $4003\cell SetGNOQuitRec}{\pard\plain \qj\li720\nowidctlpar\widctlpar\intbl\tx3960\adjustright \v\f6\cgrid {\xe {\v\f6 }{\f6 SetGNOQuitRec}}}{\f6 \tab $4103\cell }\pard \nowidctlpar\widctlpar\intbl\adjustright {\f6 \row }\trowd \trgaph80\trleft-80\trkeep \clvertalt\cltxlrtb \cellx4960\clvertalt\cltxlrtb \cellx10000\pard \qj\li720\nowidctlpar\widctlpar\intbl\tx3960\adjustright {\f6 alarm10}{\pard\plain \qj\li720\nowidctlpar\widctlpar\intbl\tx3960\adjustright \v\f6\cgrid {\xe {\v\f6 }{\f6 alarm10}}}{\f6 \tab $4203\cell \cell }\pard \nowidctlpar\widctlpar\intbl\adjustright {\f6 \row }\pard \qj\li720\nowidctlpar\widctlpar\tx3240\adjustright {\f4 +\par }\pard \qj\nowidctlpar\widctlpar\tx3240\adjustright {\f4 Parameters should be pushed onto the stack in the same order as defined by the C prototypes outlines in the synopsis section of the manual pages; that is, left-to-right. In addition to those parameters, all of the functions (except those denoted by a *) take an integer pointer parameter }{\b\f4 ERRNO}{\pard\plain \qj\nowidctlpar\widctlpar\tx3240\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 ERRNO}}}{\f4 . This is a pointer to a word value which will contain the }{\b\f4 errno}{\pard\plain \qj\nowidctlpar\widctlpar\tx3240\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 errno}}}{\f4 code returned by the function if an error occurs, and should be pushed onto the stack after all the other parameters. The calls do not clear this code to 0 if no error occurs; thus, you must check the return value of the function to see if an error occurred, and then check errno to get the actual error code. +\par }\pard \qj\nowidctlpar\widctlpar\tx3240\adjustright {\f4 +\par Do not forget to also push space on the stack}{\pard\plain \qj\nowidctlpar\widctlpar\tx3240\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 stack}}}{\f4 (before the parameters) for the call to store its return value. +\par +\par These low-level system call interfaces are not to be used in general programming. It is assumed the programmer will use the libraries provided, or use this information to create a new library. The system call interface is subject to change without notice; any changes will, of course, be documented in future versions of GNO/ME. +\par +\par +\par }\pard\plain \s21\qj\nowidctlpar\widctlpar\adjustright \b\f4\cgrid {System Call Error Codes}{\pard\plain \s21\qj\nowidctlpar\widctlpar\adjustright \b\v\f4\cgrid {\tc {{\*\bkmkstart _Toc364074616}System Call Error Codes{\*\bkmkend _Toc364074616}\tcl1}}}{ +\par }\pard\plain \qj\nowidctlpar\widctlpar\tx3240\adjustright \f12\cgrid {\f4 +\par }\pard \qj\nowidctlpar\widctlpar\tx3240\adjustright {\f4 The following codes are taken from }{\f6 }{\f4 . The codes up to EPERM}{\pard\plain \qj\nowidctlpar\widctlpar\tx3240\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 EPERM}}}{\f4 are the same values as those defined by ORCA/C}{\pard\plain \qj\nowidctlpar\widctlpar\tx3240\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 ORCA/C}}}{\f4 for compatibility reasons. Error conditions are usually reported by system calls by returning a -1 (word) or NULL (long) value. Which error codes can be expected from a particular call are detailed in the errors section in the appropriate manual page. +\par }\pard \qj\li720\nowidctlpar\widctlpar\tx3240\adjustright {\f4 +\par }\pard \qj\fi-1440\li2160\nowidctlpar\widctlpar\tx3240\adjustright {\f4 EDOM}{\pard\plain \qj\fi-1440\li2160\nowidctlpar\widctlpar\tx3240\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 EDOM}}}{\f4 \tab domain error. Basically an undefined error code. +\par ERANGE}{\pard\plain \qj\fi-1440\li2160\nowidctlpar\widctlpar\tx3240\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 ERANGE}}}{\f4 \tab Range error. A value passed to a system call was too large, too small, or illegal. +\par ENOMEM}{\pard\plain \qj\fi-1440\li2160\nowidctlpar\widctlpar\tx3240\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 ENOMEM}}}{\f4 \tab Not enough memory. The kernel could not allocate enough memory to complete the requested operation. +\par ENOENT}{\pard\plain \qj\fi-1440\li2160\nowidctlpar\widctlpar\tx3240\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 ENOENT}}}{\f4 \tab No such file or directory. The file specified could not be found. +\par EIO}{\pard\plain \qj\fi-1440\li2160\nowidctlpar\widctlpar\tx3240\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 EIO}}}{\f4 \tab I/O error. An error occurred trying to perform an I/O operation (could be bad media). Also refers to a disk error not covered by the other errno codes. +\par EINVAL}{\pard\plain \qj\fi-1440\li2160\nowidctlpar\widctlpar\tx3240\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 EINVAL}}}{\f4 \tab Invalid argument. An argument to a system call was invalid in some way. +\par EBADF}{\pard\plain \qj\fi-1440\li2160\nowidctlpar\widctlpar\tx3240\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 EBADF}}}{\f4 \tab bad file descriptor. The file descriptor passed to the kernel does not represent an open file. +\par EMFILE}{\pard\plain \qj\fi-1440\li2160\nowidctlpar\widctlpar\tx3240\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 EMFILE}}}{\f4 \tab too many files are open. The kernel cannot open any more files for this process; it's open file table is full. Close some other open files to retry the operation. +\par EACCESS}{\pard\plain \qj\fi-1440\li2160\nowidctlpar\widctlpar\tx3240\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 EACCESS}}}{\f4 \tab access bits prevent the operation. One of the access bit settings (delete, rename, read, write) associated with the file does not allow the requested operation. +\par EEXIST}{\pard\plain \qj\fi-1440\li2160\nowidctlpar\widctlpar\tx3240\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 EEXIST}}}{\f4 \tab the file exists. An attempt to create a new file with the same name as an existing file results in this error. +\par ENOSPC}{\pard\plain \qj\fi-1440\li2160\nowidctlpar\widctlpar\tx3240\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 ENOSPC}}}{\f4 \tab No space on device. There is not enough room on the requested device to complete the operation. This is usually indicative of a full disk. +\par EPERM}{\pard\plain \qj\fi-1440\li2160\nowidctlpar\widctlpar\tx3240\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 EPERM}}}{\f4 \tab Not owner. Not yet used in GNO. +\par ESRCH}{\pard\plain \qj\fi-1440\li2160\nowidctlpar\widctlpar\tx3240\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 ESRCH}}}{\f4 \tab No such process. The process ID specified does not refer to an active process. Possibly the process terminated earlier. +\par EINTR}{\pard\plain \qj\fi-1440\li2160\nowidctlpar\widctlpar\tx3240\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 EINTR}}}{\f4 \tab Interrupted system call. Certain system calls can be interrupted by signals. In cases where the user has specified that those calls not be automatically restarted, the call will return this error. +\par E2BIG}{\pard\plain \qj\fi-1440\li2160\nowidctlpar\widctlpar\tx3240\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 E2BIG}}}{\f4 \tab Arg list too long. Too many arguments were specified in an execve calls. +\par ENOEXEC}{\pard\plain \qj\fi-1440\li2160\nowidctlpar\widctlpar\tx3240\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 ENOEXEC}}}{\f4 \tab Exec format error. The file specified is not in an executable format (OMF load file). +\par ECHILD}{\pard\plain \qj\fi-1440\li2160\nowidctlpar\widctlpar\tx3240\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 ECHILD}}}{\f4 \tab No children. This error is returned by }{\b\f4 wait}{\pard\plain \qj\fi-1440\li2160\nowidctlpar\widctlpar\tx3240\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 wait}}}{\f4 (2) when there are no child processes left running. +\par EAGAIN}{\pard\plain \qj\fi-1440\li2160\nowidctlpar\widctlpar\tx3240\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 EAGAIN}}}{\f4 \tab No more processes. The process table is full, the }{\b\f4 fork}{\pard\plain \qj\fi-1440\li2160\nowidctlpar\widctlpar\tx3240\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 fork}}}{\f4 (2) cannot complete. +\par ENOTDIR}{\pard\plain \qj\fi-1440\li2160\nowidctlpar\widctlpar\tx3240\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 ENOTDIR}}}{\f4 \tab Not a directory. One of the elements in a pathname refers to a file which is not a directory. +\par ENOTTY}{\pard\plain \qj\fi-1440\li2160\nowidctlpar\widctlpar\tx3240\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 ENOTTY}}}{\f4 \tab Not a terminal. The file descriptor passed to an }{\b\f4 ioctl}{\pard\plain \qj\fi-1440\li2160\nowidctlpar\widctlpar\tx3240\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 ioctl}}}{\f4 (2) or job control call does not refer to a terminal file. +\par EPIPE}{\pard\plain \qj\fi-1440\li2160\nowidctlpar\widctlpar\tx3240\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 EPIPE}}}{\f4 \tab Broken pipe. If a process attempts to write on a pipe with no readers, and has blocked or ignored SIGPIPE}{\pard\plain \qj\fi-1440\li2160\nowidctlpar\widctlpar\tx3240\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 SIGPIPE}}}{\f4 , this error is returned by the write operation. +\par ESPIPE}{\pard\plain \qj\fi-1440\li2160\nowidctlpar\widctlpar\tx3240\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 ESPIPE}}}{\f4 \tab Illegal seek. Similar to ENOTBLK}{\pard\plain \qj\fi-1440\li2160\nowidctlpar\widctlpar\tx3240\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 ENOTBLK}}}{\f4 , but specific for pipes. +\par ENOTBLK}{\pard\plain \qj\fi-1440\li2160\nowidctlpar\widctlpar\tx3240\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 ENOTBLK}}}{\f4 \tab not a block device. An attempt to perform an operation on a character device that only makes sense on a block device, e.g. creating a file. +\par +\par +\par }\pard\plain \s21\qj\nowidctlpar\widctlpar\adjustright \b\f4\cgrid {System Panics}{\pard\plain \s21\qj\nowidctlpar\widctlpar\adjustright \b\v\f4\cgrid {\tc {{\*\bkmkstart _Toc364074617}System Panics{\*\bkmkend _Toc364074617}\tcl1}}}{ +\par }\pard\plain \qj\nowidctlpar\widctlpar\tx3240\adjustright \f12\cgrid {\f4 +\par }\pard \qj\nowidctlpar\widctlpar\tx3240\adjustright {\f4 In most cases, if the kernel detects an error in operation an appropriate error code is returned by the function in question (GS/OS call}{\pard\plain \qj\nowidctlpar\widctlpar\tx3240\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GS/OS call}}}{\f4 s, ToolBox call}{\pard\plain \qj\nowidctlpar\widctlpar\tx3240\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 ToolBox call}}}{\f4 s, or system call}{\pard\plain \qj\nowidctlpar\widctlpar\tx3240\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 system call}}}{\f4 s as described above). However, there are rare circumstances where the kernel detects what should be an impossible condition. This can happen due to bugs in the kernel, because the kernel was overwritten by a buggy program, or for any number of other reasons. +\par +\par When the kernel}{\pard\plain \qj\nowidctlpar\widctlpar\tx3240\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 kernel}}}{\f4 does come across such an error, system operation cannot continue and what ensues is called a }{\i\f4 system panic}{\pard\plain \qj\nowidctlpar\widctlpar\tx3240\adjustright \v\f4\cgrid {\xe {\v\f4 }{\i\f4 system panic}}}{\f4 . Panics are very easily noticed- the kernel}{\pard\plain \qj\nowidctlpar\widctlpar\tx3240\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 kernel}}}{\f4 will print an error message on the screen and ensure that the text screen is visible, turning off any graphics mode if necessary. The kernel then sets the text and background colors to red on white - a very noticeable condition. At that point, the kernel turns off context switch}{\pard\plain \qj\nowidctlpar\widctlpar\tx3240\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 context switch}}}{\f4 ing to prevent any background process or other interrupt}{\pard\plain \qj\nowidctlpar\widctlpar\tx3240\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 interrupt}}}{\f4 driven code from further confusing the system. This is done mainly to prevent damage to disk directory structures by a bad system. +\par }\pard \qj\nowidctlpar\widctlpar\tx3240\adjustright {\f4 +\par }\pard \qj\nowidctlpar\widctlpar\tx3240\adjustright {\f4 When a system panic}{\pard\plain \qj\nowidctlpar\widctlpar\tx3240\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 system panic}}}{\f4 does occur, the only thing you can do is reboot your system. If you can reliably reproduce a system panic}{\pard\plain \qj\nowidctlpar\widctlpar\tx3240\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 system panic}}}{\f4 , please record the panic message and the sequence of events necessary to evoke the panic and report the information to Procyon, Inc. +\par +\par }\pard\plain \s20\qj\nowidctlpar\widctlpar\adjustright \f4\fs48\cgrid {\page }{Appendix B +\par }\pard \s20\qj\nowidctlpar\widctlpar\adjustright {Miscellaneous Programming Issues}{\pard\plain \s20\qj\nowidctlpar\widctlpar\adjustright \v\f4\fs48\cgrid {\tc {{\*\bkmkstart _Toc364074618}Miscellaneous Programming Issues{\*\bkmkend _Toc364074618}\tcl1}}}{\b +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \f12\cgrid {\f4 +\par +\par +\par }\pard\plain \s21\qj\nowidctlpar\widctlpar\adjustright \b\f4\cgrid {Option Arguments}{\pard\plain \s21\qj\nowidctlpar\widctlpar\adjustright \b\v\f4\cgrid {\tc {{\*\bkmkstart _Toc364074619}Option Arguments{\*\bkmkend _Toc364074619}\tcl1}}}{ +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \f12\cgrid {\f4 +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 The Free Software Foundation (known as the FSF), invented user friendly long format option arguments}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 option arguments}}}{\f4 , and defined the "}{\b\f4 +}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 +}}}{\f4 " character for interpretation that a long format follows. This interpretation is generally followed in the U}{\f4\fs20 NIX}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 UNIX}}}{\f4 community. There are two files which will assist you in programming GNO/ME utilities with both short and long format options, "getopt.h}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 getopt.h}}}{\f4 " for short options}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 short options}}}{\f4 , and "getopt1.h}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 getopt1.h}}}{\f4 " for long options}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 long options}}}{\f4 . +\par }{ +\par }\pard \qj\nowidctlpar\widctlpar\adjustright { +\par }\pard\plain \s21\qj\nowidctlpar\widctlpar\adjustright \b\f4\cgrid {Pathname Expansion}{\pard\plain \s21\qj\nowidctlpar\widctlpar\adjustright \b\v\f4\cgrid {\tc {{\*\bkmkstart _Toc364074620}Pathname Expansion{\*\bkmkend _Toc364074620}\tcl1}}}{ +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \f12\cgrid { +\par }{\f4 Those of you familiar with programming in the ORCA}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 ORCA}}}{\f4 environment should be familiar with the shell calls }{\f6\fs20 InitWildcard}{\f4 }{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 InitWildcard }}}{\f4 and }{\f6\fs20 NextWildcard}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 NextWildcard}}}{\f4 . These shell calls, while supported by }{\b\f4 gsh}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 gsh}}}{\f4 , are no longer necessary. All shell utilities that work with multiple filenames do not need to provide support for file globbing, as this is taken care of transparently to the command.}{ +\par +\par }{\sect }\sectd \linex0\endnhere\titlepg\sectdefaultcl {\headerl \pard\plain \s17\nowidctlpar\widctlpar\tqr\tx10080\adjustright \f12\cgrid {\f5\ul \tab Glossary +\par }\pard \s17\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}{\headerr \pard\plain \s17\nowidctlpar\widctlpar\tqr\tx10080\adjustright \f12\cgrid {\f5\ul Glossary\tab +\par }\pard \s17\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}{\footerl \pard\plain \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright \f12\cgrid {\ul \tab \tab +\par }\pard \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright {\chpgn +\par }\pard \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}{\footerr \pard\plain \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright \f12\cgrid {\ul \tab \tab +\par }\pard \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright {\tab \tab \chpgn +\par }\pard \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}{\footerf \pard\plain \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright \f12\cgrid {\ul \tab \tab +\par }\pard \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright {\tab \tab \chpgn +\par }\pard \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}\pard\plain \s20\qj\nowidctlpar\widctlpar\adjustright \f4\fs48\cgrid {Glossary}{\pard\plain \s20\qj\nowidctlpar\widctlpar\adjustright \v\f4\fs48\cgrid {\tc {{\*\bkmkstart _Toc364074621}Glossary{\*\bkmkend _Toc364074621}\tcl1}}}{ +\par }\pard\plain \fi-2340\li2340\nowidctlpar\widctlpar\adjustright \f12\cgrid {\f4 +\par }\pard \fi-2340\li2340\nowidctlpar\widctlpar\adjustright {\f4 +\par +\par The following terms usually have references in the main text, indicated by italics. +\par }{\b\f4 +\par }{\b\i\f4 Asynchronous}{\f4 \tab An event that may take place at any time. See synchronous. +\par }\pard \qj\fi-2340\li2340\nowidctlpar\widctlpar\adjustright {\b\i\f4 BASIC}{\f4 \tab Beginners All-purpose Symbolic Instruction Code. A simple computer language.}{\b\i\f4\fs28 +\par }\pard \fi-2340\li2340\nowidctlpar\widctlpar\adjustright {\b\i\f4 Blocked}{\b\f4 \tab }{\f4 Refers to a process waiting for some event to occur. Processes can block on terminal I/O, signals, and other IPC and I/O functions.}{\b\f4 +\par }{\b\i\f4 Console}{\b\f4 \tab }{\f4 The terminal which represents the IIGS's keyboard and monitor.}{\b\f4 +\par }{\b\i\f4 Context}{\b\f4 \tab }{\f4 The attributes which define the state of a process. This includes the program counter, stack pointer, and other machine registers (both CPU and other computer hardware).}{\b\f4 +\par }{\b\i\f4 Controlling terminal}{\b\f4 \tab }{\f4 The terminal which 'controls' a process or process group; processes can receive keyboard signals (such as SIGTSTP, or ^Z) only from their controlling terminal.}{\b\f4 +\par }{\b\i\f4 Critical section}{\f4 \tab A piece of code inside which only one process at a time may be allowed to execute. Critical sections are usually protected by semaphores. +\par }{\b\i\f4 Daemon}{\f4 \tab A process that runs in the background and waits to act on an asynchronous event. These can be anything: waiting for a caller on a modem, waiting for spooled files to print, etc. Daemons are usually started at boot time by the }{\b\f4 init}{\f4 (8) process. +\par }{\b\i\f4 Deadlock}{\f4 \tab A situation where two or more communicating processes are blocked, waiting on each other. See Chapter 5, "Deadlock". +\par }{\b\i\f4 Errno}{\b\f4 \tab }{\f4 A variable which holds a descriptive numeric error code, returned from C libraries and system calls.}{\b\f4 +\par }{\b\i\f4 Foobar \{foo, bar\}}{\f4 \tab foobar derives from an old military acronym FUBAR. In it's politest interpretation it stands for Fouled Up Beyond All Recognition. Computer scientists borrowed the term and created foobar. When a name for an object is needed but the name itself is not important, foo and bar are first choice among computing science types. +\par }{\b\i\f4 Executable}{\f4 \tab A program as it resides on disk. Executables can be compiled or assembled programs, or shell scripts. Executables are run by typing their name on the shell's command line and frequently take paramters to determine what data they operate on and particulars of how they do it. +\par }\pard \qj\fi-2340\li2340\nowidctlpar\widctlpar\adjustright {\b\i\f4 GNO/ME}{\f4 .\tab GNO Multitasking Environment. The complete package including the GNO kernel and the GNO Shell. +\par }{\b\i\f4 GNO Kernel}{\f4 .\tab Heart of GNO/ME. Executes processes when asked by the GNO Shell +\par }{\b\i\f4 GNO Shell}{\f4 .\tab Provides an interface between the user and the GNO kernel. +\par }{\b\i\f4 gsh}{\f4 .\tab GNO Implementation of a UNIX-like shell. +\par }{\b\i\f4 GS/OS}{\f4 .\tab 16 bit Operating System for the Apple IIgs.}{\b\i\f4 +\par }\pard \fi-2340\li2340\nowidctlpar\widctlpar\adjustright {\b\i\f4 IPC}{\b\f4 \tab }{\f4 "Inter-Process Communication". Any method by which processes can pass information to other processes.}{\b\f4 +\par }\pard \fi-2340\li2340\nowidctlpar\widctlpar\adjustright {\b\i\f4 Job}{\b\f4 \tab }{\f4 A set of related processes. Jobs are generally composed of processes with a common parent and the same controlling terminal.}{\b\f4 +\par }{\b\i\f4 Manpage}{\f4 \tab Refers to the system call and utility documentation provided with GNO. Manpages exist on disk in pre-formatted source form (AppleWorks GS currently), and can be viewed by various utilites on a variety of output devices. +\par }{\b\i\f4 Master}{\b\f4 \tab }{\f4 Refers to the .PTYxx side of a pseudo-terminal, and also the process controlling that device. The master is usually responsible for setting up the PTY and running a process on it.}{\b\f4 +\par }{\b\i\f4 Message}{\b\f4 \tab }{\f4 A 32-bit value that is passed via the Messages IPC mechanism to another process.}{\b\f4 +\par }{\b\i\f4 Mutex}{\f4 \tab Short for mutual exclusion, a term that refers to protecting a critical section. +\par }{\b\i\f4 Panic}{\b\f4 \tab }{\f4 An unrecoverable kernel error, usually indicating that an internal data structure has become corrupted.}{\b\f4 +\par }{\b\i\f4 Parent}{\b\f4 \tab }{\f4 When talking about a process, the parent of a process is the one that spawned it; i.e., made the }{\b\f4 fork}{\f4 () call.}{\b\f4 +\par }{\b\i\f4 Pipe}{\f4 \tab A unidirectional IPC mechanism. Pipes transmit binary 8-bit data. +\par }{\b\i\f4 Pipeline}{\f4 \tab Two or more processes connected by pipes. +\par }{\b\i\f4 Port}{\b\f4 \tab }{\f4 A flow-controlled IPC mechanism that can pass longwords of data.}{\b\f4 +\par }{\b\i\f4 Process}{\f4 \tab A program in execution. +\par }{\b\i\f4 Process group}{\f4 \tab An identifying code for a job. Process groups are also assigned to TTY's, which allows the TTY to differentiate background jobs from foreground jobs when sending interrupt signals. +\par }{\b\i\f4 Pseudo-terminal}{\b\f4 \tab }{\f4 A bidirectional communications channel, normally used in windowing systems or for advanced control and testing applications.}{\b\f4 +\par }{\b\i\f4 PTY}{\b\f4 \tab }{\f4 See 'pseudo-terminal'.}{\b\f4 +\par }{\b\i\f4 Semaphore}{\f4 \tab A data object used to synchronize concurrent processes. +\par }{\b\i\f4 Sequentialization}{\f4 \tab The task of ensuring that critical sections are only executed by one concurrent process at a time. +\par }{\b\i\f4 Signal}{\f4 \tab A software interrupt and IPC mechanism. +\par }{\b\i\f4 Slave}{\b\f4 \tab }{\f4 1. A good term to describe the relationship of Joe Citizen to the IRS. +\par \tab 2. The .TTYxx side of a pseudo-terminal; the slave is usually an application program of some kind, like a shell.}{\b\f4 +\par }{\b\i\f4 Suspended}{\b\f4 \tab }{\f4 Refers to a process whose execution has been stopped.}{\b\f4 +\par }{\b\i\f4 Synchronous}{\f4 \tab An event that takes place at a predetermined time or sequence of times. Also used to indicate the act of waiting for an event to happen. See asynchronous. +\par }{\b\i\f4 Terminal}{\b\f4 \tab }{\f4 Any device that looks like a terminal; this includes pseudo-ttys. By definition, a terminal supports all of the }{\b\f4 tty}{\f4 (4) ioctl calls.}{\b\f4 +\par }{\b\i\f4 Tty}{\f4 \tab Short for Teletype. TTY is an anachronistic term; in modern usage it is taken to mean 'terminal'. +\par }\pard \qj\fi-2340\li2340\nowidctlpar\widctlpar\adjustright {\b\i\f4 UNIX}{\f4 .\tab Popular operating system which has growing use in education and business. One of the first operating systems to support multitasking.}{\b\i\f4 +\par }\pard \fi-2340\li2340\nowidctlpar\widctlpar\adjustright {\f4 +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\sect }\sectd \sbknone\linex0\endnhere\titlepg\sectdefaultcl {\headerl \pard\plain \s17\nowidctlpar\widctlpar\tqr\tx10080\adjustright \f12\cgrid {\f5\ul \tab }{\f5\ul Index}{\f5\ul +\par }\pard \s17\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}{\headerr \pard\plain \s17\nowidctlpar\widctlpar\tqr\tx10080\adjustright \f12\cgrid {\f5\ul Index\tab }{\f5\ul +\par }\pard \s17\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}\pard\plain \s20\qj\nowidctlpar\widctlpar\adjustright \f4\fs48\cgrid {\sect }\sectd \linex0\endnhere\titlepg\sectdefaultcl \pard\plain \s20\qj\nowidctlpar\widctlpar\adjustright \f4\fs48\cgrid {Index +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \f12\cgrid { +\par }\pard\plain \s29\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright \fs18\cgrid {\field\fldedit{\*\fldinst {\fs24 INDEX \\h "A" \\c "2" }}{\fldrslt {\fs24\lang1024 \sect }\sectd \sbknone\linex0\cols2\endnhere\titlepg\sectdefaultcl \pard\plain \s39\li140\sb240\sa120\keepn\nowidctlpar\widctlpar\adjustright \b\f1\fs28\cgrid {\b0\f0\lang1024 . +\par }\pard\plain \s29\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright \fs18\cgrid {\b\lang1024 .}{\lang1024 , 11 +\par }\pard \s29\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright {\b\lang1024 ..}{\lang1024 , 11 +\par .CONSOLE, 7, 8, 17 +\par .d2, 12 +\par .d5, 12 +\par .NULL, 14, 25 +\par .PTYQ[0-9,A-F], 14 +\par .ptyq0, 25, 33 +\par .ttya, 14, 25 +\par .TTYA[0-9,A-F], 14 +\par }\pard \s29\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright {\lang1024 .ttyb, 25 +\par }\pard \s29\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright {\lang1024 .TTYCO, 13, 14, 20, 25 +\par .ttyq0, 25, 33 +\par .ttyqf, 33 +\par }\pard\plain \s39\li140\sb240\sa120\keepn\nowidctlpar\widctlpar\adjustright \b\f1\fs28\cgrid {\b0\f0\lang1024 / +\par }\pard\plain \s29\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright \fs18\cgrid {\lang1024 /bin, 12 +\par }\pard \s29\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright {\lang1024 /etc, 12 +\par /etc/namespace, 12 +\par /etc/tty.config, 14 +\par /etc/ttys, 17 +\par /usr, 12 +\par }\pard\plain \s39\li140\sb240\sa120\keepn\nowidctlpar\widctlpar\adjustright \b\f1\fs28\cgrid {\b0\f0\lang1024 ^ +\par }\pard\plain \s29\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright \fs18\cgrid {\lang1024 ^C, 26, 29 +\par }\pard \s29\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright {\lang1024 ^Z, 26, 29 +\par }\pard\plain \s39\li140\sb240\sa120\keepn\nowidctlpar\widctlpar\adjustright \b\f1\fs28\cgrid {\b0\f0\lang1024 _ +\par }\pard\plain \s29\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright \fs18\cgrid {\b\lang1024 _toolErr}{\lang1024 , 7 +\par }\pard\plain \s39\li140\sb240\sa120\keepn\nowidctlpar\widctlpar\adjustright \b\f1\fs28\cgrid {\b0\f0\lang1024 ~ +\par }\pard\plain \s29\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright \fs18\cgrid {\b\lang1024 ~}{\lang1024 , 12 +\par }\pard\plain \s39\li140\sb240\sa120\keepn\nowidctlpar\widctlpar\adjustright \b\f1\fs28\cgrid {\b0\f0\lang1024 + +\par }\pard\plain \s29\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright \fs18\cgrid {\b\lang1024 +}{\lang1024 , 40 +\par }\pard\plain \s39\li140\sb240\sa120\keepn\nowidctlpar\widctlpar\adjustright \b\f1\fs28\cgrid {\b0\f0\lang1024 6 +\par }\pard\plain \s29\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright \fs18\cgrid {\lang1024 65816 processor, 9 +\par }\pard \s29\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright {\lang1024 65816 registers, 25 +\par }\pard\plain \s39\li140\sb240\sa120\keepn\nowidctlpar\widctlpar\adjustright \b\f1\fs28\cgrid {\b0\f0\lang1024 A +\par }\pard\plain \s29\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright \fs18\cgrid {\b\lang1024 alarm}{\lang1024 , 25, 29, 37 +\par }\pard \s29\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright {\lang1024 alarm10, 38 +\par }{\b\lang1024 alarmCount}{\lang1024 , 25 +\par ANDmask, 19 +\par APW, 37 +\par }{\b\lang1024 args}{\lang1024 , 25 +\par Assembly, 8 +\par auxType, 9 +\par }\pard\plain \s39\li140\sb240\sa120\keepn\nowidctlpar\widctlpar\adjustright \b\f1\fs28\cgrid {\b0\f0\lang1024 B +\par }\pard\plain \s29\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright \fs18\cgrid {\lang1024 background, 5, 26, 29 +\par }\pard \s29\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright {\lang1024 Bank 0, 8 +\par BASIC, 17 +\par }{\i\lang1024 blocked}{\lang1024 , 23, 24 +\par BYTEWRKS, 25 +\par }\pard\plain \s39\li140\sb240\sa120\keepn\nowidctlpar\widctlpar\adjustright \b\f1\fs28\cgrid {\b0\f0\lang1024 C +\par }\pard\plain \s29\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright \fs18\cgrid {\lang1024 C compiler, 8 +\par }\pard \s29\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright {\lang1024 CDA, 20 +\par ChangePath, 12 +\par character device, 13, 25 +\par character devices, 14 +\par Character drivers, 19 +\par }\pard \s29\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright {\lang1024 character strings, 8 +\par }\pard \s29\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright {\lang1024 child process, 24, 28, 31 +\par chtyp, 9 +\par ClearBackupBit, 12 +\par Close, 13, 14, 34 +\par conf.h, 24 +\par console, 7, 21 +\par console driver, 7, 8, 13, 17, 19, 20 +\par consume, 34 +\par }{\i\lang1024 context}{\lang1024 , 23 +\par }{\i\lang1024 context switch}{\lang1024 , 23, 25, 26, 27, 30, 39 +\par Control Panel, 20 +\par controlling terminal, 21 +\par }{\i\lang1024 controlling terminal}{\lang1024 , 26 +\par }{\i\lang1024 count}{\lang1024 , 27 +\par Create, 12 +\par creative programming, 8 +\par critical section, 27, 28 +\par }{\i\lang1024 critical section;}{\lang1024 , 27 +\par CTRL-D, 19 +\par CurResourceApp, 20 +\par custom drivers, 17 +\par }\pard\plain \s39\li140\sb240\sa120\keepn\nowidctlpar\widctlpar\adjustright \b\f1\fs28\cgrid {\b0\f0\lang1024 D +\par }\pard\plain \s29\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright \fs18\cgrid {\i\lang1024 daemon}{\lang1024 , 29 +\par }\pard \s29\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright {\i\lang1024 deadlock}{\lang1024 , 28, 35, 36 +\par DELETE, 19 +\par desktop, 7, 8, 9, 20 +\par Destroy, 12 +\par device drivers, 8, 26 +\par DInfo, 14 +\par direct page, 8, 11, 24 +\par disk access, 9 +\par }{\b\lang1024 dispose}{\lang1024 , 28 +\par DMA, 9 +\par dp.c, 28 +\par driver number, 17 +\par DStatus, 14 +\par }{\b\lang1024 dup}{\lang1024 , 20, 37 +\par dup2, 37 +\par }\pard\plain \s39\li140\sb240\sa120\keepn\nowidctlpar\widctlpar\adjustright \b\f1\fs28\cgrid {\b0\f0\lang1024 E +\par }\pard\plain \s29\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright \fs18\cgrid {\lang1024 E2BIG, 39 +\par }\pard \s29\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright {\lang1024 EACCESS, 38 +\par EAGAIN, 39 +\par EBADF, 38 +\par ECHILD, 39 +\par }\pard \s29\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright {\lang1024 EDOM, 38 +\par }\pard \s29\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright {\lang1024 EEXIST, 39 +\par EINTR, 39 +\par EINVAL, 38 +\par EIO, 38 +\par EMFILE, 38 +\par ENOENT, 38 +\par ENOEXEC, 39 +\par ENOMEM, 38 +\par ENOSPC, 39 +\par ENOTBLK, 39 +\par ENOTDIR, 39 +\par ENOTTY, 39 +\par EOL, 19 +\par EPERM, 38, 39 +\par EPIPE, 39 +\par ERANGE, 38 +\par }{\b\lang1024 errno}{\lang1024 , 37, 38 +\par errno.h, 38 +\par ESPIPE, 39 +\par ESRCH, 39 +\par Event Manager, 9, 20 +\par Event Manager, 20 +\par EXCL, 33 +\par EXE, 9, 23, 24 +\par }{\b\lang1024 exec}{\lang1024 , 23, 24, 33 +\par }{\b\lang1024 execve}{\lang1024 , 13, 15, 24, 26, 28, 37 +\par }{\b\lang1024 exit}{\lang1024 , 15 +\par ExpandPath, 11, 12 +\par }\pard\plain \s39\li140\sb240\sa120\keepn\nowidctlpar\widctlpar\adjustright \b\f1\fs28\cgrid {\b0\f0\lang1024 F +\par }\pard\plain \s29\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright \fs18\cgrid {\lang1024 file, 13 +\par }\pard \s29\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright {\lang1024 file descriptor, 13, 17, 34 +\par File Level, 12 +\par file sharing, 9 +\par FIONREAD, 34 +\par FlexBeep, 18 +\par Flush, 12, 14 +\par }{\b\lang1024 fopen}{\lang1024 , 9 +\par foreground, 5 +\par }{\b\lang1024 fork}{\lang1024 , 23, 24, 26, 31, 37, 39 +\par fork2, 38 +\par }{\b\lang1024 free}{\lang1024 , 28 +\par fstat, 37 +\par }\pard\plain \s39\li140\sb240\sa120\keepn\nowidctlpar\widctlpar\adjustright \b\f1\fs28\cgrid {\b0\f0\lang1024 G +\par }\pard\plain \s29\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright \fs18\cgrid {\lang1024 GetDirEntry, 14 +\par getegid, 37 +\par GetEOF, 14 +\par geteuid, 37 +\par GetFileInfo, 12 +\par getgid, 37 +\par GetLevel, 13 +\par GetMark, 14 +\par GetName, 15 +\par GetOpenFileRefnum, 20 +\par getopt.h, 40 +\par getopt1.h, 40 +\par getpgrp, 37 +\par getpid, 37 +\par getppid, 38 +\par GetPrefix, 12 +\par getuid, 37 +\par GNO compliant, 8 +\par GNO kernel, 5, 7, 12, 14, 23, 24, 27, 37 +\par GNO Snooper CDA, 25 +\par gno.h, 7 +\par GNO/ME, 5, 7, 8, 9, 11, 12, 13, 15, 17, 20, 23, 27, 28, 29, 30, 31 +\par GNO/ME compliance, 7 +\par GNO/ME compliant, 8 +\par GNO/ME drivers, 14 +\par GNO/ME signal, 30 +\par }{\b\lang1024 GNOSnooper.c}{\lang1024 , 25 +\par }\pard \s29\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright {\lang1024 GS/OS, 5, 7, 8, 9, 11, 12, 13, 14, 15, 23, 30 +\par GS/OS call, 11, 12, 13, 14, 15, 28, 39 +\par GS/OS device, 14 +\par GS/OS drivers, 13 +\par GS/OS errors, 19 +\par GS/OS refNum, 31 +\par GS/OS signal handler, 30 +\par GS/OS signals, 30 +\par }{\b\lang1024 gsh}{\lang1024 , 29, 30, 31, 40 +\par GSI, 35 +\par }\pard\plain \s39\li140\sb240\sa120\keepn\nowidctlpar\widctlpar\adjustright \b\f1\fs28\cgrid {\b0\f0\lang1024 H +\par }\pard\plain \s29\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright \fs18\cgrid {\lang1024 hardware interrupt, 28 +\par }\pard\plain \s39\li140\sb240\sa120\keepn\nowidctlpar\widctlpar\adjustright \b\f1\fs28\cgrid {\b0\f0\lang1024 I +\par }\pard\plain \s29\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright \fs18\cgrid {\lang1024 I/O, 7, 8, 9, 13, 17, 24, 25, 30, 31 +\par }\pard \s29\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright {\lang1024 I/O masks, 19 +\par }{\b\lang1024 init}{\lang1024 , 32 +\par initPipe, 33, 34 +\par InitWildcard, 40 +\par Interprocess Communication, 27 +\par }\pard \s29\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright {\lang1024 interrupt, 39 +\par }\pard \s29\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright {\lang1024 interrupt handler, 20, 25, 26, 30 +\par }{\b\lang1024 ioctl}{\lang1024 , 8, 14, 26, 34, 37, 39 +\par }{\i\lang1024 IPC}{\lang1024 , 27, 28, 30, 32, 35 +\par }{\b\lang1024 irq_A}{\lang1024 , 25 +\par }{\b\lang1024 irq_B}{\lang1024 , 25 +\par }{\b\lang1024 irq_D}{\lang1024 , 25 +\par }{\b\lang1024 irq_K}{\lang1024 , 25 +\par }{\b\lang1024 irq_P}{\lang1024 , 25 +\par }{\b\lang1024 irq_PC}{\lang1024 , 25 +\par }{\b\lang1024 irq_S}{\lang1024 , 25 +\par }{\b\lang1024 irq_state}{\lang1024 , 25 +\par }{\b\lang1024 irq_X}{\lang1024 , 25 +\par }{\b\lang1024 irq_Y}{\lang1024 , 25 +\par }\pard\plain \s39\li140\sb240\sa120\keepn\nowidctlpar\widctlpar\adjustright \b\f1\fs28\cgrid {\b0\f0\lang1024 J +\par }\pard\plain \s29\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright \fs18\cgrid {\lang1024 Job control, 26 +\par }\pard\plain \s39\li140\sb240\sa120\keepn\nowidctlpar\widctlpar\adjustright \b\f1\fs28\cgrid {\b0\f0\lang1024 K +\par }\pard\plain \s29\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright \fs18\cgrid {\lang1024 kernel, 7, 27, 28, 39 +\par }\pard \s29\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright {\lang1024 kernel, 35 +\par }{\b\lang1024 kernStatus}{\lang1024 , 7 +\par }{\b\lang1024 kernVersion}{\lang1024 , 7 +\par keyboard input, 8 +\par keyboard latch, 8 +\par }{\b\lang1024 kill}{\lang1024 , 23, 26, 29, 37 +\par kill, 35 +\par KVM, 24 +\par kvm_close, 37 +\par kvm_getproc, 37 +\par kvm_nextproc, 37 +\par kvm_open, 24, 37 +\par kvm_setproc, 37 +\par }\pard\plain \s39\li140\sb240\sa120\keepn\nowidctlpar\widctlpar\adjustright \b\f1\fs28\cgrid {\b0\f0\lang1024 L +\par }\pard\plain \s29\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright \fs18\cgrid {\lang1024 LEFT-ARROW, 19 +\par }\pard \s29\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright {\lang1024 local arrays, 8 +\par long options, 40 +\par }{\b\lang1024 longjmp}{\lang1024 , 30 +\par }{\b\lang1024 lpd}{\lang1024 , 29, 32 +\par }{\b\lang1024 lpr}{\lang1024 , 29 +\par lstat, 37 +\par }\pard\plain \s39\li140\sb240\sa120\keepn\nowidctlpar\widctlpar\adjustright \b\f1\fs28\cgrid {\b0\f0\lang1024 M +\par }\pard\plain \s29\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright \fs18\cgrid {\lang1024 main memory, 8 +\par }\pard \s29\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright {\b\lang1024 malloc}{\lang1024 , 8 +\par master, 33, 34 +\par }{\i\lang1024 master.}{\lang1024 , 33 +\par Memory Manager, 8, 23 +\par }\pard \s29\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright {\lang1024 messages, 27, 32 +\par }\pard \s29\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright {\lang1024 MiscTool, 19 +\par modem, 7, 14, 25 +\par multitasking, 5, 11, 12, 17, 20, 27 +\par }{\i\lang1024 mutual exclusion}{\lang1024 , 28 +\par }\pard\plain \s39\li140\sb240\sa120\keepn\nowidctlpar\widctlpar\adjustright \b\f1\fs28\cgrid {\b0\f0\lang1024 N +\par }\pard\plain \s29\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright \fs18\cgrid {\lang1024 NEW, 25 +\par }\pard \s29\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright {\lang1024 NextWildcard, 40 +\par }{\b\lang1024 NPROC}{\lang1024 , 24 +\par Null device driver, 17 +\par }\pard\plain \s39\li140\sb240\sa120\keepn\nowidctlpar\widctlpar\adjustright \b\f1\fs28\cgrid {\b0\f0\lang1024 O +\par }\pard\plain \s29\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright \fs18\cgrid {\lang1024 OA-D, 19 +\par }\pard \s29\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright {\lang1024 OA-E, 19 +\par Open, 12, 13, 14 +\par }{\b\lang1024 openFiles}{\lang1024 , 25 +\par OpenGS, 9 +\par option arguments, 40 +\par ORCA, 12, 15, 17, 37, 40 +\par ORCA/C, 8, 38 +\par ORCA/C 1.2, 9 +\par ORCA/C 1.3, 8, 9, 15 +\par ORCA/C 2.0, 9, 15 +\par ORmask, 19 +\par OSShutdown, 15 +\par }\pard\plain \s39\li140\sb240\sa120\keepn\nowidctlpar\widctlpar\adjustright \b\f1\fs28\cgrid {\b0\f0\lang1024 P +\par }\pard\plain \s29\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright \fs18\cgrid {\lang1024 parent process, 23, 28, 31 +\par }\pard \s29\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright {\lang1024 Pascal compiler, 28 +\par Pascal control codes, 13 +\par Pascal driver, 17 +\par Pascal firmware, 17 +\par }{\b\lang1024 pause}{\lang1024 , 26 +\par PAUSED, 25 +\par }{\b\lang1024 pbind}{\lang1024 , 32, 38 +\par }{\b\lang1024 pcreate}{\lang1024 , 32, 38 +\par }{\b\lang1024 pdelete}{\lang1024 , 32, 38 +\par pgetcount, 38 +\par }{\b\lang1024 pgetport}{\lang1024 , 32, 38 +\par pipe, 13, 17, 25, 27, 29, 30, 31, 37 +\par pipe*.c, 28, 31 +\par pipeline, 26, 31 +\par port drivers, 14, 25 +\par port ID, 32 +\par ports, 27, 32 +\par }{\b\lang1024 preceive}{\lang1024 , 32, 38 +\par }{\i\lang1024 preemptive multitasking}{\lang1024 , 23 +\par }\pard \s29\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright {\lang1024 prefixes, 11 +\par }\pard \s29\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright {\lang1024 preset, 38 +\par print spooler, 29 +\par }{\b\lang1024 printer}{\lang1024 , 14, 25, 29 +\par }{\b\lang1024 printf}{\lang1024 , 28 +\par proc.h, 24, 25 +\par }{\i\lang1024 process}{\lang1024 , 23, 26, 27, 29 +\par process, 35 +\par }{\i\lang1024 process group.}{\lang1024 , 26 +\par }{\i\lang1024 process ID}{\lang1024 , 23, 32 +\par process table, 24 +\par }{\b\lang1024 processState}{\lang1024 , 24 +\par ProDOS-16, 11 +\par producer, 34 +\par }{\b\lang1024 ps}{\lang1024 , 24 +\par }{\b\lang1024 psend}{\lang1024 , 32, 38 +\par Pseudo-terminals, 14, 27, 33 +\par PTY, 14, 33, 34, 35 +\par }\pard\plain \s39\li140\sb240\sa120\keepn\nowidctlpar\widctlpar\adjustright \b\f1\fs28\cgrid {\b0\f0\lang1024 Q +\par }\pard\plain \s29\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright \fs18\cgrid {\lang1024 QDStartup, 21 +\par }\pard \s29\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright {\lang1024 QuickDraw, 11, 37 +\par QUIT, 13, 15 +\par QuitGS, 13, 15 +\par }\pard\plain \s39\li140\sb240\sa120\keepn\nowidctlpar\widctlpar\adjustright \b\f1\fs28\cgrid {\b0\f0\lang1024 R +\par }\pard\plain \s29\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright \fs18\cgrid {\lang1024 Read, 14 +\par }\pard \s29\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright {\lang1024 ReadChar, 19 +\par ReadLine, 19 +\par READY, 24 +\par }{\b\lang1024 receive}{\lang1024 , 26, 32, 37 +\par recursion, 8 +\par recvclr, 37 +\par }{\b\lang1024 recvtim}{\lang1024 , 32, 37 +\par redirection, 17, 33 +\par }{\i\lang1024 reentrant}{\lang1024 , 28 +\par refNum, 13, 14, 17, 25, 31 +\par RELEASE.NOTES, 9 +\par requestAccess, 9 +\par resource, 20 +\par Resource Manager, 20 +\par RestAll, 20 +\par restartability, 14 +\par }{\b\lang1024 rexit}{\lang1024 , 15 +\par RIGHT-ARROW, 19 +\par }{\i\lang1024 round-robin scheduling}{\lang1024 , 23 +\par RUNNING, 24, 25 +\par }\pard\plain \s39\li140\sb240\sa120\keepn\nowidctlpar\widctlpar\adjustright \b\f1\fs28\cgrid {\b0\f0\lang1024 S +\par }\pard\plain \s29\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright \fs18\cgrid {\lang1024 S16, 9, 23, 24 +\par }\pard \s29\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright {\lang1024 SANE, 11 +\par SaveAll, 20 +\par scount, 38 +\par }{\b\lang1024 screate}{\lang1024 , 27, 37 +\par screen memory, 8 +\par script, 31, 35 +\par }{\b\lang1024 sdelete}{\lang1024 , 28, 37 +\par semaphore, 27, 28, 31 +\par semaphore pool, 28 +\par semaphores, 28 +\par }{\b\lang1024 send}{\lang1024 , 26, 32, 37 +\par serial driver, 17 +\par serial driver, 17 +\par serial ports, 8, 9 +\par setdebug, 37 +\par SetEOF, 14 +\par SetFileInfo, 12 +\par setgid, 37 +\par SetGNOQuitRec, 38 +\par SetInGlobals, 19 +\par SetInputDevice, 17 +\par }{\b\lang1024 setjmp}{\lang1024 , 30 +\par SetLevel, 13 +\par SetMark, 14 +\par SetOutputDevice, 17 +\par setpgrp, 38 +\par SetPrefix, 11, 12 +\par setsystemvector, 37 +\par }{\b\lang1024 settpgrp}{\lang1024 , 26, 37 +\par setuid, 37 +\par shared information, 27 +\par short options, 40 +\par SIGALRM, 25, 29 +\par sigblock, 37 +\par SIGCHLD, 24, 25, 29 +\par SIGCONT, 29 +\par SIGHUP, 35 +\par SIGINT, 26, 29 +\par SIGKILL, 29 +\par }{\i\lang1024 signal}{\lang1024 , 24, 25, 27, 28, 29, 30, 37 +\par signal, 35 +\par signal handler, 28, 30 +\par signal.h, 28 +\par }\pard \s29\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright {\b\lang1024 sigpause}{\lang1024 , 26, 37 +\par }\pard \s29\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright {\lang1024 SIGPIPE, 29, 31, 39 +\par sigsetmask, 37 +\par SIGSTOP, 25, 29 +\par SIGTERM, 29 +\par SIGTSTP, 25, 26, 29 +\par SIGTTIN, 25, 26, 29 +\par SIGTTOU, 25, 29 +\par SIGUSR, 29 +\par SIGUSR, 30 +\par SIGUSR1, 29 +\par SIGUSR2, 29 +\par }{\i\lang1024 slave}{\lang1024 , 33, 34 +\par slave, 35 +\par slot-dependence, 17 +\par slotNum, 17 +\par spooler, 29 +\par }{\b\lang1024 ssignal}{\lang1024 , 27, 28, 37 +\par Stack, 8, 38 +\par stack frames, 8 +\par stack pointer, 30 +\par stack segment, 8 +\par stack space, 24 +\par standard loops, 8 +\par stat, 37 +\par static, 8 +\par stderr, 8 +\par stdin, 8 +\par stdio library, 28 +\par stdout, 8 +\par string manipulation, 8 +\par struct fdentry, 25 +\par struct ftable, 25 +\par SUSPENDED, 25, 27 +\par }{\b\lang1024 swait}{\lang1024 , 27, 28, 37 +\par SYS.RESOURCES, 20 +\par SYSCMND, 15 +\par SysFailMgr, 19 +\par System 6.0.1, 7 +\par system call, 23, 27, 29, 37, 39 +\par system calls, 37 +\par system panic, 20, 39 +\par System Software 5.0.4, 12 +\par }\pard\plain \s39\li140\sb240\sa120\keepn\nowidctlpar\widctlpar\adjustright \b\f1\fs28\cgrid {\b0\f0\lang1024 T +\par }\pard\plain \s29\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright \fs18\cgrid {\b\lang1024 tcnewpgrp}{\lang1024 , 26, 37 +\par }{\b\lang1024 tctpgrp}{\lang1024 , 26, 37 +\par }\pard \s29\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright {\lang1024 terminal, 8, 33 +\par TextTools, 7, 8, 9, 13, 14, 17, 19, 20 +\par }{\b\lang1024 ticks}{\lang1024 , 25 +\par time slice, 23 +\par times, 38 +\par Tool locator, 7 +\par ToolBox, 7, 11, 17, 28 +\par ToolBox call, 23, 30, 39 +\par }{\b\lang1024 toolerror}{\lang1024 , 7 +\par Tools, 8 +\par toOut, 34 +\par TTY, 13, 14, 24, 25, 29, 33 +\par tty.config, 25 +\par }{\b\lang1024 ttyID}{\lang1024 , 25 +\par }\pard\plain \s39\li140\sb240\sa120\keepn\nowidctlpar\widctlpar\adjustright \b\f1\fs28\cgrid {\b0\f0\lang1024 U +\par }\pard\plain \s29\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright \fs18\cgrid {\lang1024 UNIX, 9, 12, 13, 20, 24, 28, 29, 33, 40 +\par }\pard \s29\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright {\lang1024 userID, 23, 24 +\par }\pard\plain \s39\li140\sb240\sa120\keepn\nowidctlpar\widctlpar\adjustright \b\f1\fs28\cgrid {\b0\f0\lang1024 V +\par }\pard\plain \s29\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright \fs18\cgrid {\lang1024 variable, 8 +\par }\pard \s29\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright {\lang1024 virtual memory, 28 +\par }\pard\plain \s39\li140\sb240\sa120\keepn\nowidctlpar\widctlpar\adjustright \b\f1\fs28\cgrid {\b0\f0\lang1024 W +\par }\pard\plain \s29\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright \fs18\cgrid {\b\lang1024 wait}{\lang1024 , 24, 26, 29, 37, 39 +\par }\pard \s29\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright {\lang1024 WAITING, 25 +\par WAITSIGCH, 25 +\par }{\b\lang1024 while}{\lang1024 , 30 +\par Window Manager, 30 +\par Write, 14 +\par }{\b\lang1024 writeln}{\lang1024 , 28 +\par }{\fs24\lang1024 \sect }\sectd \sbknone\linex0\endnhere\titlepg\sectdefaultcl \pard\plain \s29\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright \fs18\cgrid }}\pard\plain \s29\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright \fs18\cgrid { +\par }} \ No newline at end of file diff --git a/refs.aug96/gnomev20-95.doc b/refs.aug96/gnomev20-95.doc new file mode 100644 index 0000000..942abe3 --- /dev/null +++ b/refs.aug96/gnomev20-95.doc @@ -0,0 +1,464 @@ +{\rtf1\ansi\ansicpg1252\uc1 \deff0\deflang1033\deflangfe1033{\fonttbl{\f0\froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f4\froman\fcharset0\fprq2{\*\panose 00000000000000000000}Times;}{\f6\fmodern\fcharset0\fprq1{\*\panose 00000000000000000000}Courier;}{\f7\fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}Geneva{\*\falt Arial};}{\f12\froman\fcharset0\fprq2{\*\panose 00000000000000000000}New York{\*\falt Times New Roman};}}{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;}{\stylesheet{\nowidctlpar\widctlpar\adjustright \f12\cgrid \snext0 Normal;}{\*\cs10 \additive Default Paragraph Font;}{\s15\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright \f12\cgrid \sbasedon0 \snext15 footer;}{\s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright \f12\cgrid \sbasedon0 \snext16 header;}{\*\cs17 \additive \sbasedon10 page number;}}{\info{\title GNO/ME Version 2}{\author Lisa K Holsberg}{\operator Lisa K Holsberg}{\creatim\yr1997\mo8\dy27\hr16\min6}{\revtim\yr1997\mo8\dy27\hr16\min6}{\printim\yr1996\mo8\dy7\hr23\min24}{\version2}{\edmins0}{\nofpages15}{\nofwords3894}{\nofchars22196}{\*\company Promethean Enterprises}{\nofcharsws27258}{\vern71}}\margl1080\margr1080\margb720 \facingp\widowctrl\ftnbj\aenddoc\hyphhotz0\margmirror\sprstsp\otblrul\brkfrm\sprstsm\truncex\nolead\msmcap\lytprtmet\hyphcaps0\viewkind1\viewscale83\viewzk2\pgbrdrhead\pgbrdrfoot \fet0\sectd \psz1\sbknone\pgnrestart\pgnlcrm\linex0\endnhere\titlepg\sectdefaultcl {\footerl \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\pvpara\phmrg\posxo\posy0\adjustright \f12\cgrid {\field{\*\fldinst {\cs17\b PAGE }}{\fldrslt {\cs17\b\lang1024 iv}}}{\cs17\b +\par }\pard \s15\fi360\ri360\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright {\b +\par }}{\footerr \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\pvpara\phmrg\posxo\posy0\adjustright \f12\cgrid {\field{\*\fldinst {\cs17\b PAGE }}{\fldrslt {\cs17\b\lang1024 iii}}}{\cs17 +\par }\pard \s15\fi360\ri360\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}{\*\pnseclvl1\pnucrm\pnstart1\pnindent720\pnhang{\pntxta .}}{\*\pnseclvl2\pnucltr\pnstart1\pnindent720\pnhang{\pntxta .}}{\*\pnseclvl3\pndec\pnstart1\pnindent720\pnhang{\pntxta .}}{\*\pnseclvl4\pnlcltr\pnstart1\pnindent720\pnhang{\pntxta )}}{\*\pnseclvl5\pndec\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}{\*\pnseclvl6\pnlcltr\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}{\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}{\*\pnseclvl8\pnlcltr\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}{\*\pnseclvl9\pnlcrm\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}\pard\plain \qj\nowidctlpar\widctlpar\adjustright \f12\cgrid { +\par }\pard \qj\nowidctlpar\widctlpar\adjustright { +\par +\par +\par +\par +\par +\par +\par +\par +\par +\par +\par +\par +\par +\par +\par +\par +\par +\par +\par +\par +\par +\par +\par +\par +\par +\par +\par +\par +\par +\par +\par +\par +\par +\par +\par +\par +\par +\par +\par +\par }{\f4\fs72 GNO/ME Version 2.0}{\fs48 +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4\fs36 By Jawaid Bazyar and Tim Meekins +\par }{ +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 \page +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 +\par +\par +\par +\par +\par +\par The GNO Multitasking Environment is Copyright 1991-199}{\f4 6}{\f4 by Procyon Enterprises Incorporated}{\f4 +\par +\par Documentation, second edition, August 1996.}{\f4 +\par +\par The ORCA/C run-time libraries are Copyright 1987-1993 Byte Works, Inc. +\par and distributed with permission. +\par +\par This product includes software developed by the University of California, Berkeley and its contributors. +\par +\par GNO/ME 2.0 also includes several utilities and libraries produced by outside authors and in the public domain. This software is included solely as a convenience to users of GNO/ME, and is not considered part of GNO/ME for copyright purposes. +\par +\par +\par GNO and GNO/ME are trademarks of Procyon Enterprises Incorporated. +\par Apple IIGS, APW, Finder, GS/OS, ProDOS, Macintosh, and HFS are registered trademarks of Apple Computer, Inc. +\par AppleWorks GS is a trademark of Claris Corp. +\par UNIX is a registered trademark of AT&T Bell Laboratories. +\par }{\b\f4 +\par Important Notice}{\f4 : This is a fully copyrighted work and as such is protected under the copyright laws of the United States of America. According to these laws, consumers of copywritten material may make copies for their personal use only. Duplication for any other purpose whatsoever would constitute infringement of copyright laws and the offender would be liable to civil damages of up to $50,000 in addition to actual damages, plus criminal penalties of up to one year imprisonment and/or a $10,000 fine. +\par +\par Procyon Enterprises Inc. MAKES NO WARRANTIES, EITHER EXPRESS OR IMPLIED, REGARDING THE ENCLOSED COMPUTER SOFTWARE PACKAGE, ITS MERCHANTABILITY OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. THE EXCLUSION OF IMPLIED WARRANTIES IS NOT PERMITTED IN SOME STATES. THE ABOVE EXCLUSION MAY NOT APPLY TO YOU. THIS WARRANTY PROVIDES YOU WITH SPECIFIC LEGAL RIGHTS. THERE MAY BE OTHER RIGHTS THAT YOU MAY HAVE WHICH VARY FROM STATE TO STATE. +\par +\par This product is sold for use on a }{\i\f4 single computer}{\f4 at a }{\i\f4 single location}{\f4 . For information on obtaining a site license for using multiple copies, contact the publisher. +\par +\par Procyon Enterprises, Inc. +\par P.O. Box }{\f4 641}{\f4 +\par }{\f4 Englewood}{\f4 , CO 801}{\f4 51-0641}{\f4 USA +\par (303) 781-3273 +\par }{\f4\fs48 Credits}{\f4 +\par +\par "Always listen to experts. They'll tell you what can't be done, and why. Then do it." +\par Lazarus Long +\par +\par The }{\b\f4 GNO}{\f4 }{\b\f4 M}{\f4 ultitasking }{\b\f4 E}{\f4 nvironment for the Apple IIgs +\par Copyright 1991-1993, Procyon Enterprises Inc. and Tim Meekins +\par +\par +\par Please direct all inquiries to: +\par }\pard \qj\li720\nowidctlpar\widctlpar\adjustright {\b\f4 Procyon, Inc. +\par }\pard \qj\li720\nowidctlpar\widctlpar\adjustright {\b\f4 PO Box 641}{\b\f4 +\par }{\b\f4 Englewood}{\b\f4 , CO 801}{\b\f4 51-0641}{\b\f4 USA +\par (303) 781-3273 +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 +\par For on-line technical assistance, contact: +\par \tab America OnLine\tab : }{\f6 GNOJawaid, GNOTim2}{\f4 +\par \tab GEnie\tab \tab \tab : }{\f6 Procyon.Inc}{\f4 +\par \tab Internet\tab \tab : }{\f6 bazyar@hypermall.com}{\f6 +\par }{\f4 \tab Delphi\tab \tab \tab : }{\f6 JAWAIDB}{\f4 +\par +\par Written by: +\par }\pard \qj\nowidctlpar\widctlpar\tx720\tx2880\adjustright {\f4 \tab }{\b\f4 Jawaid Bazyar}{\f4 \tab Kernel & Documentation +\par \tab }{\b\f4 Tim Meekins}{\f4 \tab Shell & Documentation +\par \tab }{\b\f4 Albert Chin}{\f4 \tab Documentation +\par \tab }{\b\f4 Andrew Roughan\tab }{\f4 Documentation +\par \tab }{\b\f4 Derek Taubert}{\f4 \tab Kernel support and utilities +\par \tab }{\b\f4 Greg Thompson, Philip Vandry}{\f4 , +\par \tab }{\b\f4 James Brookes}{\f4 , }{\b\f4 Ian Schmidt}{\f4 \tab +\par \tab \tab Utilities +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 +\par With many thanks to: +\par }\pard \qj\fi-2160\li2880\nowidctlpar\widctlpar\adjustright {\f4 Bill Gulstad, Rob Knauerhase, and everyone on the GNOBETA Internet mailing list +\par Dave Lyons, for tolerating my endless questions since the beginning of time, for getting me started in IIgs programming, and for calling GNO 'cool'. +\par Mike Westerfield, for your technical assistance and all your work in making great development tools for the IIgs. +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 +\par Special thanks to: +\par }\pard \qj\fi-2160\li2880\nowidctlpar\widctlpar\adjustright {\f4 Matt Deatherage, for egging me on to complete the project; also, for your most helpful technical support through DEVSUPPORT- you guys made this thing possible! +\par Randy Hyde, for telling me it couldn't be done. +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4\fs48 \page M}{\f4\fs48 iscellaneous}{\f4\fs48 +\par }{\f4 +\par }{\b\f4 Reporting Bugs +\par }{\f4 +\par In any large piece of computer software such as the GNO/ME system, bugs are sure to turn up, no matter how much testing is performed on the software before it goes out the door. If you discover a bug in GNO/ME, we'd like to hear about it. There are several things we require, however, to make bug reports useful to us. +\par +\par First of all, we need a complete description of your computer system; how much RAM, what cards, in what slots, what type of disk storage, etc. This information is very important in tracking down hardware-dependent bugs. Also, we need to know the version numbers of the software involved; the GNO Kernel, the GNO Shell, and any utilities. +\par +\par Second, we need a step-by-step description of how to duplicate the bug. If this requires writing down individual keystrokes, then we need it. Only in this way can we decide whether the bug is hardware dependent or global. +\par +\par You can send bug reports to any of the electronic mail addresses listed on the 'Credits' page, or by mailing a disk containing a description of the problem and the necessary software and files to the Procyon address. +\par +\par +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\b\f4 User Projects}{\f4 +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 +\par If you're working on a project which utilizes GNO/ME in some way, we'd like to know about it. Just contact us by mail, phone, or whatever}{\f4 i}{\f4 s most convenient for you, and tell us about your project. If possible, we'll coordinate your efforts with those of other programmers. If we really like your project and think it may be useful to others, we may include it on the next GNO/ME distribution! +\par +\par +\par }{\b\f4 Software Piracy}{\f4 +\par +\par If you copied GNO/ME from someone and are now reading this, take a moment to reflect on what you've done. GNO/ME is a project that has consumed around three man-years of effort, huge amounts of money, and a lot of grief on our part. The kernel alone consists of over 18,000 lines of source code; the shell and utilities make up another twenty to thirty thousand lines. +\par +\par Is it right that you're now benefiting from our effort without any just compensation to the authors and Procyon, Inc.? We are Apple II programmers born, bred and raised in the spirit of the machine; we love to program it, and probably always will. But if we cannot make enough money to make it worthwhile to continue work on GNO/ME, then we won't; because by worthwhile, we mean not only food on the table, but resources for expansion; expansion of our IIgs product line and support to IIgs owners being abandoned by the rest of the industry. In short, support us and we'll support you. +\par +\par GNO/ME is very inexpensive when you consider what it allows you to do, and what it will allow you to do when software development for GNO/ME starts full-swing. And it's a small price to pay indeed for our loyalty to you, the IIgs owner. +\par +\par To all you GNO/ME purchasers out there: thank you very much. We will continue to provide you with new IIgs products until our hair and teeth fall out, and our fingers are too frail to type the keys (and even then, with Easy Access, we might crank out a program or two). We hope you will be sufficiently impressed with the system to recommend it to others. +\par +\par +\par p.s. Remember - if someone comes up to you on the street and offers you some IBM, }{\b\f4 Just Say GNO! +\par }{\page }{\f4\fs48 P}{\f4\fs48 reface}{\f4 +\par +\par Computers are tools. The flexibility of a tool determines how useful it is. Early computers were much like the one this software was written for: the Apple IIgs. They could only run one program at a time, and their usefulness was limited to what the particular program the user was executing offered. In the late 1960's, a team of researchers at AT&T began developing the UNIX operating system. The UNIX design was partially based on the premise that most programs are I/O bound, that is, most of the time the program executes is spent waiting for user input or other I/O operations. While one program is waiting for I/O, why not allow another program to execute? This is what they did, and the result was one of the most successful computer operating systems ever created. +\par +\par The Apple IIgs, like the Macintosh it is modelled after, provides very limited multitasking abilities in the form of desk accessories (NDAs). The programs in the NDA menu are available in whatever application you use as long as it follows Apple's guidelines. However, there are many graphics based programs that don't support NDAs, and in addition there is a wealth of software that has been developed for the Byte Works' ORCA environment. This environment is mainly text-based, and thus makes access to NDAs impossible. As if that wasn't enough, it's very difficult to write an NDA to allow the application to keep running concurrently. So the benefits are lost, and we're back at ground zero. +\par +\par Enter the GNO Multitasking Environment. What was once just dreamed about is now a reality. GNO/ME provides an environment that is almost entirely compatible with software developed for the ORCA environment. But GNO/ME also provides a wealth of new abilities, lots of new ground for developers and users alike. +\par +\par Before we begin describing, we'd like to respond to those who say such a multitasking system isn't possible on the Apple IIgs. Obviously it is: you hold it in your hands. Some say the Apple IIgs isn't powerful enough to make multitasking useful. We point out that the Apple IIgs is much more powerful than the first computers UNIX was designed to run on; they only had 64K of real memory, and were 16 bit machines. Some ask why you'd ever need to run more than one program at once. These are the same people who asked why we'd ever need more than 64K of memory, or more than 140K of storage on disks (end soapbox). +\par }{\page }{\f4\fs48 Introduction}{ +\par }\pard \qj\nowidctlpar\widctlpar\adjustright { +\par }{\f4 The GNO Multitasking Environment provides pre-emptive multitasking. Many programs can be executing at the same time; each is called a 'process'. Each process is allowed to run for a short period of time (1/20th of a second on average). When its time runs out, the current process is set aside and another one chosen to run next. This cycle continues until there are no more processes left (i.e. when you exit GNO/ME). Starting up processes to run 'in the background' is a simple matter of adding a few characters to the shell commands. +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 +\par GNO/ME provides a shell that takes full advantage of the multitasking ability provided. The most important feature of the shell is job control (starting, terminating, and suspending processes). But the shell also provides power never before seen on the Apple IIgs. The ability to choose files by 'wildcard' has been around for a while, but the GNO Shell takes this to a new level with 'regular expressions', a very powerful yet simple programming language. Other benefits of the GNO shell are too numerous to mention. (see the }{\i\f4 GNO Shell User's Manual }{\f4 for details). +\par +\par In addition to being compatible with the ORCA system, GNO/ME is a very powerful programming environment. Available to the programmer are all the calls needed to control processes, support Inter-Process Communication, and other tools needed in a multitasking environment. +\par +\par GNO/ME also boasts the first completely consistent method for accessing serial and console I/O. The IIgs TextTools have been incredibly enhanced to provide a truly all-encompassing interface for serial, console, and IPC applications. Imagine being able to attach terminals to your GS, and have a useful shell in each one. Multiuser BBSs, remote dial-ups, UUCP or SLIP that doesn't take over your computer- the applications are endless! +\par +\par With all this talk of shell utilities, have desktop users (users of programs like AppleWorks GS) been left behind? Absolutely not. GNO/ME doesn't allow more than one desktop program to run concurrently, but it DOES let you run a desktop program with as many text applications as you like. In other words, no functionality is lost from the IIgs by using GNO/ME. +\par +\par Finally, the GNO Multitasking Environment comes with a large number of free utilities that bring some of the power of a UNIX system to the Apple IIgs. Also, a number of programming libraries are included that make it easy to port programs from UNIX or MS-DOS systems to the Apple IIgs. +\par +\par +\par \page }{\f4\fs48 The GNO/ME package}{\f4 +\par +\par Included in your GNO/ME Version 2.0 package are: +\par \tab this GNO/ME overview +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 \tab the GNO Shell User's Manual +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 \tab the GNO Kernel Reference Manual +\par \tab a selection of utility and library documentation +\par \tab a reading list containing a wide selection of books for both the user and the programmer +\par \tab three disks containing the GNO Kernel, GNO Shell, and loads of utilities +\par +\par +\par }{\f4\fs48 Hardware Requirements}{\b\f4 +\par }{\f4 +\par GNO/ME will work on any Apple IIgs with at least 2 MegaBytes of memory and a hard drive. +\par You should have at least 5 MegaBytes of hard disk space free. +\par +\par We recommend 4 MegaBytes of Memory and an accellerator card, especially if you will be using GNO with many background processes. A modem and access to an on-line service will greatly speed access to technical assistance and new utilities as they are made available. +\par \page }{\f4\fs48 Installation}{\f4 +\par +\par GNO/ME is a very large system. Most of the system is stored on the three disks in a compressed format. For this reason we recommend that you read this section carefully and use the included automated installation program to save yourself the major headache of arranging everything. You'll need a hard drive partition with at least 5 Megabytes free to install GNO/ME. The entire installation process should take no longer than 10 minutes. +\par +\par If you are upgrading from GNO 1.0 to GNO 2.0, we recommend that you install GNO 2.0 on a new area of your hard drive. This is because GNO 2.0 provides new versions of almost all the utilities and other software provided with GNO 1.0. You can then move the parts of your old system that aren't a part of the standard GNO 2.0 distribution over to the new installation. +\par +\par The installer program is able to the copy the GNO libraries for use with the ORCA languages and tools. If you want to use your ORCA languages and tools, you should answer the appropriate questions during the install process. ORCA installation is covered in more detail below. +\par }\pard \qj\nowidctlpar\widctlpar\tqr\tx10080\adjustright {\f4\ul \tab }{\f4 +\par Step 1: +\par }\pard \qj\li360\nowidctlpar\widctlpar\tqr\tx10080\adjustright {\f4 +\par Copy the contents of /GNO.Disk1 to the partition where you want to install GNO/ME. The easiest way to do this is to run the IIGS Finder™ program, insert the }{\f6\fs20 /GNO.Disk1}{\f4 disk, and drag the }{\f6\fs20 /GNO.Disk1}{\f4 onto the icon of the drive you want to install on. The Finder will tell you that the disks are of a different size, and ask you if you wish to place the contents of }{\f6\fs20 /GNO.Disk1}{\f4 in a folder on the hard drive partition. Answer "Yes", and the Finder will copy the data. +\par }\pard \qj\nowidctlpar\widctlpar\tqr\tx10080\adjustright {\f4\ul \tab }{\f4 +\par Step 2: +\par }\pard \qj\li360\nowidctlpar\widctlpar\tqr\tx10080\adjustright {\f4 +\par Open the newly created }{\f6\fs20 GNO.Disk1}{\f4 folder on the partition and execute 'Kern' by double-clicking on the }{\f6\fs20 Kern}{\f4 icon. }{\f4\fs20 GNO.Disk1}{\f4 contains a minimal GNO system which you have just started up. You'll see some copyright messages, and after a few seconds the desktop will appear. +\par }\pard \qj\nowidctlpar\widctlpar\tqr\tx10080\adjustright {\f4\ul \tab }{\f4 +\par Step 3: +\par }\pard \qj\li360\nowidctlpar\widctlpar\tqr\tx10080\adjustright {\f4 +\par Install will ask you questions before the installation process begins. Questions asked by Install are boldfaced in the following discussion. If you're uncertain of how to answer, click on the 'Info' button to get more information on the question. This information is reproduced here for ease of reference. +\par +\par }{\b\f4 Do you have existing Byteworks (ORCA) language products?}{\f4 +\par If you use Byteworks language products such as ORCA/C, ORCA/M, ORCA/Pascal, etc. and wish to use them from GNO/ME then answer 'Yes' to this question. Otherwise, answer 'No'. +\par +\par Clicking on the 'Info' button will display the following text: +\par }\pard \qj\nowidctlpar\widctlpar\tqr\tx10080\adjustright {\f4 +\par }\pard \qj\li720\nowidctlpar\widctlpar\tqr\tx10080\adjustright {\f7\fs20 If you currently use products such as ORCA/C, ORCA/Pascal, ORCA/M, etc., and wish to use them from GNO/ME then you should answer 'Yes' to this dialog. +\par +\par Install will then ask you to locate the file "ORCA.SYS16" (the ORCA Shell). Usually, it will be in a directory called "ORCA" on one of your hard drive partitions. On our system, it is :software:orca. The location of this file determines where Install puts the GNO-specific ORCA/C header files and libraries (in the ORCA LIBRARIES directory). If you have renamed ORCA.SYS16 to something else, select that instead. +\par }\pard \qj\li720\nowidctlpar\widctlpar\tqr\tx10080\adjustright {\f7\fs20 +\par }\pard \qj\li720\nowidctlpar\widctlpar\tqr\tx10080\adjustright {\f7\fs20 Install uses this information to correctly set the ORCA prefixes and add the EXECUTABLES directory to the $PATH variable in your gshrc file. See the GNO Shell User's Manual, Appendix B, for more information on the ORCA prefixes. +\par }\pard \qj\nowidctlpar\widctlpar\tqr\tx10080\adjustright {\f4 +\par }\pard \qj\li360\nowidctlpar\widctlpar\tqr\tx10080\adjustright {\b\f4 Do you want to install the modified ORCA/C 2.0 ORCALIB library?}{\f4 +\par If you have ORCA/C 2.0 installed and you answered 'Yes' to the previous question, then you should answer 'Yes' now. If you have ORCA/C 1.3 installed, or you do not have any ORCA languages or tools, then you should answer 'No'. +\par +\par Clicking 'Info' will display the following text: +\par }\pard \qj\nowidctlpar\widctlpar\tqr\tx10080\adjustright {\f4 +\par }\pard \qj\li720\nowidctlpar\widctlpar\tqr\tx10080\adjustright {\f7\fs20 GNO/ME 2.0 comes with a modified version of the ORCA/C ORCALIB standard library. This library adds specific support for some of GNO's special files (pipes, terminals, etc) transparently and corrects other problems the standard ORCALIB has with GNO. +\par +\par This special ORCALIB is only for use with ORCA/C 2.0. It will NOT work with previous versions of ORCA/C. +\par +\par Note that all of GNO's other libraries (libgno, libbsd, libc) work fine with ORCA/C 1.3. +\par }\pard \qj\nowidctlpar\widctlpar\tqr\tx10080\adjustright {\f4 +\par }\pard \qj\li360\nowidctlpar\widctlpar\tqr\tx10080\adjustright {\b\f4 Do you want to install the Multi-User package?}{\f4 +\par If you wish to have the Multi User package installed, answer 'Yes'. It is recommended that new users do not install this package until they are familiar with the system. This package is not fully discussed in the GNO/ME manuals and may introduce many unfamiliar concepts. +\par +\par Clicking 'Info' will display the following text: +\par }\pard \qj\nowidctlpar\widctlpar\tqr\tx10080\adjustright {\f4 +\par }\pard \qj\li720\nowidctlpar\widctlpar\tqr\tx10080\adjustright {\f7\fs20 The 'Multi-User' package consists of a number of cooperating programs, including init(8) and login(8). MU provides for password-protected access to the GNO Shell via the console or serial ports (modems and dedicated terminals). It also handles multiple user accounts, and a certain level of protection between users. +\par +\par If you will be using a terminal with GNO, or want to be able to dial into GNO with a modem, you should install MU. +\par +\par You may wish to hold off setting up the Multi-User package until you learn your way around GNO a little better, as it's simple to set up MU later. +\par }\pard \qj\nowidctlpar\widctlpar\tqr\tx10080\adjustright {\f4\ul \tab }{\f4 +\par Step 4: +\par }\pard \qj\li360\nowidctlpar\widctlpar\tqr\tx10080\adjustright {\f4 +\par The Installer will now proceed to arrange the GNO Multitasking Environment on your hard drive. Initially, the contents of /GNO.Disk1 will be moved into the proper places on the volume you have chosen. When asked by the Installer, you should place /GNO.Disk2 and /GNO.Disk3 into the disk drive. The contents of these disks will be extracted and decompressed into their proper places. +\par +\par If the installer cannot finish it's tasks for some reason, it will abort to the shell. At this point you should study the error messages to determine the cause of the failure, }{\f4 +\par +\par }\pard \qj\nowidctlpar\widctlpar\tqr\tx10080\adjustright {\f4\ul +\par +\par +\par +\par }{\f4\ul \tab }{\f4 +\par Step 5: +\par +\par }\pard \qj\li360\nowidctlpar\widctlpar\tqr\tx10080\adjustright {\f4 When the Installer finishes, you will be returned to the GNO prompt. At this time you should type 'exit' to return to Finder and delete the }{\f6\fs20 GNO.Disk1}{\f4 directory, as it is no longer needed (GNO is completely installed in a subdirectory }{\f6 '}{\f6\fs20 GNO}{\f6 '}{\f4 on the same partition }{\f6\fs20 GNO.Disk1}{\f4 is on.}{\f4 +\par }{\f4 +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 That's all! +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\b\f4 +\par }{\b\f4 What has been installed? +\par }{\f4 +\par If you examine the directory that you chose for GNO/ME, you will find that the Installer has created several directories. Here is a brief rundown of thier contents: +\par +\par }\pard \qj\fi-2880\li2880\nowidctlpar\widctlpar\adjustright {\f4 :gno:bin:\tab This directory contains the executable shell utilities included with the GNO/ME package. +\par :gno:dev:\tab This directory contains device drivers. The GNO/ME package includes serial drivers for the II}{\f4\fs20 GS}{\f4 ' built-in modem and printer ports. +\par :gno:etc:\tab Various system configuration files +\par :gno:initrc\tab This a startup file for kern and must remain in this directory. +\par :gno:kern\tab This is the GNO kernel. Launch this to start GNO/ME. +\par :gno:lib:\tab This directory is provided for,,,, It is currently empty. +\par :gno:tmp:\tab This directory is provided for,,,, It is currently empty. +\par :gno:user:\tab This directory is created if you installed the Multi-User package. It contains a user directories for users of the system. Currently there is only one: 'root'. +\par :gno:usr:\tab This directory contains UNIX System Resources (USR). +\par :gno:usr:bin:\tab Miscellaneous utilities +\par :gno:usr:man:\tab This directory contains the manual pages for the 'man' utility. There are eight categories of information as defined by UNIX standards. These eight categories are presented in either formatted (man) or unformatted (cat) entries. +\par :gno:usr:games:\tab The classic "Hunt the Wumpus" game, and perhaps others. +\par :gno:usr:sbin:\tab System administration utilities. +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 \page }{\f4\fs48 Desk Accessories}{\f4 +\par +\par The following is a description of the desk accessories that are shipped with GNO/ME. +\par +\par }{\b\f4 GSI NDA}{\f4 +\par +\par The Graphical Shell Interface New Desk Accessory allows you to access the shell from a window inside a desktop application. Selecting 'GSI' from the Apple menu opens a window and brings up a shell in it. You can use the shell in this window just as you would in text mode. +\par +\par At this time, GSI doesn't support any terminal emulations; i.e., it's a 'dumb' interface. As a result, full screen programs like 'less' and 'vi' will not work properly in GSI. +\par +\par }{\b\f4 Suspend NDA}{\f4 +\par +\par The Suspend New Desk Accessory allows you to temporarily stop a desktop program and return to the text shell. To return to the desktop program, simply type '}{\b\f4 fg}{\f4 '. +\par +\par You may put desktop programs in the background ('}{\b\f4 bg}{\f4 ') at your own risk. This is not guaranteed to work for all programs, and putting a desktop program in the background will not put the Apple IIgs in text mode. +\par +\par Also, do not run another desktop program when one is currently suspended. The GNO kernel tries to cleanly terminate the second program, but may not always be able to accomplish this. +\par +\par }{\b\f4 GNO Snooper CDA}{\f4 +\par +\par The GNO Snooper CDA is a utility that is very helpful in debugging software, and reporting system crashes. Snooper has access to information inside the kernel that is not generally available to processes. +\par +\par When you enter the control panel and choose "GNO Snooper" a process list is displayed, which is very similar to the 'ps' shell command, and a menu is presented with the following options: +\par +\par D)etails +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 Get detailed information on a process. Snooper asks you for the process ID number of the process you want to investigate. Snooper then dumps the state of the 65816 registers and shows various other information about the process. +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 +\par K)ill +\par This option sends a SIGKILL (signal number 9) to a process. Just type in the process ID of the process you want to kill. +\par +\par P)rocess Group Dump +\par Dumps the system process group tables, which is very useful for debugging code which manipulates process groups. The first table, 'pgrp', is the process group reference count table. This table lists how many processes (and TTYs) belong to that process group. pgrp ID's start at 2, so the first pgrp listed is 2. +\par +\par The second listing is the ttyStruct table. This table shows which pgrp each TTY belongs to. The TTYs start with .null (0), then move on to .ttyb, .ttya, .ttyco, etc. +\par +\par F)ile Table Dump +\par Lists all open files that GNO knows about. The information is presented in tuples. The first element is the real GS/OS refNum or device driver ID. The second is the type of file (GSOS, ttyXX, or PIPE). The third is how many references to that file are open. This information is global, so if two processes have .NULL opened, the refcount for .tty00 will be 2. +\par }\pard \qj\fi-2880\li2880\nowidctlpar\widctlpar\adjustright {\sect }\sectd \pgnrestart\pgnstarts14\pgnlcrm\linex0\cols2\endnhere\sectdefaultcl \pard\plain \qj\nowidctlpar\widctlpar\adjustright \f12\cgrid {\f4\fs48 Reading List}{ +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\b\f4 +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\b\f4 +\par Recommended Reading for Users}{\f4 +\par +\par Title: Learning Unix +\par Author: James Gardner +\par Publisher: Sams +\par Edition: 1991 +\par ISBN: 0-672-30001-X +\par Comment: With disks containing MSDOS simulation of Unix (MKS Tools). A good tutorial / reference book for those without constant access to Unix. +\par +\par Title: The Unix Operating System +\par Author: Kaare Christian +\par Publisher: Wiley +\par Edition: 2nd ed. 1988 +\par ISBN: 0-471-84781-X +\par Comment: A classic overview of Unix commands. Good in coverage. +\par +\par Title: Peter Norton's Guide to Unix +\par Authors: Peter Norton and Harley Hahn +\par Publisher: Bantam Computer +\par Edition: 1991 +\par ISBN: 0-553-35260-1 +\par Comment: Good coverage. A good introduction for beginners (especially those accustomed to DOS). +\par +\par Title: Unix in a Nutshell +\par Authors: Daniel Gilly and O'Reilly staff +\par Publisher: O'Reilly +\par Edition: 2nd ed. 1992 (System V and Solaris 2) +\par ISBN: 1-56592-001-5 +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 Comment: **** Highly Recommended **** An excellent desktop reference to almost all Unix commands "a complete reference containing all commands and options, plus generous descriptions and examples that put the commands in context." Also, an edition for 4.3. BSD. +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 +\par +\par +\par +\par }{\f4 +\par Title: Life with Unix - A Guide for Everyone +\par Authors: Don Libes and Sandy Ressler +\par Publisher: Prentice Hall +\par Edition: 1990 +\par ISBN: 0-13-536657-7 +\par Comment: **** Highly Recommended **** An everything-you-want-to-know-about-Unix book. It includes info you might not find elsewhere. "This book is the "other" book about Unix, a study in reading between the lines - which is very much what learning UNIX is like." +\par +\par Title: Unix for the Impatient +\par Authors: Paul Abrahams and Bruce Larson +\par Publisher: Addison Wesley +\par Edition: 1992 +\par ISBN: 0-201-55703-7 +\par Comment: **** Highly Recommended **** A new, comprehensive, in-depth reference to Unix. "a handbook you can use both as a manual to learn UNIX and as a ready reference for fast answers to specific UNIX questions." +\par +\par Title: Learning the vi Editor +\par Author: Linda Lamb +\par Publisher: O'Reilly +\par Edition: 1990 +\par ISBN: 0-937175-67-6 +\par Comment: A very good guide to vi and ex commands.}{\f4 }{\f4 With a quick reference card. +\par +\par Titles: vi Tutor and vi Reference +\par }{\f4 Authors: Mich}{\f4 a}{\f4 e}{\f4 l Pierce and Robert Ware (Tut), Maarten Litmaati (Ref) +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 Edition: 1.3 (Tut), 8 (Ref) +\par Comment: These and other good vi stuff are obtainable by anonymous ftp from cs.uwp.edu (in pub/vi) ... +\par }{ +\par }\pard \qj\nowidctlpar\widctlpar\adjustright { +\par +\par +\par +\par +\par +\par +\par +\par +\par +\par }{ +\par }{\b\f4 Recommended Reading for Programmers}{\f4 +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 Title: The Design and Implementation of the 4.3 BSD Unix Operating System +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 Authors: Samuel Leffler et al +\par Publisher: Addison-Wesley +\par Edition: 1990 +\par ISBN: 0-201-06196-1 +\par Comment: An authoritative description of the design of BSD Unix. "It covers the internal structure of the 4.3BSD system and the concepts, data structures, and algorithms used in imple}{\f4 menting the system facilities."}{\f4 +\par +\par Title: The Unix Programming Environment +\par Authors: Brian Kernighan and Rob Pike +\par Publisher: Prentice-Hall +\par Edition: 1984 +\par ISBN: 0-13-937681-X +\par Comment: A true classic on Unix programming. +\par +\par Title: Advanced Programming in The Unix Environment +\par Author: Richard Stevens +\par Publisher: Addison-Wesley +\par Edition: 1992 +\par ISBN: 0-201-56317-7 +\par Comment: **** Highly Recommended **** A going-to-be classic on how programs work under Unix. The source codes and errata list are obtainable by anonymous ftp from ftp.uu.net (in /published/books). +\par +\par Title: Advanced Unix Programming +\par Author: Marc Rochkind +\par Publisher: Prentice Hall +\par Edition: 1985 +\par ISBN: 0-13-011818-4 +\par Comment: A superb book covering all system calls in detail. +\par +\par Title: Using C on the Unix System +\par Author: David Curry +\par Publisher: O'Reilly +\par Edition: 1990 +\par ISBN: 0-937175-23-4 +\par Comment: This book is directed to (would-be) system programmers. +\par +\par +\par }{\b\f4 Required Reading for Programmers}{\f4 +\par +\par Title: The C Programming Language +\par Authors: Brian Kernighan and Dennis Ritchie +\par Publisher: Prentice Hall +\par Edition: 2nd ed. 1988 +\par ISBN: 0-13-110362-8 +\par Comment: The answers to the exercises can be found in C Answer Book written by Tondo and Gimpel and published by Prentice Hall (ISBN: 0-13-109653-2). +\par +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 All the books listed below are available from: +\par Resource Central +\par PO Box 11250 +\par Overland Park Kansas 66207 +\par (913) 469 6502 +\par +\par +\par Title: Apple IIgs ToolBox Reference. +\par Volumes 1, 2 & 3 +\par Author: Apple Computer +\par Publisher: Addison-Wesley +\par +\par Title: Programmers Reference for System 6.0 +\par Author: Mike Westerfield +\par Publisher: Byteworks, Inc +\par +\par Title: Apple IIgs Firmware Reference +\par Author: Apple Computer +\par Publisher: Addison-Wesley +\par +\par Title: GS/OS Reference +\par Author: Apple Computer +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 Publisher: Addison-Wesley}{ +\par }} \ No newline at end of file diff --git a/refs.aug96/gnoshell-95.doc b/refs.aug96/gnoshell-95.doc new file mode 100644 index 0000000..db2ee90 --- /dev/null +++ b/refs.aug96/gnoshell-95.doc @@ -0,0 +1,2326 @@ +{\rtf1\ansi\ansicpg1252\uc1 \deff0\deflang1033\deflangfe1033{\fonttbl{\f0\froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f1\fswiss\fcharset0\fprq2{\*\panose 020b0604020202020204}Arial;}{\f2\fmodern\fcharset0\fprq1{\*\panose 02070309020205020404}Courier New;}{\f3\froman\fcharset2\fprq2{\*\panose 05050102010706020507}Symbol;}{\f4\froman\fcharset0\fprq2{\*\panose 00000000000000000000}Times;}{\f5\fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}Helvetica;}{\f6\fmodern\fcharset0\fprq1{\*\panose 00000000000000000000}Courier;}{\f7\fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}Geneva{\*\falt Arial};}{\f8\froman\fcharset0\fprq2{\*\panose 00000000000000000000}Tms Rmn;}{\f9\fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}Helv;}{\f10\froman\fcharset0\fprq2{\*\panose 00000000000000000000}MS Serif;}{\f11\fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}MS Sans Serif;}{\f12\froman\fcharset0\fprq2{\*\panose 00000000000000000000}New York{\*\falt Times New Roman};}{\f13\fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}System;}{\f14\fnil\fcharset2\fprq2{\*\panose 05000000000000000000}Wingdings;}{\f15\fswiss\fcharset0\fprq2{\*\panose 020b0604030504040204}Tahoma;}{\f16\froman\fcharset0\fprq2{\*\panose 00000000000000000000}Bookman;}{\f17\fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}TektoMM_240 RG 564 NO;}{\f18\fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}TektoMM;}{\f19\froman\fcharset0\fprq2{\*\panose 00000000000000000000}ACaslon Bold;}{\f20\froman\fcharset0\fprq2{\*\panose 00000000000000000000}ACaslon Regular;}{\f21\froman\fcharset0\fprq2{\*\panose 00000000000000000000}Bodoni BoldCondensed;}{\f22\fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}BrushScript;}{\f23\fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}GillSans;}{\f24\fmodern\fcharset0\fprq1{\*\panose 00000000000000000000}LetterGothic;}{\f25\fswiss\fcharset0\fprq2{\*\panose 020b0600000000000000}LotusLineDraw;}{\f26\fnil\fcharset2\fprq2{\*\panose 00000000000000000000}LotusWPSet;}{\f27\fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}NewsGothic;}{\f28\froman\fcharset0\fprq2{\*\panose 00000000000000000000}Perpetua;}{\f29\fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}Anna;}{\f30\fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}Poppl-Laudatio Regular;}{\f31\fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}Boulevard;}{\f32\froman\fcharset0\fprq2{\*\panose 00000000000000000000}Boton Regular;}{\f33\froman\fcharset0\fprq2{\*\panose 00000000000000000000}Baskerville BE Regular;}{\f34\fdecor\fcharset0\fprq2{\*\panose 00000000000000000000}Giddyup Thangs;}{\f35\fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}Giddyup;}{\f36\fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}TektoMM_100 LT 250 CN;}{\f37\fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}TektoMM_100 LT 564 NO;}{\f38\fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}TektoMM_100 LT 850 EX;}{\f39\fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}TektoMM_240 RG 250 CN;}{\f40\fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}TektoMM_240 RG 850 EX;}{\f41\fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}TektoMM_503 BD 250 CN;}{\f42\fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}TektoMM_503 BD 488 NO;}{\f43\fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}TektoMM_503 BD 850 EX;}{\f44\fnil\fcharset2\fprq2{\*\panose 00000000000000000000}Marlett;}{\f45\fswiss\fcharset0\fprq2{\*\panose 020f0704030504030204}Arial Rounded MT Bold;}{\f46\froman\fcharset0\fprq2{\*\panose 02040602050305030304}Book Antiqua;}{\f47\fswiss\fcharset0\fprq2{\*\panose 020b0502020202020204}Century Gothic;}{\f48\froman\fcharset0\fprq2{\*\panose 02040604050505020304}Century Schoolbook;}{\f49\froman\fcharset0\fprq2{\*\panose 00050102010706020507}Map Symbols;}{\f50\fswiss\fcharset0\fprq2{\*\panose 020b0706040902060204}Haettenschweiler;}{\f51\fdecor\fcharset0\fprq2{\*\panose 04020705040a02060702}Algerian;}{\f52\fdecor\fcharset0\fprq2{\*\panose 04030b070d0b02020403}Braggadocio;}{\f53\fswiss\fcharset0\fprq2{\*\panose 020b0903060703020204}Britannic Bold;}{\f54\fscript\fcharset0\fprq2{\*\panose 03060802040406070304}Brush Script MT;}{\f55\fdecor\fcharset0\fprq2{\*\panose 04020805060202030203}Colonna MT;}{\f56\fdecor\fcharset0\fprq2{\*\panose 04020505020e03040504}Desdemona;}{\f57\froman\fcharset0\fprq2{\*\panose 0204060206030a020304}Footlight MT Light;}{\f58\fdecor\fcharset0\fprq2{\*\panose 040307050d0c02020703}Kino MT;}{\f59\froman\fcharset0\fprq2{\*\panose 020a0a07050505020404}Wide Latin;}{\f60\fscript\fcharset0\fprq2{\*\panose 03020802060602070202}Matura MT Script Capitals;}{\f61\fdecor\fcharset0\fprq2{\*\panose 040506030a0602020202}Playbill;}{\f62\froman\fcharset2\fprq2{\*\panose 05050102010205020202}MT Extra;}{\f63\fswiss\fcharset0\fprq2{\*\panose 020e0602030304020304}Albertus Medium;}{\f64\fswiss\fcharset0\fprq2{\*\panose 020e0802040304020204}Albertus Extra Bold;}{\f65\fswiss\fcharset0\fprq2{\*\panose 020b0603020204030204}Antique Olive;}{\f66\fswiss\fcharset0\fprq2{\*\panose 020b0502050508020304}CG Omega;}{\f67\froman\fcharset0\fprq2{\*\panose 02020603050405020304}CG Times;}{\f68\froman\fcharset0\fprq2{\*\panose 02040706040705040204}Clarendon Condensed;}{\f69\fscript\fcharset238\fprq2{\*\panose 03030502040406070605}Coronet;}{\f70\froman\fcharset0\fprq2{\*\panose 02020404030301010803}Garamond;}{\f71\fmodern\fcharset0\fprq1{\*\panose 020b0409020202030204}Letter Gothic;}{\f72\fscript\fcharset0\fprq2{\*\panose 03020702040402020504}Marigold;}{\f73\fswiss\fcharset0\fprq2{\*\panose 020b0603020202030204}Univers;}{\f74\fswiss\fcharset0\fprq2{\*\panose 020b0606020202060204}Univers Condensed;}{\f75\fswiss\fcharset0\fprq2{\*\panose 020e0702040304020204}Albertus;}{\f76\fswiss\fcharset0\fprq2{\*\panose 020b0504020202050204}Metrostyle;}{\f77\fswiss\fcharset0\fprq2{\*\panose 020b0507020202060204}Metrostyle Extended;}{\f78\froman\fcharset0\fprq2{\*\panose 0208090404030b020404}Ozzie Black;}{\f79\fswiss\fcharset0\fprq2{\*\panose 020b0604030504040204}Verdana;}{\f80\froman\fcharset0\fprq2{\*\panose 02020500000000000000}CODABAR1;}{\f81\froman\fcharset0\fprq2{\*\panose 02020500000000000000}CODE3OF9X1;}{\f82\fswiss\fcharset0\fprq2{\*\panose 020b0500000000000000}INT2OF5X1;}{\f83\fnil\fcharset0\fprq2{\*\panose 00000000000000000000}USPS Bar Code;}{\f84\fmodern\fcharset2\fprq1{\*\panose 050b0009000000000000}OCR-A;}{\f85\fswiss\fcharset0\fprq2{\*\panose 020b0000000000000000}QuickType;}{\f86\fswiss\fcharset0\fprq2{\*\panose 020b0506030403020203}QuickType Condensed;}{\f87\fnil\fcharset2\fprq2{\*\panose 05000000000000000000}QuickType Pi;}{\f88\fdecor\fcharset0\fprq2{\*\panose 04040a05050d02020502}Beesknees ITC;}{\f89\fscript\fcharset0\fprq2{\*\panose 03070402050302030203}Bradley Hand ITC;}{\f90\froman\fcharset0\fprq2{\*\panose 02040603050505030304}Calisto MT;}{\f91\fdecor\fcharset0\fprq2{\*\panose 04040404050702020202}Curlz MT;}{\f92\froman\fcharset0\fprq2{\*\panose 02020904090505020303}Elephant;}{\f93\fswiss\fcharset0\fprq2{\*\panose 020b0907030504020204}Eras Bold ITC;}{\f94\fswiss\fcharset0\fprq2{\*\panose 020b0805030504020804}Eras Demi ITC;}{\f95\fswiss\fcharset0\fprq2{\*\panose 020b0402030504020804}Eras Light ITC;}{\f96\fswiss\fcharset0\fprq2{\*\panose 020b0602030504020804}Eras Medium ITC;}{\f97\fswiss\fcharset0\fprq2{\*\panose 020b0a07030504020204}Eras Ultra ITC;}{\f98\fdecor\fcharset0\fprq2{\*\panose 04040403040a02020202}Juice ITC;}{\f99\fdecor\fcharset0\fprq2{\*\panose 04040403030d02020704}Matisse ITC;}{\f100\froman\fcharset0\fprq2{\*\panose 02060603020205020403}Rockwell;}{\f101\froman\fcharset0\fprq2{\*\panose 02060903040505020403}Rockwell Extra Bold;}{\f102\fdecor\fcharset0\fprq2{\*\panose 04040a07060a02020202}Snap ITC;}{\f103\fdecor\fcharset0\fprq2{\*\panose 04020404030d07020202}Tempus Sans ITC;}{\f104\fscript\fcharset0\fprq2{\*\panose 03070502030502020203}Viner Hand ITC;}{\f105\fswiss\fcharset0\fprq2{\*\panose 020b0500000000000000}Anson;}{\f106\fnil\fcharset0\fprq2{\*\panose 00000000000000000000}Andes;}{\f107\fnil\fcharset0\fprq2{\*\panose 00000000000000000000}Fences;}{\f108\fnil\fcharset0\fprq2{\*\panose 00000000000000000000}BlackChancery;}{\f109\fmodern\fcharset0\fprq1{\*\panose 020b0009000000000000}QuickType Mono;}{\f110\fscript\fcharset238\fprq2{\*\panose 03010101010201010101}Monotype Corsiva;}{\f111\fnil\fcharset0\fprq2{\*\panose 00000000000000000000}MICRSSK;}{\f112\fswiss\fcharset0\fprq2{\*\panose 020b0506020202030204}Arial Narrow;}{\f113\fswiss\fcharset0\fprq2{\*\panose 020b0a04020102020204}Arial Black;}{\f114\froman\fcharset0\fprq2{\*\panose 02050604050505020204}Bookman Old Style;}{\f115\fnil\fcharset2\fprq2{\*\panose 01010601010101010101}Monotype Sorts;}{\f116\fswiss\fcharset0\fprq2{\*\panose 020b0806030902050204}Impact;}{\f117\froman\fcharset2\fprq2{\*\panose 05050102010706020507}Bookshelf Symbol 3;}{\f118\fscript\fcharset0\fprq2{\*\panose 030f0702030302020204}Comic Sans MS;}{\f119\fnil\fcharset2\fprq2{\*\panose 05000000000000000000}MS Outlook;}{\f120\fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}AvantGarde;}{\f121\fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}Helvetica-Narrow;}{\f122\froman\fcharset0\fprq2{\*\panose 00000000000000000000}NewCenturySchlbk;}{\f123\froman\fcharset0\fprq2{\*\panose 00000000000000000000}Palatino;}{\f124\froman\fcharset0\fprq2{\*\panose 00000000000000000000}ZapfChancery;}{\f125\fdecor\fcharset2\fprq2{\*\panose 00000000000000000000}ZapfDingbats;}{\f216\fswiss\fcharset238\fprq2 Tahoma CE;}{\f217\fswiss\fcharset204\fprq2 Tahoma Cyr;}{\f219\fswiss\fcharset161\fprq2 Tahoma Greek;}{\f220\fswiss\fcharset162\fprq2 Tahoma Tur;}{\f221\fswiss\fcharset186\fprq2 Tahoma Baltic;}{\f408\fswiss\fcharset238\fprq2 Century Gothic CE;}{\f409\fswiss\fcharset204\fprq2 Century Gothic Cyr;}{\f412\fswiss\fcharset162\fprq2 Century Gothic Tur;}{\f413\fswiss\fcharset186\fprq2 Century Gothic Baltic;}{\f504\fswiss\fcharset238\fprq2 Albertus Medium CE;}{\f505\fswiss\fcharset204\fprq2 Albertus Medium Cyr;}{\f508\fswiss\fcharset162\fprq2 Albertus Medium Tur;}{\f509\fswiss\fcharset186\fprq2 Albertus Medium Baltic;}{\f510\fswiss\fcharset238\fprq2 Albertus Extra Bold CE;}{\f511\fswiss\fcharset204\fprq2 Albertus Extra Bold Cyr;}{\f514\fswiss\fcharset162\fprq2 Albertus Extra Bold Tur;}{\f515\fswiss\fcharset186\fprq2 Albertus Extra Bold Baltic;}{\f516\fswiss\fcharset238\fprq2 Antique Olive CE;}{\f517\fswiss\fcharset204\fprq2 Antique Olive Cyr;}{\f520\fswiss\fcharset162\fprq2 Antique Olive Tur;}{\f521\fswiss\fcharset186\fprq2 Antique Olive Baltic;}{\f522\fswiss\fcharset238\fprq2 CG Omega CE;}{\f523\fswiss\fcharset204\fprq2 CG Omega Cyr;}{\f526\fswiss\fcharset162\fprq2 CG Omega Tur;}{\f527\fswiss\fcharset186\fprq2 CG Omega Baltic;}{\f528\froman\fcharset238\fprq2 CG Times CE;}{\f529\froman\fcharset204\fprq2 CG Times Cyr;}{\f532\froman\fcharset162\fprq2 CG Times Tur;}{\f533\froman\fcharset186\fprq2 CG Times Baltic;}{\f534\froman\fcharset238\fprq2 Clarendon Condensed CE;}{\f535\froman\fcharset204\fprq2 Clarendon Condensed Cyr;}{\f538\froman\fcharset162\fprq2 Clarendon Condensed Tur;}{\f539\froman\fcharset186\fprq2 Clarendon Condensed Baltic;}{\f546\froman\fcharset238\fprq2 Garamond CE;}{\f547\froman\fcharset204\fprq2 Garamond Cyr;}{\f549\froman\fcharset161\fprq2 Garamond Greek;}{\f550\froman\fcharset162\fprq2 Garamond Tur;}{\f551\froman\fcharset186\fprq2 Garamond Baltic;}{\f552\fmodern\fcharset238\fprq1 Letter Gothic CE;}{\f553\fmodern\fcharset204\fprq1 Letter Gothic Cyr;}{\f556\fmodern\fcharset162\fprq1 Letter Gothic Tur;}{\f557\fmodern\fcharset186\fprq1 Letter Gothic Baltic;}{\f558\fscript\fcharset238\fprq2 Marigold CE;}{\f562\fscript\fcharset162\fprq2 Marigold Tur;}{\f564\fswiss\fcharset238\fprq2 Univers CE;}{\f565\fswiss\fcharset204\fprq2 Univers Cyr;}{\f568\fswiss\fcharset162\fprq2 Univers Tur;}{\f569\fswiss\fcharset186\fprq2 Univers Baltic;}{\f570\fswiss\fcharset238\fprq2 Univers Condensed CE;}{\f571\fswiss\fcharset204\fprq2 Univers Condensed Cyr;}{\f574\fswiss\fcharset162\fprq2 Univers Condensed Tur;}{\f575\fswiss\fcharset186\fprq2 Univers Condensed Baltic;}{\f576\fswiss\fcharset238\fprq2 Albertus CE;}{\f577\fswiss\fcharset204\fprq2 Albertus Cyr;}{\f580\fswiss\fcharset162\fprq2 Albertus Tur;}{\f581\fswiss\fcharset186\fprq2 Albertus Baltic;}{\f582\fswiss\fcharset238\fprq2 Metrostyle CE;}{\f583\fswiss\fcharset204\fprq2 Metrostyle Cyr;}{\f586\fswiss\fcharset162\fprq2 Metrostyle Tur;}{\f587\fswiss\fcharset186\fprq2 Metrostyle Baltic;}{\f588\fswiss\fcharset238\fprq2 Metrostyle Extended CE;}{\f589\fswiss\fcharset204\fprq2 Metrostyle Extended Cyr;}{\f592\fswiss\fcharset162\fprq2 Metrostyle Extended Tur;}{\f593\fswiss\fcharset186\fprq2 Metrostyle Extended Baltic;}{\f594\froman\fcharset238\fprq2 Ozzie Black CE;}{\f595\froman\fcharset204\fprq2 Ozzie Black Cyr;}{\f598\froman\fcharset162\fprq2 Ozzie Black Tur;}{\f599\froman\fcharset186\fprq2 Ozzie Black Baltic;}{\f624\fnil\fcharset238\fprq2 USPS Bar Code CE;}{\f628\fnil\fcharset162\fprq2 USPS Bar Code Tur;}{\f762\fnil\fcharset238\fprq2 Andes CE;}{\f766\fnil\fcharset162\fprq2 Andes Tur;}{\f774\fnil\fcharset238\fprq2 BlackChancery CE;}{\f778\fnil\fcharset162\fprq2 BlackChancery Tur;}{\f798\fswiss\fcharset238\fprq2 Arial Narrow CE;}{\f799\fswiss\fcharset204\fprq2 Arial Narrow Cyr;}{\f801\fswiss\fcharset161\fprq2 Arial Narrow Greek;}{\f802\fswiss\fcharset162\fprq2 Arial Narrow Tur;}{\f803\fswiss\fcharset186\fprq2 Arial Narrow Baltic;}{\f804\fswiss\fcharset238\fprq2 Arial Black CE;}{\f805\fswiss\fcharset204\fprq2 Arial Black Cyr;}{\f807\fswiss\fcharset161\fprq2 Arial Black Greek;}{\f808\fswiss\fcharset162\fprq2 Arial Black Tur;}{\f809\fswiss\fcharset186\fprq2 Arial Black Baltic;}{\f810\froman\fcharset238\fprq2 Bookman Old Style CE;}{\f811\froman\fcharset204\fprq2 Bookman Old Style Cyr;}{\f813\froman\fcharset161\fprq2 Bookman Old Style Greek;}{\f814\froman\fcharset162\fprq2 Bookman Old Style Tur;}{\f815\froman\fcharset186\fprq2 Bookman Old Style Baltic;}{\f822\fswiss\fcharset238\fprq2 Impact CE;}{\f823\fswiss\fcharset204\fprq2 Impact Cyr;}{\f825\fswiss\fcharset161\fprq2 Impact Greek;}{\f826\fswiss\fcharset162\fprq2 Impact Tur;}{\f827\fswiss\fcharset186\fprq2 Impact Baltic;}}{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;}{\stylesheet{\nowidctlpar\widctlpar\adjustright \f12\cgrid \snext0 Normal;}{\*\cs10 \additive Default Paragraph Font;}{\*\cs15 \additive \sbasedon10 page number;}{\s16\ri720\nowidctlpar\widctlpar\tx2160\tqr\tldot\tx10080\adjustright \b\cgrid \sbasedon0 \snext0 toc 1;}{\s17\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright \f12\cgrid \sbasedon0 \snext17 footer;}{\s18\nowidctlpar\widctlpar\tqr\tx10080\adjustright \b\f1\ul\cgrid \sbasedon0 \snext18 header;}{\s19\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright \fs20\cgrid \sbasedon0 \snext0 index 1;}{\s20\fi-240\li480\nowidctlpar\widctlpar\tqr\tx4680\adjustright \fs18\cgrid \sbasedon0 \snext0 index 2;}{\s21\fi-240\li720\nowidctlpar\widctlpar\tqr\tx4680\adjustright \fs18\cgrid \sbasedon0 \snext0 index 3;}{\s22\fi-240\li960\nowidctlpar\widctlpar\tqr\tx4680\adjustright \fs18\cgrid \sbasedon0 \snext0 index 4;}{\s23\fi-240\li1200\nowidctlpar\widctlpar\tqr\tx4680\adjustright \fs18\cgrid \sbasedon0 \snext0 index 5;}{\s24\fi-240\li1440\nowidctlpar\widctlpar\tqr\tx4680\adjustright \fs18\cgrid \sbasedon0 \snext0 index 6;}{\s25\fi-240\li1680\nowidctlpar\widctlpar\tqr\tx4680\adjustright \fs18\cgrid \sbasedon0 \snext0 index 7;}{\s26\fi-240\li1920\nowidctlpar\widctlpar\tqr\tx4680\adjustright \fs18\cgrid \sbasedon0 \snext0 index 8;}{\s27\fi-240\li2160\nowidctlpar\widctlpar\tqr\tx4680\adjustright \fs18\cgrid \sbasedon0 \snext0 index 9;}{\s28\li140\sb240\sa120\nowidctlpar\widctlpar\adjustright \b\f1\fs28\cgrid \sbasedon0 \snext19 index heading;}{\s29\li480\nowidctlpar\widctlpar\tqr\tldot\tx10080\adjustright \f12\cgrid \sbasedon0 \snext0 toc 3;}{\s30\li2160\nowidctlpar\widctlpar\tqr\tldot\tx10080\adjustright \cgrid \sbasedon0 \snext0 toc 2;}{\s31\li720\nowidctlpar\widctlpar\tqr\tldot\tx10080\adjustright \f12\cgrid \sbasedon0 \snext0 toc 4;}{\s32\li960\nowidctlpar\widctlpar\tqr\tldot\tx10080\adjustright \f12\cgrid \sbasedon0 \snext0 toc 5;}{\s33\li1200\nowidctlpar\widctlpar\tqr\tldot\tx10080\adjustright \f12\cgrid \sbasedon0 \snext0 toc 6;}{\s34\li1440\nowidctlpar\widctlpar\tqr\tldot\tx10080\adjustright \f12\cgrid \sbasedon0 \snext0 toc 7;}{\s35\li1680\nowidctlpar\widctlpar\tqr\tldot\tx10080\adjustright \f12\cgrid \sbasedon0 \snext0 toc 8;}{\s36\li1920\nowidctlpar\widctlpar\tqr\tldot\tx10080\adjustright \f12\cgrid \sbasedon0 \snext0 toc 9;}{\s37\nowidctlpar\widctlpar\adjustright \b\f6\fs20\cgrid \sbasedon0 \snext37 Command;}{\s38\nowidctlpar\widctlpar\adjustright \f6\fs20\cgrid \snext38 Variable Name;}}{\*\revtbl {Unknown;}}{\info{\title GNO Shell User's Manual}{\author Lisa K Holsberg}{\operator Lisa K Holsberg}{\creatim\yr1997\mo8\dy27\hr16\min7}{\revtim\yr1997\mo8\dy27\hr16\min7}{\printim\yr1996\mo8\dy7\hr23\min48}{\version2}{\edmins0}{\nofpages10}{\nofwords17329}{\nofchars98780}{\*\company Promethean Enterprises}{\nofcharsws121308}{\vern71}}\margl1080\margr1080\margb720 \facingp\widowctrl\ftnbj\aenddoc\hyphhotz0\margmirror\sprstsp\otblrul\brkfrm\sprstsm\truncex\nolead\msmcap\lytprtmet\hyphcaps0\viewkind1\viewscale83\viewzk2\pgbrdrhead\pgbrdrfoot \fet0\sectd \pgnrestart\linex0\endnhere\sectdefaultcl {\footerl \pard\plain \s17\nowidctlpar\widctlpar\brdrb\brdrs\brdrw30\brsp20 \tqc\tx4320\tqr\tx10080\adjustright \f12\cgrid { +\par }\pard \s17\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright {\field{\*\fldinst {\cs15\b PAGE }}{\fldrslt {\cs15\b\lang1024 4}}}{ +\par }}{\*\pnseclvl1\pnucrm\pnstart1\pnindent720\pnhang{\pntxta .}}{\*\pnseclvl2\pnucltr\pnstart1\pnindent720\pnhang{\pntxta .}}{\*\pnseclvl3\pndec\pnstart1\pnindent720\pnhang{\pntxta .}}{\*\pnseclvl4\pnlcltr\pnstart1\pnindent720\pnhang{\pntxta )}}{\*\pnseclvl5\pndec\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}{\*\pnseclvl6\pnlcltr\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}{\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}{\*\pnseclvl8\pnlcltr\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}{\*\pnseclvl9\pnlcrm\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}\pard\plain \nowidctlpar\widctlpar\adjustright \f12\cgrid { +\par }\pard \nowidctlpar\widctlpar\adjustright { +\par +\par +\par +\par +\par +\par +\par +\par +\par +\par +\par +\par +\par +\par +\par +\par +\par +\par +\par +\par +\par +\par +\par +\par +\par +\par +\par +\par +\par +\par +\par +\par +\par +\par +\par +\par +\par +\par +\par }\pard \qr\nowidctlpar\widctlpar\adjustright {\b\f4\fs76 GNO Shell User's Manual +\par }\pard \qr\nowidctlpar\widctlpar\adjustright {\f4\fs36 By Tim Meekins, Albert Chin, and Jawaid Bazyar +\par Edited by Andrew Roughan}{\f4\fs36 +\par +\par }{\f4\fs36 +\par }\pard \nowidctlpar\widctlpar\adjustright {\f4\fs48 \page \page }{\f4\fs48 Table of Contents}{\f4 +\par }\pard \nowidctlpar\widctlpar\adjustright { +\par }\pard\plain \s16\ri720\nowidctlpar\widctlpar\tx2160\tqr\tldot\tx10080\adjustright \b\cgrid {\field\fldedit{\*\fldinst {\b0\f4 TOC \\f }}{\fldrslt {\lang1024 Chapter 1\tab Getting started with the GNO Shell\tab }{\field{\*\fldinst {\lang1024 GOTOBUTTON _Toc364095762 }{\field{\*\fldinst {\lang1024 PAGEREF _Toc364095762 }}{\fldrslt {\lang1024 5}}}}}{\lang1024 +\par }\pard\plain \s30\li2160\nowidctlpar\widctlpar\tqr\tldot\tx10080\adjustright \cgrid {\lang1024 Introduction\tab }{\field\flddirty{\*\fldinst {\lang1024 GOTOBUTTON _Toc364095763 }{\field{\*\fldinst {\lang1024 PAGEREF _Toc364095763 }}{\fldrslt {\lang1024 5}}}}}{\lang1024 +\par }\pard \s30\li2160\nowidctlpar\widctlpar\tqr\tldot\tx10080\adjustright {\lang1024 Customizing the Shell Environment\tab }{\field\flddirty{\*\fldinst {\lang1024 GOTOBUTTON _Toc364095764 }{\field{\*\fldinst {\lang1024 PAGEREF _Toc364095764 }}{\fldrslt {\lang1024 5}}}}}{\lang1024 +\par Invoking gsh\tab }{\field\flddirty{\*\fldinst {\lang1024 GOTOBUTTON _Toc364095765 }{\field{\*\fldinst {\lang1024 PAGEREF _Toc364095765 }}{\fldrslt {\lang1024 7}}}}}{\lang1024 +\par }\pard\plain \s16\ri720\nowidctlpar\widctlpar\tx2160\tqr\tldot\tx10080\adjustright \b\cgrid {\lang1024 Chapter 2\tab Interacting with the GNO Shell\tab }{\field{\*\fldinst {\lang1024 GOTOBUTTON _Toc364095766 }{\field{\*\fldinst {\lang1024 PAGEREF _Toc364095766 }}{\fldrslt {\lang1024 9}}}}}{\lang1024 +\par }\pard\plain \s30\li2160\nowidctlpar\widctlpar\tqr\tldot\tx10080\adjustright \cgrid {\lang1024 Executing Commands\tab }{\field\flddirty{\*\fldinst {\lang1024 GOTOBUTTON _Toc364095767 }{\field{\*\fldinst {\lang1024 PAGEREF _Toc364095767 }}{\fldrslt {\lang1024 9}}}}}{\lang1024 +\par }\pard \s30\li2160\nowidctlpar\widctlpar\tqr\tldot\tx10080\adjustright {\lang1024 Command-line Editor\tab }{\field\flddirty{\*\fldinst {\lang1024 GOTOBUTTON _Toc364095768 }{\field{\*\fldinst {\lang1024 PAGEREF _Toc364095768 }}{\fldrslt {\lang1024 9}}}}}{\lang1024 +\par Command Input\tab }{\field\flddirty{\*\fldinst {\lang1024 GOTOBUTTON _Toc364095769 }{\field{\*\fldinst {\lang1024 PAGEREF _Toc364095769 }}{\fldrslt {\lang1024 10}}}}}{\lang1024 +\par Command Editing\tab }{\field\flddirty{\*\fldinst {\lang1024 GOTOBUTTON _Toc364095770 }{\field{\*\fldinst {\lang1024 PAGEREF _Toc364095770 }}{\fldrslt {\lang1024 10}}}}}{\lang1024 +\par History Editing Keys\tab }{\field\flddirty{\*\fldinst {\lang1024 GOTOBUTTON _Toc364095771 }{\field{\*\fldinst {\lang1024 PAGEREF _Toc364095771 }}{\fldrslt {\lang1024 12}}}}}{\lang1024 +\par Command, Filename and Variable completion\tab }{\field\flddirty{\*\fldinst {\lang1024 GOTOBUTTON _Toc364095772 }{\field{\*\fldinst {\lang1024 PAGEREF _Toc364095772 }}{\fldrslt {\lang1024 12}}}}}{\lang1024 +\par }\pard\plain \s16\ri720\nowidctlpar\widctlpar\tx2160\tqr\tldot\tx10080\adjustright \b\cgrid {\lang1024 Chapter 3\tab Using the GNO Shell more productively\tab }{\field{\*\fldinst {\lang1024 GOTOBUTTON _Toc364095773 }{\field{\*\fldinst {\lang1024 PAGEREF _Toc364095773 }}{\fldrslt {\lang1024 15}}}}}{\lang1024 +\par }\pard\plain \s30\li2160\nowidctlpar\widctlpar\tqr\tldot\tx10080\adjustright \cgrid {\lang1024 What does this command do?\tab }{\field\flddirty{\*\fldinst {\lang1024 GOTOBUTTON _Toc364095774 }{\field{\*\fldinst {\lang1024 PAGEREF _Toc364095774 }}{\fldrslt {\lang1024 15}}}}}{\lang1024 +\par }\pard \s30\li2160\nowidctlpar\widctlpar\tqr\tldot\tx10080\adjustright {\lang1024 Option Arguments\tab }{\field\flddirty{\*\fldinst {\lang1024 GOTOBUTTON _Toc364095775 }{\field{\*\fldinst {\lang1024 PAGEREF _Toc364095775 }}{\fldrslt {\lang1024 15}}}}}{\lang1024 +\par Entering Multiple commands\tab }{\field\flddirty{\*\fldinst {\lang1024 GOTOBUTTON _Toc364095776 }{\field{\*\fldinst {\lang1024 PAGEREF _Toc364095776 }}{\fldrslt {\lang1024 17}}}}}{\lang1024 +\par Using Aliases as Shorthand\tab }{\field\flddirty{\*\fldinst {\lang1024 GOTOBUTTON _Toc364095777 }{\field{\*\fldinst {\lang1024 PAGEREF _Toc364095777 }}{\fldrslt {\lang1024 17}}}}}{\lang1024 +\par Redirecting Input and Output\tab }{\field\flddirty{\*\fldinst {\lang1024 GOTOBUTTON _Toc364095778 }{\field{\*\fldinst {\lang1024 PAGEREF _Toc364095778 }}{\fldrslt {\lang1024 18}}}}}{\lang1024 +\par Pipelines\tab }{\field\flddirty{\*\fldinst {\lang1024 GOTOBUTTON _Toc364095779 }{\field{\*\fldinst {\lang1024 PAGEREF _Toc364095779 }}{\fldrslt {\lang1024 19}}}}}{\lang1024 +\par Job Control\tab }{\field\flddirty{\*\fldinst {\lang1024 GOTOBUTTON _Toc364095780 }{\field{\*\fldinst {\lang1024 PAGEREF _Toc364095780 }}{\fldrslt {\lang1024 21}}}}}{\lang1024 +\par Working with Pathnames\tab }{\field\flddirty{\*\fldinst {\lang1024 GOTOBUTTON _Toc364095781 }{\field{\*\fldinst {\lang1024 PAGEREF _Toc364095781 }}{\fldrslt {\lang1024 24}}}}}{\lang1024 +\par Pathname Expansion\tab }{\field\flddirty{\*\fldinst {\lang1024 GOTOBUTTON _Toc364095782 }{\field{\*\fldinst {\lang1024 PAGEREF _Toc364095782 }}{\fldrslt {\lang1024 24}}}}}{\lang1024 +\par Quoting Special Characters\tab }{\field\flddirty{\*\fldinst {\lang1024 GOTOBUTTON _Toc364095783 }{\field{\*\fldinst {\lang1024 PAGEREF _Toc364095783 }}{\fldrslt {\lang1024 26}}}}}{\lang1024 +\par How gsh Finds a Command\tab }{\field\flddirty{\*\fldinst {\lang1024 GOTOBUTTON _Toc364095784 }{\field{\*\fldinst {\lang1024 PAGEREF _Toc364095784 }}{\fldrslt {\lang1024 27}}}}}{\lang1024 +\par }\pard\plain \s16\ri720\nowidctlpar\widctlpar\tx2160\tqr\tldot\tx10080\adjustright \b\cgrid {\lang1024 Chapter 4\tab Built-in Commands\tab }{\field{\*\fldinst {\lang1024 GOTOBUTTON _Toc364095785 }{\field{\*\fldinst {\lang1024 PAGEREF _Toc364095785 }}{\fldrslt {\lang1024 29}}}}}{\lang1024 +\par }\pard\plain \s30\li2160\nowidctlpar\widctlpar\tqr\tldot\tx10080\adjustright \cgrid {\lang1024 Built-ins vs EXE Commands\tab }{\field\flddirty{\*\fldinst {\lang1024 GOTOBUTTON _Toc364095786 }{\field{\*\fldinst {\lang1024 PAGEREF _Toc364095786 }}{\fldrslt {\lang1024 29}}}}}{\lang1024 +\par }\pard \s30\li2160\nowidctlpar\widctlpar\tqr\tldot\tx10080\adjustright {\lang1024 Shell Commands\tab }{\field\flddirty{\*\fldinst {\lang1024 GOTOBUTTON _Toc364095787 }{\field{\*\fldinst {\lang1024 PAGEREF _Toc364095787 }}{\fldrslt {\lang1024 29}}}}}{\lang1024 +\par Kernel Commands\tab }{\field\flddirty{\*\fldinst {\lang1024 GOTOBUTTON _Toc364095788 }{\field{\*\fldinst {\lang1024 PAGEREF _Toc364095788 }}{\fldrslt {\lang1024 33}}}}}{\lang1024 +\par Environment Commands\tab }{\field\flddirty{\*\fldinst {\lang1024 GOTOBUTTON _Toc364095789 }{\field{\*\fldinst {\lang1024 PAGEREF _Toc364095789 }}{\fldrslt {\lang1024 35}}}}}{\lang1024 +\par }\pard\plain \s16\ri720\nowidctlpar\widctlpar\tx2160\tqr\tldot\tx10080\adjustright \b\cgrid {\lang1024 Chapter 5\tab Shell Variables\tab }{\field{\*\fldinst {\lang1024 GOTOBUTTON _Toc364095790 }{\field{\*\fldinst {\lang1024 PAGEREF _Toc364095790 }}{\fldrslt {\lang1024 39}}}}}{\lang1024 +\par }\pard\plain \s30\li2160\nowidctlpar\widctlpar\tqr\tldot\tx10080\adjustright \cgrid {\lang1024 Using shell variables\tab }{\field\flddirty{\*\fldinst {\lang1024 GOTOBUTTON _Toc364095791 }{\field{\*\fldinst {\lang1024 PAGEREF _Toc364095791 }}{\fldrslt {\lang1024 39}}}}}{\lang1024 +\par }\pard \s30\li2160\nowidctlpar\widctlpar\tqr\tldot\tx10080\adjustright {\lang1024 Scope\tab }{\field\flddirty{\*\fldinst {\lang1024 GOTOBUTTON _Toc364095792 }{\field{\*\fldinst {\lang1024 PAGEREF _Toc364095792 }}{\fldrslt {\lang1024 39}}}}}{\lang1024 +\par Description of Pre-defined Shell Variables\tab }{\field\flddirty{\*\fldinst {\lang1024 GOTOBUTTON _Toc364095793 }{\field{\*\fldinst {\lang1024 PAGEREF _Toc364095793 }}{\fldrslt {\lang1024 39}}}}}{\lang1024 +\par Accessing shell variables\tab }{\field\flddirty{\*\fldinst {\lang1024 GOTOBUTTON _Toc364095794 }{\field{\*\fldinst {\lang1024 PAGEREF _Toc364095794 }}{\fldrslt {\lang1024 42}}}}}{\lang1024 +\par }\pard\plain \s16\ri720\nowidctlpar\widctlpar\tx2160\tqr\tldot\tx10080\adjustright \b\cgrid {\lang1024 Appendix A\tab Sample gsh session\tab }{\field{\*\fldinst {\lang1024 GOTOBUTTON _Toc364095795 }{\field{\*\fldinst {\lang1024 PAGEREF _Toc364095795 }}{\fldrslt {\lang1024 45}}}}}{\lang1024 +\par }\pard \s16\ri720\nowidctlpar\widctlpar\tx2160\tqr\tldot\tx10080\adjustright {\lang1024 Appendix B\tab Prefix Conventions\tab }{\field{\*\fldinst {\lang1024 GOTOBUTTON _Toc364095796 }{\field{\*\fldinst {\lang1024 PAGEREF _Toc364095796 }}{\fldrslt {\lang1024 51}}}}}{\lang1024 +\par Appendix C\tab Errors\tab }{\field{\*\fldinst {\lang1024 GOTOBUTTON _Toc364095797 }{\field{\*\fldinst {\lang1024 PAGEREF _Toc364095797 }}{\fldrslt {\lang1024 52}}}}}{\lang1024 +\par Appendix D\tab Signals\tab }{\field{\*\fldinst {\lang1024 GOTOBUTTON _Toc364095798 }{\field{\*\fldinst {\lang1024 PAGEREF _Toc364095798 }}{\fldrslt {\lang1024 55}}}}}{\lang1024 +\par Appendix E\tab Non-Compliant Applications\tab }{\field{\*\fldinst {\lang1024 GOTOBUTTON _Toc364095799 }{\field{\*\fldinst {\lang1024 PAGEREF _Toc364095799 }}{\fldrslt {\lang1024 57}}}}}{\lang1024 +\par Appendix F\tab Termcaps\tab }{\field{\*\fldinst {\lang1024 GOTOBUTTON _Toc364095800 }{\field{\*\fldinst {\lang1024 PAGEREF _Toc364095800 }}{\fldrslt {\lang1024 59}}}}}{\lang1024 +\par Glossary\tab \tab }{\field{\*\fldinst {\lang1024 GOTOBUTTON _Toc364095801 }{\field{\*\fldinst {\lang1024 PAGEREF _Toc364095801 }}{\fldrslt {\lang1024 60}}}}}{\lang1024 +\par }}}\pard\plain \s16\ri720\nowidctlpar\widctlpar\tx2160\tqr\tldot\tx10080\adjustright \b\cgrid {Index\tab \tab 63 +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \f12\cgrid { +\par \page \sect }\sectd \psz1\linex0\endnhere\titlepg\sectdefaultcl {\headerl \pard\plain \s18\nowidctlpar\widctlpar\tqr\tx10080\adjustright \b\f1\ul\cgrid {Getting started with the GNO Shell\tab Chapter 1 +\par }}{\headerr \pard\plain \s18\nowidctlpar\widctlpar\tqr\tx10080\adjustright \b\f1\ul\cgrid {Chapter 1\tab Getting started with the GNO Shell +\par }}{\footerl \pard\plain \s17\nowidctlpar\widctlpar\brdrb\brdrs\brdrw30\brsp20 \tqc\tx4320\tqr\tx10080\adjustright \f12\cgrid { +\par }\pard \s17\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright {\field{\*\fldinst {\cs15\b PAGE }}{\fldrslt {\cs15\b\lang1024 8}}}{ +\par }}{\footerr \pard\plain \s17\nowidctlpar\widctlpar\brdrb\brdrs\brdrw30\brsp20 \tqc\tx4320\tqr\tx10080\adjustright \f12\cgrid { +\par }\pard \s17\qr\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright {\field{\*\fldinst {\cs15\b PAGE }}{\fldrslt {\cs15\b\lang1024 7}}}{ +\par }}{\headerf \pard\plain \s18\nowidctlpar\widctlpar\tqr\tx10080\adjustright \b\f1\ul\cgrid { +\par }}\pard\plain \nowidctlpar\widctlpar\adjustright \f12\cgrid {\f4\fs48 Chapter 1 +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4\fs48 Getting started with the GNO Shell}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\fs48\cgrid {\tc {\f4\fs48 {\*\bkmkstart _Toc364095762}Getting started with the GNO Shell{\*\bkmkend _Toc364095762}\tcl1}}}{\f4\fs48 +\par }\pard \qr\nowidctlpar\widctlpar\adjustright {\f4\fs20 "Computer operating systems are among the most complex objects created by mankind..." +\par Douglas Comer, Operating System Design, The Xinu Approach +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 +\par +\par }{\b\f4 Introduction}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \b\v\f4\cgrid {\tc {\b\f4 {\*\bkmkstart _Toc364095763}Introduction{\*\bkmkend _Toc364095763}\tcl1}}}{\f4 +\par +\par The GNO shell}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GNO shell}}}{\f4 is an integral part of the GNO Multitasking Environment (GNO/ME}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GNO/ME}}}{\f4 ). The GNO shell provides the interface between the user and the GNO Kernel}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GNO Kernel}}}{\f4 . While both work together, the jobs they perform are quite different. This manual documents the functions of the shell. +\par +\par The user interacts with the shell through a command-line}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 command-line}}}{\f4 interface. Command-line interfaces provide a unique way of interacting with the operating system. Unlike GUI}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GUI}}}{\f4 s (Graphical User Interfaces), with which you are already familiar with by using programs such as the Finder and ShrinkIt! GS, all commands are typically entered using the keyboard. The shell interprets commands and passes them to the kernel for control and execution. +\par +\par The command-line interface will be unfamiliar to some people However, once the command-line interface has been mastered, the user should have no difficulty using any current or future GNO applications. Those of you already familiar with Unix interfaces, such as the C shell}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 C shell}}}{\f4 , Bourne shell}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 Bourne shell}}}{\f4 , and Korn shell}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 Korn shell}}}{\f4 , or the ORCA shell}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 ORCA shell}}}{\f4 on the Apple IIGS, will begin to realize the advantages which GNO/ME}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GNO/ME}}}{\f4 is able to provide. +\par +\par The way this manual is presented allows the complete beginner to simply work through the chapters in a chronological prder. Chapter 2 familiarises the user with entering basic commands whereas the more powerful GNO/ME}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GNO/ME}}}{\f4 features are introduced in Chapter 3. Chapter 4 documents the commands which are built into the GNO Shell}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GNO Shell}}}{\f4 and Chapter 5 explains shell variables}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 variables}}}{\f4 which give the user control over how thier installation functions. +\par +\par +\par }{\b\f4 Customizing the Shell Environment}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \b\v\f4\cgrid {\tc {\b\f4 {\*\bkmkstart _Toc364095764}Customizing the Shell Environment{\*\bkmkend _Toc364095764}\tcl1}}}{\f4 +\par +\par When }{\b\f4 gsh}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 gsh}}}{\f4 , the implimentation of the GNO Shell}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GNO Shell}}}{\f4 , is executed, it reads in and processes the }{\i\f4 gshrc}{\f4 }{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\i\f4 gshrc }}}{\f4 file. This file contains start-up instructions for the shell, which can be used to customize the operation of the shell and other aspects of the system. It is created by the GNO Installer}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GNO Installer}}}{\f4 during the installation process. +\par +\par The following is a sample }{\i\f4 gshrc}{\f4 file (line numbers have been added for convenience): +\par }\pard\plain \s18\nowidctlpar\widctlpar\tqr\tx10080\adjustright \b\f1\ul\cgrid { +\par }\pard\plain \nowidctlpar\widctlpar\tx720\tqr\tx7920\adjustright \f12\cgrid {\f6\fs20 \tab ###\tab line #1 +\par }\pard \nowidctlpar\widctlpar\tx720\tqr\tx7920\adjustright {\f6\fs20 \tab #\tab line #2 +\par \tab # GNO 2.0 gshrc file\tab line #3 +\par \tab #\tab line #4 +\par \tab ###\tab line #5 +\par \tab #\tab line #6 +\par \tab # Initialize our environment\tab line #7 +\par \tab #\tab line #8 +\par \tab set path=":hard:gno:bin :hard:gno:usr:bin"\tab line #9 +\par \tab set prompt="[%h] %S%t%s %C> "\tab line #10 +\par \tab set home=":hard:gno:user:root"\tab line #11 +\par \tab set term=gnocon\tab line #12 +\par \tab export path prompt home term\tab line #13 +\par \tab setenv history=100 savehist=25\tab line #14 +\par \tab ###\tab line #15 +\par \tab #\tab line #16 +\par \tab #Set up standard prefixes for utilities.\tab line #17 +\par \tab #\tab line #18 +\par \tab ###\tab line #19 +\par \tab prefix 2 :software:orca:libraries\tab line #20 +\par }\pard \nowidctlpar\widctlpar\tx720\tqr\tx7920\adjustright {\f6\fs20 \tab prefix 3 :software:orca\tab line #21 +\par }\pard \nowidctlpar\widctlpar\tx720\tqr\tx7920\adjustright {\f6\fs20 \tab prefix 4 :software:orca:shell\tab line #22 +\par \tab prefix 5 :software:orca:languages\tab line #23 +\par \tab prefix 6 :software:orca:utilities\tab line #24 +\par \tab prefix 7 :tmp\tab line #25 +\par \tab ###\tab line #26 +\par \tab #\tab line #27 +\par \tab # Set up prefixes for Orca2.0(tm)'s benefit\tab line #28 +\par \tab #\tab line #29 +\par \tab ###\tab line #30 +\par \tab prefix 13 :software:orca:libraries\tab line #31 +\par \tab prefix 14 :software:orca\tab line #32 +\par \tab prefix 15 :software:orca:shell\tab line #33 +\par \tab prefix 16 :software:orca:languages\tab line #34 +\par \tab prefix 17 :software:orca:utilities\tab line #35 +\par \tab alias ls 'ls -CF'\tab line #36 +\par \tab alias dir 'ls -al'\tab line #37 +\par \tab alias cp 'cp -i'\tab line #38 +\par \tab alias rm 'cp -p rm'\tab line #39 +\par \tab alias mv 'cp -p mv'\tab line #40 +\par \tab setenv usrman='/usr/man'\tab line #41 +\par \tab set fignore='.a .root .sym'\tab line #42 +\par \tab alias zcat 'compress -cd'\tab line #43 +\par \tab setenv pager=less\tab line #44 +\par \tab setenv less=-e\tab line #45 +\par \tab set nonewline=1\tab line #46 +\par \tab #\tab line #47 +\par \tab # Move to home directory\tab line #48 +\par \tab #\tab line #49 +\par \tab cd\tab line #50 +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 +\par When you install GNO/ME}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GNO/ME}}}{\f4 , the GNO installer}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GNO installer}}}{\f4 knows where to find the GNO utilities and any ORCA}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 ORCA}}}{\f4 utilities you may have. Unfortunately it does not know where all the other utilities and applications that you may wish to use are located. It is therefore necessary to edit the setup file in order to tell the GNO shell}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GNO shell}}}{\f4 where these programs are on your hard disk. +\par +\par The setup file, }{\i\f4 gshrc}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\i\f4 gshrc}}}{\v\f4 ,}{\f4 is located in the /usr directory of the path where you installed GNO/ME}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GNO/ME}}}{\f4 . You can use any text editor}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 editor}}}{\f4 from the desktop to edit the }{\i\f4 gshrc}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\i\f4 gshrc}}}{\f4 file, or if you are already familiar with the editor}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 editor}}}{\f4 }{\b\f4 vi}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 vi}}}{\f4 you can use this utility after launching the GNO kernel}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GNO kernel}}}{\f4 . +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 +\par Line 9 is the statement that we are concerned with. }{\b\f4 Hard }{\f4 represents the name of your particular hard drive volume where you have installed GNO/ME. +\par +\par }\pard \nowidctlpar\widctlpar\tx720\tqr\tx7920\adjustright {\f6\fs20 \tab set path=":hard:gno:bin :hard:gno:usr:bin"\tab line #9 +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 You will see that spaces have been inserted between pathnames. The space is the pathname separator}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 pathname separator}}}{\f4 and the colon has been used as the path delimiter}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 path delimiter}}}{\f4 for this specific variable, PATH}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 PATH}}}{\f4 . As an exercise, add your system directory to this statement. Line 9 should now look like this: +\par +\par }{\f6\fs20 \tab set path=":hard:gno:bin :hard:gno:usr:bin :hard:system" +\par }{\f4 +\par What you have just done allows the GNO shell}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GNO shell}}}{\f4 to find the }{\b\f4 Finder}{\f4 application. Now go ahead and add any pathnames that hold utilities or applications that you will use frequently from GNO/ME}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GNO/ME}}}{\f4 . It should also be noted that it is possible to have more than one pathname containing EXE}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 EXE}}}{\f4 , SYS16}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 SYS16}}}{\f4 , or EXEC}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 EXEC}}}{\f4 files; this is impossible under ORCA}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 ORCA}}}{\f4 . The PATH}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 PATH}}}{\f4 variable is discussed thoroughly in Chapter 5. +\par +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 For now, the remaining lines of the }{\i\f4 gshrc}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\i\f4 gshrc}}}{\f4 file do not need editing. As you gain an understanding of the system you may wish to make further changes to the }{\i\f4 gshrc}{\f4 }{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\i\f4 gshrc }}}{\f4 file. Make sure you save the file before you exit the editor}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 editor}}}{\f4 . +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 +\par It is possible to modify these instructions while the GNO shell}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GNO shell}}}{\f4 is active, but any changes will be lost upon exiting }{\b\f4 gsh}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 gsh}}}{\b\f4 .}{\f4 If you wish the changes to remain effective for the next session you must add them to the }{\i\f4 gshrc}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\i\f4 gshrc}}}{\f4 file. +\par +\par By customizing the }{\i\f4 gshrc}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\i\f4 gshrc}}}{\f4 file it is possible to make the GNO environment more like U}{\f4\fs20 NIX}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 UNIX}}}{\f4\fs20 , }{\f4 the ORCA }{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 ORCA }}}{\f4 environment, or something completly different. Customization of the GNO environment leads to greater user productivity. +\par }\pard \nowidctlpar\widctlpar\adjustright {\f4 +\par +\par }{\b\f4 Invoking }{\v\f4 .i.}{\b\f4 gsh}{\pard\plain \nowidctlpar\widctlpar\adjustright \b\v\f4\cgrid {\tc {\b\f4 {\*\bkmkstart _Toc364095765}Invoking .i.gsh{\*\bkmkend _Toc364095765}\tcl1}}}{\f4 +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 GNO/ME can be launched from a program launcher, such as the System 6.0 Finder. Launch the GNO Kernel}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GNO Kernel}}}{\f4 program, }{\b\f4 kern}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 kern}}}{\f4 by double clicking on it. The GNO kernel}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GNO kernel}}}{\f4 automatically executes the supplied GNO shell}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GNO shell}}}{\f4 , }{\b\f4 gsh}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 gsh}}}{\f4 . +\par +\par The prompt}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 prompt}}}{\f4 , "[1] 2:00am root }{\f6\fs20 %}{\f4 ", indicates that }{\b\f4 gsh}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 gsh}}}{\f4 is ready to receive input from the keyboard. +\par +\par To start a new }{\b\f4 gsh}{\f4 from the command-line simply type }{\b\f4 gsh}{\f4 . If multiple copies of the }{\b\f4 gsh}{\f4 process are undesirable, use the command }{\b\f4 source}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 source}}}{\b\f4 gsh}{\f4 instead. This is useful for testing changes made to the }{\i\f4 gshrc}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\i\f4 gshrc}}}{\f4 file. }{\b\f4 Source}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 Source}}}{\f4 is a built-in comand which is discussed in Chapter 4 }{\b\f4 Shell commands}{\f4 . +\par }{\f4 \page \sect }\sectd \psz1\linex0\endnhere\titlepg\sectdefaultcl {\headerl \pard\plain \s18\nowidctlpar\widctlpar\tqr\tx10080\adjustright \b\f1\ul\cgrid {Interacting with the GNO Shell\tab Chapter 2 +\par }}{\headerr \pard\plain \s18\nowidctlpar\widctlpar\tqr\tx10080\adjustright \b\f1\ul\cgrid {Chapter 2\tab Interacting with the GNO Shell +\par }}{\footerl \pard\plain \s17\nowidctlpar\widctlpar\brdrb\brdrs\brdrw30\brsp20 \tqc\tx4320\tqr\tx10080\adjustright \f12\cgrid { +\par }\pard \s17\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright {\field{\*\fldinst {\cs15 PAGE }}{\fldrslt {\cs15\lang1024 10}}}{ +\par }}{\footerr \pard\plain \s17\nowidctlpar\widctlpar\brdrb\brdrs\brdrw30\brsp20 \tqc\tx4320\tqr\tx10080\adjustright \f12\cgrid { +\par }\pard \s17\qr\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright {\field{\*\fldinst {\cs15 PAGE }}{\fldrslt {\cs15\lang1024 35}}}{ +\par }}\pard\plain \qj\nowidctlpar\widctlpar\adjustright \f12\cgrid {\f4\fs48 Chapter 2 +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4\fs48 Interacting with the GNO Shell}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\fs48\cgrid {\tc {\f4\fs48 {\*\bkmkstart _Toc364095766}Interacting with the GNO Shell{\*\bkmkend _Toc364095766}\tcl1}}}{\f4\fs48 +\par }{\f6 +\par +\par +\par }{\b\f4 Executing Commands}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \b\v\f4\cgrid {\tc {\b\f4 {\*\bkmkstart _Toc364095767}Executing Commands{\*\bkmkend _Toc364095767}\tcl1}}}{\f4 +\par +\par A command consists of two parts: a name and its arguments. The command name}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 command name}}}{\f4 is the name used to start the command. The name is usually the name of a file which can be executed. The only exceptions are commands which are built-in to the shell. These commands are documented in Chapter 4 }{\b\f4 Built-In Commands}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 Built-In Commands}}}{\f4 . Any shell utility command with a filetype of EXE}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 EXE}}}{\f4 , SYS16}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 SYS16}}}{\f4 , or EXEC}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 EXEC}}}{\v\f4 ,}{\f4 can be executed in this fashion. The command name must be separated from the command arguments with a space. +\par +\par The command arguments}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 command arguments}}}{\f4 are parameters}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 parameters}}}{\f4 that the command takes as data to work with (In Applesoft BASIC, "}{\f6\fs20 HELLO WORLD}{\f4 " would be an argument for the }{\f6\fs20 PRINT}{\f4 command). Command arguments are separated from each other with a space. Note that although arguments extend the usefulness of a command, not all commands have arguments. Any arguments entered after the command will be passed by the shell to the program when it starts exectuting. +\par +\par The examples below use the following commands: +\par }\pard \qj\nowidctlpar\widctlpar\tx720\tx2880\adjustright {\f4 \tab }{\b\f6\fs20 qtime}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tx2880\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\b\f6\fs20 qtime}}}{\f4 \tab displays time in English text. +\par \tab }{\b\f6\fs20 echo}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tx2880\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\b\f6\fs20 echo}}}{\f4 \tab prints arguments to the screen. +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 +\par Examples: +\par }{\f6\fs20 \tab % }{\b\f6\fs20 qtime}{\f6\fs20 +\par \tab It's almost five. +\par \tab % }{\b\f6\fs20 echo II Infinitum}{\f6\fs20 +\par \tab II Infinitum +\par }{\f4 +\par At the simplest level the user enters commands to the shell by typing them on the keyboard. }{\b\f4 Gsh}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 Gsh}}}{\f4 includes a command-line}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 command-line}}}{\f4 editor to help the user enter and edit commands. The editor also provides a way to modify and execute previous commands. Additionally the editor can help complete the names of commands, filenames and variables. +\par +\par +\par }{\b\f4 Command-line Editor}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \b\v\f4\cgrid {\tc {\b\f4 {\*\bkmkstart _Toc364095768}Command-line Editor{\*\bkmkend _Toc364095768}\tcl1}}}{\f4 +\par +\par Below is a complete description of the functions of the command-line editor}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 command-line editor}}}{\f4 with short examples depicting how each editing key works. +\par +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 Throughout the examples the underline character, "}{\f6\fs20 _}{\f4 ", will be used to represent the current cursor position. In addition, "OA}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 OA}}}{\f4 " is used to represent the Open Apple}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 Open Apple}}}{\f4 key and the term }{\i\f4 word}{\f4 }{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\i\f4 word }}}{\f4 is used to indicate a string of characters consisting of only letters, digits, and underscores. To the right of a editing key entry is the }{\f6\fs20 bindkey}{\f4\fs20 }{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 bindkey }}}{\f4 function name which is used to remap editing functions to new keys. This information is included for reference purposes only. See Chapter 4 }{\b\f4 Shell Commands}{\f4 for more information on the }{\f6\fs20 bindkey}{\f4 command. +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 +\par It should be pointed out that at this stage that the user should not be concerned with what the actual commands used in the examples do, rather the user should concentrate on how the command-line editor functions work. +\par +\par }{\b\f4 Command Input}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \b\v\f4\cgrid {\tc {\b\f4 {\*\bkmkstart _Toc364095769}Command Input{\*\bkmkend _Toc364095769}\tcl1}}}{\f4 +\par }\pard \qj\fi-1440\li1440\nowidctlpar\widctlpar\adjustright {\f6\fs20 +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f6\fs20 These command-line editor keys deal with entering text directly on the command-line. +\par }\pard \qj\fi-1440\li1440\nowidctlpar\widctlpar\adjustright {\f6\fs20 +\par RETURN}{\pard\plain \qj\fi-1440\li1440\nowidctlpar\widctlpar\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 RETURN}}}{\f4 \tab }{\b\f6\fs20 newline}{\pard\plain \qj\fi-1440\li1440\nowidctlpar\widctlpar\adjustright \b\v\f6\fs20\cgrid {\xe {\b\f6\fs20 newline}}}{\f4 +\par \tab The return key is used to terminate line input. }{\b\f4 gsh}{\f4 then interprets the command on the line and acts accordingly. The position of the cursor on the command-line does not matter. +\par \tab }{\f6\fs20 Before +\par \tab % }{\b\f6\fs20 echo f}{\b\f6\fs20\ul o}{\b\f6\fs20 o bar}{\f6\fs20 \tab (RETURN) +\par \tab After +\par \tab foo bar +\par \tab % _}{\f4 +\par +\par }{\f6\fs20 CTRL-D}{\pard\plain \qj\fi-1440\li1440\nowidctlpar\widctlpar\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 CTRL-D}}}{\f4 \tab +\par \tab Exits }{\b\f4 gsh}{\f4 if it was the first character typed on the command-line. If there are still jobs running in the background or stopped, }{\b\f4 gsh}{\f4 will display "}{\f6\fs20 There are stopped jobs.}{\f4 " If you press }{\f6\fs20 CTRL-D}{\f4 a second time without an intervening command, }{\b\f4 gsh}{\f4 will terminate all the jobs in the job list and exit. +\par +\par }{\f6\fs20 CTRL-R}{\pard\plain \qj\fi-1440\li1440\nowidctlpar\widctlpar\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 CTRL-R}}}{\f4 \tab }{\b\f6\fs20 redraw}{\pard\plain \qj\fi-1440\li1440\nowidctlpar\widctlpar\adjustright \b\v\f6\fs20\cgrid {\xe {\b\f6\fs20 redraw}}}{\f4 +\par \tab Moves to the next line and re-displays the current command-line. Use this to redraw the current line if the screen becomes garbled. +\par }\pard \qj\fi-1440\li1440\nowidctlpar\widctlpar\tx1440\tx3600\tx5760\adjustright {\f6\fs20 +\par CTRL-L}{\pard\plain \qj\fi-1440\li1440\nowidctlpar\widctlpar\tx1440\tx3600\tx5760\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 CTRL-L}}}{\f4 \tab }{\b\f6\fs20 clear-screen}{\pard\plain \qj\fi-1440\li1440\nowidctlpar\widctlpar\tx1440\tx3600\tx5760\adjustright \b\v\f6\fs20\cgrid {\xe {\b\f6\fs20 clear-screen}}}{\f6\fs20 +\par }{\f4 \tab Clears the screen, moves the cursor to the top line, and redraws the prompt and any command-line that was in the process of being edited. +\par }\pard \qj\fi-1440\li1440\nowidctlpar\widctlpar\adjustright {\f4 +\par +\par }{\b\f4 Command Editing}{\pard\plain \qj\fi-1440\li1440\nowidctlpar\widctlpar\adjustright \b\v\f4\cgrid {\tc {\b\f4 {\*\bkmkstart _Toc364095770}Command Editing{\*\bkmkend _Toc364095770}\tcl1}}}{\f4 +\par }\pard \qj\fi-1440\li1440\nowidctlpar\widctlpar\tx1440\tx3600\tx5760\adjustright {\f6\fs20 +\par These command-line editor keys allow editing of the command-line text. +\par +\par CTRL-B}{\pard\plain \qj\fi-1440\li1440\nowidctlpar\widctlpar\tx1440\tx3600\tx5760\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 CTRL-B}}}{\f6\fs20 \tab }{\b\f6\fs20 backward-char}{\pard\plain \qj\fi-1440\li1440\nowidctlpar\widctlpar\tx1440\tx3600\tx5760\adjustright \b\v\f6\fs20\cgrid {\xe {\b\f6\fs20 backward-char}}}{\f6\fs20 +\par LEFT-ARROW}{\pard\plain \qj\fi-1440\li1440\nowidctlpar\widctlpar\tx1440\tx3600\tx5760\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 LEFT-ARROW}}}{\f4 \tab Moves the cursor one character to the left. You cannot move past the first character on the line. If so, }{\b\f4 gsh}{\f4 will output an error beep. +\par }{\f6\fs20 \tab Before\tab \tab After +\par \tab % }{\b\f6\fs20 print f}{\b\f6\fs20\ul o}{\b\f6\fs20 o bar}{\f6\fs20 \tab (LEFT-ARROW)\tab % }{\b\f6\fs20 print }{\b\f6\fs20\ul f}{\b\f6\fs20 oo bar}{\f6\fs20 +\par }{\f4 +\par }{\f6\fs20 CTRL-F}{\pard\plain \qj\fi-1440\li1440\nowidctlpar\widctlpar\tx1440\tx3600\tx5760\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 CTRL-F}}}{\f6\fs20 \tab }{\b\f6\fs20 forward-char}{\pard\plain \qj\fi-1440\li1440\nowidctlpar\widctlpar\tx1440\tx3600\tx5760\adjustright \b\v\f6\fs20\cgrid {\xe {\b\f6\fs20 forward-char}}}{\f6\fs20 +\par RIGHT-ARROW}{\pard\plain \qj\fi-1440\li1440\nowidctlpar\widctlpar\tx1440\tx3600\tx5760\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 RIGHT-ARROW}}}{\f4 \tab Moves the cursor one character to the right. You cannot move past the last character on the line. If so, }{\b\f4 gsh}{\f4 will output an error beep. +\par }{\f6\fs20 \tab Before\tab \tab After +\par \tab % }{\b\f6\fs20 print f}{\b\f6\fs20\ul o}{\b\f6\fs20 o bar}{\f6\fs20 \tab (RIGHT-ARROW)\tab % }{\b\f6\fs20 print fo}{\b\f6\fs20\ul o}{\b\f6\fs20 bar}{\f6\fs20 +\par }{\f4 +\par }{\f4 +\par }{\f6\fs20 DELETE}{\pard\plain \qj\fi-1440\li1440\nowidctlpar\widctlpar\tx1440\tx3600\tx5760\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 DELETE}}}{\f4 \tab }{\b\f6\fs20 backward-delete-char}{\pard\plain \qj\fi-1440\li1440\nowidctlpar\widctlpar\tx1440\tx3600\tx5760\adjustright \b\v\f6\fs20\cgrid {\xe {\b\f6\fs20 backward-delete-char}}}{\f6\fs20 +\par }\pard \qj\fi-1440\li1440\nowidctlpar\widctlpar\tx1440\tx3600\tx5760\adjustright {\f4 \tab Deletes the character to the left of the cursor. You can delete up to the first character on the command-line. +\par }\pard \qj\fi-1440\li1440\nowidctlpar\widctlpar\tx1440\tx3600\tx5760\adjustright {\f6\fs20 \tab Before\tab \tab After +\par \tab % }{\b\f6\fs20 print f}{\b\f6\fs20\ul o}{\b\f6\fs20 o bar}{\f6\fs20 \tab (DELETE)\tab % }{\b\f6\fs20 print }{\b\f6\fs20\ul o}{\b\f6\fs20 o bar}{\f6\fs20 +\par }{\f4 +\par }{\f6\fs20 CLEAR}{\pard\plain \qj\fi-1440\li1440\nowidctlpar\widctlpar\tx1440\tx3600\tx5760\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 CLEAR}}}{\f6\fs20 \tab }{\b\f6\fs20 kill-whole-line}{\pard\plain \qj\fi-1440\li1440\nowidctlpar\widctlpar\tx1440\tx3600\tx5760\adjustright \b\v\f6\fs20\cgrid {\xe {\b\f6\fs20 kill-whole-line}}}{\f4 +\par }{\f6\fs20 CTRL-X}{\pard\plain \qj\fi-1440\li1440\nowidctlpar\widctlpar\tx1440\tx3600\tx5760\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 CTRL-X}}}{\f4 \tab Deletes all characters on the command line and positions the cursor after the prompt. +\par }{\f6\fs20 \tab Before\tab \tab After +\par \tab % }{\b\f6\fs20 prin}{\b\f6\fs20\ul t}{\b\f6\fs20 foo bar}{\f6\fs20 \tab (CTRL-X)\tab % }{\b\f6\fs20 _}{\f6\fs20 +\par }{\f4 +\par }{\pard\plain \qj\fi-1440\li1440\nowidctlpar\widctlpar\tx1440\tx3600\tx5760\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 }}}{\f6\fs20 +\par CTRL-Y}{\v\f6\fs20 ;}{\f4 \tab }{\b\f6\fs20 kill-end-of-line}{\pard\plain \qj\fi-1440\li1440\nowidctlpar\widctlpar\tx1440\tx3600\tx5760\adjustright \b\v\f6\fs20\cgrid {\xe {\b\f6\fs20 kill-end-of-line}}}{\f4 +\par \tab Deletes all characters from the cursor to the end of the command-line. +\par }{\f6\fs20 \tab Before\tab \tab After +\par \tab % }{\b\f6\fs20 print f}{\b\f6\fs20\ul o}{\b\f6\fs20 o bar}{\f6\fs20 \tab (CTRL-Y)\tab % }{\b\f6\fs20 print f_}{\f6\fs20 +\par }{\f4 +\par }{\f6\fs20 CTRL-D}{\pard\plain \qj\fi-1440\li1440\nowidctlpar\widctlpar\tx1440\tx3600\tx5760\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 CTRL-D}}}{\f6\fs20 \tab }{\b\f6\fs20 delete-char}{\pard\plain \qj\fi-1440\li1440\nowidctlpar\widctlpar\tx1440\tx3600\tx5760\adjustright \b\v\f6\fs20\cgrid {\xe {\b\f6\fs20 delete-char}}}{\f4 +\par }\pard \qj\fi-1440\li1440\nowidctlpar\widctlpar\tx1440\tx3600\tx5760\adjustright {\f6\fs20 OA-D}{\pard\plain \qj\fi-1440\li1440\nowidctlpar\widctlpar\tx1440\tx3600\tx5760\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 OA-D}}}{\f4 \tab Deletes the character under the cursor. +\par }{\f6\fs20 \tab Before\tab \tab After +\par \tab % }{\b\f6\fs20 print fo}{\b\f6\fs20\ul o}{\b\f6\fs20 bar}{\f6\fs20 \tab (OA-D)\tab % }{\b\f6\fs20 print fo}{\b\f6\fs20\ul }{\b\f6\fs20 bar}{\f6\fs20 +\par }{\f4 +\par }{\f6\fs20 CTRL-A}{\pard\plain \qj\fi-1440\li1440\nowidctlpar\widctlpar\tx1440\tx3600\tx5760\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 CTRL-A}}}{\f6\fs20 \tab }{\b\f6\fs20 beginning-of-line}{\pard\plain \qj\fi-1440\li1440\nowidctlpar\widctlpar\tx1440\tx3600\tx5760\adjustright \b\v\f6\fs20\cgrid {\xe {\b\f6\fs20 beginning-of-line}}}{\f4 +\par }{\f6\fs20 OA-<}{\pard\plain \qj\fi-1440\li1440\nowidctlpar\widctlpar\tx1440\tx3600\tx5760\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 OA-<}}}{\f4 \tab Moves the cursor to the beginning of the line. +\par }{\f6\fs20 \tab Before\tab \tab After +\par \tab % }{\b\f6\fs20 print }{\b\f6\fs20\ul f}{\b\f6\fs20 oo bar}{\f6\fs20 \tab (OA-<)\tab % }{\b\f6\fs20\ul p}{\b\f6\fs20 rint foo bar}{\f6\fs20 +\par }{\f4 +\par }{\f6\fs20 CTRL-E}{\pard\plain \qj\fi-1440\li1440\nowidctlpar\widctlpar\tx1440\tx3600\tx5760\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 CTRL-E}}}{\f6\fs20 \tab }{\b\f6\fs20 end-of-line}{\pard\plain \qj\fi-1440\li1440\nowidctlpar\widctlpar\tx1440\tx3600\tx5760\adjustright \b\v\f6\fs20\cgrid {\xe {\b\f6\fs20 end-of-line}}}{\f4 +\par }{\f6\fs20 OA->}{\pard\plain \qj\fi-1440\li1440\nowidctlpar\widctlpar\tx1440\tx3600\tx5760\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 OA->}}}{\f4 \tab Moves the cursor to the first position past the last character on the line. +\par }{\f6\fs20 \tab Before\tab \tab After +\par \tab % }{\b\f6\fs20 print }{\b\f6\fs20\ul f}{\b\f6\fs20 oo bar}{\f6\fs20 \tab (OA->)\tab % }{\b\f6\fs20 print foo bar}{\b\f6\fs20\ul _}{\f6\fs20 +\par }{\f4 +\par }{\f6\fs20 OA-RIGHT-ARROW}{\pard\plain \qj\fi-1440\li1440\nowidctlpar\widctlpar\tx1440\tx3600\tx5760\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 OA-RIGHT-ARROW}}}{\f6\fs20 }{\b\f6\fs20 forward-word}{\pard\plain \qj\fi-1440\li1440\nowidctlpar\widctlpar\tx1440\tx3600\tx5760\adjustright \b\v\f6\fs20\cgrid {\xe {\b\f6\fs20 forward-word}}}{\f4 +\par \tab Moves the cursor right to the last character of the current word. +\par }{\f6\fs20 \tab Before\tab \tab After +\par \tab % }{\b\f6\fs20 print }{\b\f6\fs20\ul f}{\b\f6\fs20 oo bar}{\f6\fs20 \tab (OA-RIGHT-ARROW)\tab % }{\b\f6\fs20 print fo}{\b\f6\fs20\ul o}{\b\f6\fs20 bar}{\f6\fs20 +\par }{\f4 +\par }{\f6\fs20 OA-LEFT ARROW}{\pard\plain \qj\fi-1440\li1440\nowidctlpar\widctlpar\tx1440\tx3600\tx5760\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 OA-LEFT ARROW}}}{\f6\fs20 }{\b\f6\fs20 backward-word}{\pard\plain \qj\fi-1440\li1440\nowidctlpar\widctlpar\tx1440\tx3600\tx5760\adjustright \b\v\f6\fs20\cgrid {\xe {\b\f6\fs20 backward-word}}}{\f4 +\par \tab Moves the cursor left to the beginning of the current word. +\par }{\f6\fs20 \tab Before\tab \tab After +\par \tab % }{\b\f6\fs20 print f}{\b\f6\fs20\ul o}{\b\f6\fs20 o bar}{\f6\fs20 \tab (OA-LEFT ARROW)\tab % }{\b\f6\fs20 print }{\b\f6\fs20\ul f}{\b\f6\fs20 oo bar}{\f6\fs20 +\par \tab % }{\b\f6\fs20 print foo }{\b\f6\fs20\ul b}{\b\f6\fs20 ar}{\f6\fs20 \tab (OA-LEFT ARROW)\tab % }{\b\f6\fs20 print }{\b\f6\fs20\ul f}{\b\f6\fs20 oo bar}{\f6\fs20 +\par }{\f4 +\par }{\f6\fs20 OA-E}{\pard\plain \qj\fi-1440\li1440\nowidctlpar\widctlpar\tx1440\tx3600\tx5760\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 OA-E}}}{\f4 \tab }{\b\f6\fs20 toggle-cursor}{\pard\plain \qj\fi-1440\li1440\nowidctlpar\widctlpar\tx1440\tx3600\tx5760\adjustright \b\v\f6\fs20\cgrid {\xe {\b\f6\fs20 toggle-cursor}}}{\f4 +\par \tab Toggles input mode between insert }{\pard\plain \qj\fi-1440\li1440\nowidctlpar\widctlpar\tx1440\tx3600\tx5760\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 insert }}}{\f4 and overstrike}{\pard\plain \qj\fi-1440\li1440\nowidctlpar\widctlpar\tx1440\tx3600\tx5760\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 overstrike}}}{\f4 . Overstrike mode is distinguished by a solid inverse cursor and insert mode by a blinking '}{\b\f6\fs20 _}{\f4 ' cursor. In overstrike mode, any characters that are typed directly over-write those characters below the cursor. In insert mode, the characters typed are inserted before the character below the cursor. +\par }\pard \qj\fi-1440\li1440\nowidctlpar\widctlpar\tx1440\tx3600\tx5760\adjustright {\f4 +\par }\pard \qj\fi-1440\li1440\nowidctlpar\widctlpar\tx1440\tx3600\tx5760\adjustright {\f4 +\par +\par }{\f4 +\par }{\b\f4 History Editing Keys}{\pard\plain \qj\fi-1440\li1440\nowidctlpar\widctlpar\tx1440\tx3600\tx5760\adjustright \b\v\f4\cgrid {\tc {\b\f4 {\*\bkmkstart _Toc364095771}History Editing Keys{\*\bkmkend _Toc364095771}\tcl1}}}{\b\f4 +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 +\par These command-line editor}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 command-line editor}}}{\f4 keys allow access to previously entered commands. The GNO shell}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GNO shell}}}{\f4 automatically keeps track of previous commands in what is called a history buffer}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 history buffer}}}{\f4 . +\par +\par The maximum number of command-lines saved in the history buffer}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 history buffer}}}{\f4 is determined by the shell variable }{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 $HISTORY}}}{\f4 . A default value for this variable is set in the }{\i\f4 gshrc}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\i\f4 gshrc}}}{\f4 file that the GNO Installer}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GNO Installer}}}{\f4 creates. The lines saved to the history buffer}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 history buffer}}}{\f4 are kept between sessions. That is, when you exit }{\b\f4 gsh}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 gsh}}}{\f4 , $}{\f6\fs20 SAVEHIST}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 $SAVEHIST}}}{\f4 command-lines are saved to the }{\f6\fs20 history}{\f4 file in your }{\f6\fs20 $HOME}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 $HOME}}}{\f4 directory. When }{\b\f4 gsh}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 gsh}}}{\f4 is invoked again, all command-lines saved in the history buffer will be available using history editing keys. See Chapter 5 }{\b\f4 Description of Predefined Shell Variables}{\f4 for more informtation on the }{\f6\fs20 HISTORY}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 HISTORY}}}{\f4 and }{\f6\fs20 SAVEHIST}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 SAVEHIST}}}{\f4 variables. +\par }\pard \qj\fi-1440\li1440\nowidctlpar\widctlpar\tx1440\tx3600\tx5760\adjustright {\f4 +\par }{\f6\fs20 CTRL-P}{\pard\plain \qj\fi-1440\li1440\nowidctlpar\widctlpar\tx1440\tx3600\tx5760\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 CTRL-P}}}{\f6\fs20 \tab }{\b\f6\fs20 up-history}{\pard\plain \qj\fi-1440\li1440\nowidctlpar\widctlpar\tx1440\tx3600\tx5760\adjustright \b\v\f6\fs20\cgrid {\xe {\b\f6\fs20 up-history}}}{\f4 +\par }{\f6\fs20 UP-ARROW}{\pard\plain \qj\fi-1440\li1440\nowidctlpar\widctlpar\tx1440\tx3600\tx5760\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 UP-ARROW}}}{\f4 Fetches the previous command-line. If the current command-line is the first line in the history buffer, the next line fetched will be an empty command-line. If invoked again, the last line in the history buffer will be displayed. +\par }{\f6\fs20 \tab Before\tab \tab After +\par \tab % }{\b\f6\fs20 print foo bar}{\f6\fs20 +\par \tab % }{\b\f6\fs20 echo Apple II}{\f6\fs20 +\par \tab % }{\b\f6\fs20 echo GNO/ME}{\f6\fs20 +\par \tab % }{\b\f6\fs20 _}{\f6\fs20 \tab (UP-ARROW)\tab % }{\b\f6\fs20 echo GNO/ME_}{\f6\fs20 +\par \tab % }{\b\f6\fs20 echo GNO/ME_}{\f6\fs20 \tab (UP-ARROW)\tab % }{\b\f6\fs20 echo Apple II_}{\f6\fs20 +\par }{\f4 +\par }{\f6\fs20 CTRL-N}{\pard\plain \qj\fi-1440\li1440\nowidctlpar\widctlpar\tx1440\tx3600\tx5760\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 CTRL-N}}}{\f6\fs20 \tab }{\b\f6\fs20 down-history}{\pard\plain \qj\fi-1440\li1440\nowidctlpar\widctlpar\tx1440\tx3600\tx5760\adjustright \b\v\f6\fs20\cgrid {\xe {\b\f6\fs20 down-history}}}{\f4 +\par }{\f6\fs20 DOWN-ARROW}{\pard\plain \qj\fi-1440\li1440\nowidctlpar\widctlpar\tx1440\tx3600\tx5760\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 DOWN-ARROW}}}{\f4 Fetches the next command-line. If the current command-line is the last command line in the history buffer, the next line fetched will be the first command-line in the history buffer. +\par }\pard \qj\fi-1440\li1440\nowidctlpar\widctlpar\tx1440\tx3960\tx5760\adjustright {\f6\fs20 \tab Before\tab \tab After +\par \tab % print foo bar +\par \tab % echo Apple II +\par \tab % echo GNO/ME +\par \tab % }{\b\f6\fs20 _}{\f6\fs20 \tab (DOWN-ARROW)\tab % }{\b\f6\fs20 print foo bar_}{\f6\fs20 +\par \tab % }{\b\f6\fs20 print foo bar_}{\f6\fs20 \tab (DOWN-ARROW)\tab % }{\b\f6\fs20 echo Apple II_}{\f6\fs20 +\par }\pard \qj\fi-1440\li1440\nowidctlpar\widctlpar\tx1440\tx3600\tx5760\adjustright {\f4 +\par +\par }{\b\f4 Command, Filename and Variable completion}{\pard\plain \qj\fi-1440\li1440\nowidctlpar\widctlpar\tx1440\tx3600\tx5760\adjustright \b\v\f4\cgrid {\tc {\b\f4 {\*\bkmkstart _Toc364095772}Command, Filename and Variable completion{\*\bkmkend _Toc364095772}\tcl1}}}{\b\f4 +\par }{\f4 +\par These command-line editor}{\pard\plain \qj\fi-1440\li1440\nowidctlpar\widctlpar\tx1440\tx3600\tx5760\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 command-line editor}}}{\f4 keys can be used to complete filenames, commands and variables. +\par +\par }{\f6\fs20 CTRL-D}{\pard\plain \qj\fi-1440\li1440\nowidctlpar\widctlpar\tx1440\tx3600\tx5760\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 CTRL-D}}}{\f4 \tab }{\b\f6\fs20 list-choices}{\pard\plain \qj\fi-1440\li1440\nowidctlpar\widctlpar\tx1440\tx3600\tx5760\adjustright \b\v\f6\fs20\cgrid {\xe {\b\f6\fs20 list-choices}}}{\f4 +\par \tab Lists commands and pathnames that match the current word. +\par }{\f6\fs20 \tab Before +\par \tab % }{\b\f6\fs20 print foo_ bar}{\f6\fs20 \tab (CTRL-D) +\par \tab After +\par \tab foo.c fool foo.m +\par \tab % }{\b\f6\fs20 print foo_ bar}{\f6\fs20 +\par }\pard \qj\fi-1440\li1440\nowidctlpar\widctlpar\tx1440\tx3600\tx5760\adjustright {\f4 +\par }\pard \qj\fi-1440\li1440\nowidctlpar\widctlpar\tx1440\tx3600\tx5760\adjustright {\f6\fs20 TAB}{\pard\plain \qj\fi-1440\li1440\nowidctlpar\widctlpar\tx1440\tx3600\tx5760\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 TAB}}}{\f4 \tab }{\b\f6\fs20 complete-word}{\pard\plain \qj\fi-1440\li1440\nowidctlpar\widctlpar\tx1440\tx3600\tx5760\adjustright \b\v\f6\fs20\cgrid {\xe {\b\f6\fs20 complete-word}}}{\f4 +\par \tab Command, pathname and variable completion. If the cursor is positioned on the first word of the command-line, command pathname is performed, else pathname or variable completion is performed. The word is expanded to the closest matching command, pathname or variable. Characters are appended up to the point that they would cause more than one. If a complete pathname results for pathname completion, }{\b\f4 gsh}{\pard\plain \qj\fi-1440\li1440\nowidctlpar\widctlpar\tx1440\tx3600\tx5760\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 gsh}}}{\f4 appends a "}{\f6\fs20 /}{\f4 " if the pathname is a directory; otherwise, it appends a space. +\par +\par }{\f6\fs20 \tab Before\tab \tab After +\par \tab % }{\b\f6\fs20 ca_}{\f6\fs20 \tab (TAB)\tab % }{\b\f6\fs20 cat_}{\f6\fs20 +\par \tab % }{\b\f6\fs20 mo_ foo.c}{\f6\fs20 \tab (TAB)\tab % }{\b\f6\fs20 more_ foo.c}{\f6\fs20 +\par \tab % }{\b\f6\fs20 more fo_}{\f6\fs20 \tab (TAB)\tab % }{\b\f6\fs20 more foo_}{\f6\fs20 +\par \tab % }{\b\f6\fs20 echo $TERMC_}{\f6\fs20 \tab (TAB)\tab % }{\b\f6\fs20 echo $TERMCAP_}{\f6\fs20 +\par }{\f4\fs20 +\par \tab }{\f4 Note that if there is more than one match for the partial command, }{\b\f4 gsh}{\pard\plain \qj\fi-1440\li1440\nowidctlpar\widctlpar\tx1440\tx3600\tx5760\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 gsh}}}{\f4 will sound a beep on the speaker. You can use the CTRL-D}{\pard\plain \qj\fi-1440\li1440\nowidctlpar\widctlpar\tx1440\tx3600\tx5760\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 CTRL-D}}}{\f4 (}{\f6\fs20 list-choices}{\f4 ) command to see the list of possible matches, and should either finish entering the command manually or type enough additional characters to guarantee a unique match. +\par +\par \tab If the }{\f6\fs20 $FIGNORE}{\pard\plain \qj\fi-1440\li1440\nowidctlpar\widctlpar\tx1440\tx3600\tx5760\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 $FIGNORE}}}{\f6\fs20 }{\f4 variable is set, }{\b\f4 gsh}{\f4 ignores filenames (when doing completion) that end with any of the suffixes in }{\f6\fs20 $FIGNORE}{\pard\plain \qj\fi-1440\li1440\nowidctlpar\widctlpar\tx1440\tx3600\tx5760\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 $FIGNORE}}}{\f4 . See Chapter 5 }{\b\f4 Description of Pre-defined Shell Variables}{\f4 for more information regarding the }{\f6\fs20 $FIGNORE }{\f4 variable. +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\b\f4 +\par +\par }{\b\f4 Other ways of entering commands}{\f4 +\par +\par }{\f4\ul Terminal Input +\par }{\f4 +\par An example involving the connection of a terminal; will be dealt with in Chapter 3 }{\b\f4 Redirecting Input and Output}{\f4 but it is necessary to mention here that when using }{\v\f4 .i.}{\b\f4 gsh}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 terminal\; will be dealt with in Chapter 3 Redirecting Input and Output but it is necessary to mention here that when using .i.gsh}}}{\f4 over a terminal, some keystrokes must be slightly modified. This is because there are no terminals that can transmit the OA}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 OA}}}{\f4 key. Instead, a two-key sequence must be used which replaces OA}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 OA}}}{\f4 with ESC}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 ESC}}}{\f4 . For example, instead of pressing OA-E}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 OA-E}}}{\f4 to toggle insert }{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 insert }}}{\f4 mode, you can type ESC-E}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 ESC-E}}}{\f4 over a terminal to do the same thing. +\par +\par If you will be using terminals seriously then you should install the Remote Access}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 Remote Access}}}{\f4 package. +\par }\pard \qj\fi-1440\li1440\nowidctlpar\widctlpar\tx1440\tx3600\tx5760\adjustright {\f4 +\par }{\f4\ul Script File +\par }{\f4 +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 While you would normally type commands on the command-line}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 command-line}}}{\f4 , you can also store a series of often used commands in a file. A file containing such a series of commands is called a script}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 script}}}{\f4 . A script is normally created by using a text editor. +\par +\par By typing the name of the script file, the shell will execute it, line by line, as if you had typed each command separately. The }{\i\f4 gshrc}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\i\f4 gshrc}}}{\f4 file presented in Chapter 1 }{\b\f4 Customizing the Shell Environment}{\f4 is an example of a script file. +\par }\pard \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright {\b\f4 +\par +\par \page \sect }\sectd \psz1\linex0\endnhere\titlepg\sectdefaultcl {\headerl \pard\plain \s18\nowidctlpar\widctlpar\tqr\tx10080\adjustright \b\f1\ul\cgrid {Using the GNO Shell more productively\tab Chapter 3 +\par }}{\headerr \pard\plain \s18\nowidctlpar\widctlpar\tqr\tx10080\adjustright \b\f1\ul\cgrid {Chapter 3\tab Using the GNO Shell more productively +\par }}\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \f12\cgrid {\f4\fs48 Chapter 3 +\par }\pard \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright {\f4\fs48 Using the GNO Shell more productively}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\fs48\cgrid {\tc {\f4\fs48 {\*\bkmkstart _Toc364095773}Using the GNO Shell more productively{\*\bkmkend _Toc364095773}\tcl1}}}{\f4\fs48 +\par }\pard \qr\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright {\f4\fs20 "And then one day, hooray! Another way for gnomes to say hooray!" +\par Syd Barret, The Gnome +\par }\pard \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright {\b\f4 +\par +\par +\par What does this command do?}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \b\v\f4\cgrid {\tc {\b\f4 {\*\bkmkstart _Toc364095774}What does this command do?{\*\bkmkend _Toc364095774}\tcl1}}}{\f4 +\par +\par }\pard \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright {\f4 If you are unfamiliar with what a particular command actually does or what arguments it accepts, you can check quickly by using the electronic manual. GNO/ME}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GNO/ME}}}{\f4 includes a utility called }{\b\f4 man}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 man}}}{\b\f4 }{\f4 which displays the manual pages}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 manual pages}}}{\f4 for a command whose name you supply as an argument. The }{\b\f4 man}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 man}}}{\f4 utility uses another utility called }{\b\f4 more}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 more}}}{\f4 to actually display the pages nicely on the screen. While both of these utilities have electronic manual entries, we have included the printed manual pages in the GNO/ME}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GNO/ME}}}{\f4 package to get you started. +\par }\pard \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright {\f4 +\par }{\b\f4 Option Arguments}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \b\v\f4\cgrid {\tc {\b\f4 {\*\bkmkstart _Toc364095775}Option Arguments{\*\bkmkend _Toc364095775}\tcl1}}}{\f4 +\par +\par As mentioned in Chapter 2 }{\b\f4 Executing Commands}{\f4 , arguments are passed to a command to extend its usefulness. The arguments presented in the last chapter were words, such as foo, bar and foo.c. Standards exist under unix for programs to accept command-line option arguments}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 option arguments}}}{\f4 . Option arguments (as the name suggests) are optional. There are two standards, short options}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 short options}}}{\f4 and long options}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 long options}}}{\f4 . Short options}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 Short options}}}{\f4 are characters that represent commands, whereas long options}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 long options}}}{\f4 contain the entire option name. +\par +\par Consider the following output of the }{\f6\fs20 CATALOG}{\f4 command from ProDOS}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 ProDOS}}}{\f4 : +\par +\par }\pard \qj\nowidctlpar\widctlpar\tx360\tqr\tx9360\adjustright {\f6\fs20 \tab /DEV +\par \tab NAME TYPE BLOCKS MODIFIED CREATED ENDFILE SUBTYPE +\par +\par \tab FINDER.DATA $C9 1 21-OCT-91 22:38 14-APR-90 18:24 260 +\par \tab FINDER.ROOT $C9 1 22-OCT-91 17:12 6-OCT-91 15:40 82 +\par \tab GENESYS DIR 1 21-OCT-91 23:37 25-APR-91 15:46 512 +\par \tab GSBUG DIR 1 21-OCT-91 23:38 19-JUL-90 16:48 512 +\par \tab MERLIN DIR 2 22-OCT-91 2:50 30-APR-91 20:21 1024 +\par \tab LIFEGUARD $B3 73 4-SEP-87 4:51 25-DEC-89 20:22 36608 +\par \tab ORCA DIR 2 22-OCT-91 17:12 14-SEP-89 18:27 1024 +\par \tab GNO DIR 2 22-OCT-91 17:12 13-AUG-91 16:36 1024 +\par \tab FAST.ANIM DIR 2 21-OCT-91 23:44 11-MAY-91 10:50 1024 +\par \tab MICOL DIR 2 22-OCT-91 3:10 14-JAN-90 2:46 1024 +\par \tab SRC DIR 1 21-OCT-91 23:44 7-AUG-91 20:30 512 +\par \tab NIFTYLIST.V3.3 DIR 2 21-OCT-91 23:44 29-JUL-91 4:04 1024 +\par \tab MCSRC DIR 1 21-OCT-91 23:45 7-AUG-91 20:34 512 +\par +\par \tab BLOCKS FREE:43923 BLOCKS USED:21185 TOTAL BLOCKS:65108 +\par }{\f4 +\par }\pard \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright {\f4 It is impossible to get any variation in the format of this output. While the GNO/ME utility }{\b\f4 ls}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 ls}}}{\f4 serves the same purpose as the command }{\f6\fs20 CATALOG}{\f4 from Applesoft BASIC}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 BASIC}}}{\f4 , it has a wide number of options which can tailor the output to specific needs. Here is how }{\b\f4 ls}{\f4 can be used to give similar output to the }{\f6 CATALOG}{\f4 command: +\par +\par }{\f6\fs20 \tab [1] 2:13am root % }{\b\f6\fs20 ls -l}{\f6\fs20 +\par \tab :dev +\par \tab total 45k +\par \tab drw--rd 0000 dir 512 Oct 21 23:45 1991 MCSrc +\par \tab drw--rd 0000 dir 1024 Oct 21 23:44 1991 NiftyList.v3.3 +\par \tab drw--rd 0000 dir 1024 Oct 21 23:44 1991 fast.anim +\par \tab drw--rd 0000 dir 512 Oct 21 23:37 1991 genesys +\par \tab drw--rd 0000 dir 1024 Oct 22 17:29 1991 gno +\par \tab drw--rd 0000 dir 512 Oct 21 23:38 1991 gsbug +\par \tab drw--rd 0000 dir 1024 Oct 22 02:50 1991 merlin +\par \tab drw--rd 0000 dir 1024 Oct 22 03:10 1991 micol +\par \tab drw--rd 0100 dir 1024 Oct 22 17:28 1991 orca +\par \tab drw--rd 0000 dir 512 Oct 21 23:44 1991 src +\par }{\f4 +\par }\pard \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright {\f4 The }{\b\f6\fs20 -l}{\f4 short option argument tells }{\b\f4 ls}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 ls}}}{\f4 to format the output in long format. }{\b\f4 ls}{\f4 supports only short options}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 short options}}}{\f4 . If }{\b\f4 ls}{\f4 did support long options}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 long options}}}{\f4 , the above command could be changed to }{\b\f4 ls +format-long}{\f4 . This is clearly more descriptive of what function }{\b\f4 ls}{\f4 will perform. For users to new to the U}{\f4\fs20 NIX}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 UNIX}}}{\f4 environment, long format options are more user-friendly. However, advanced U}{\f4\fs20 NIX}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 UNIX}}}{\f4 users prefer short options because of their brevity. +\par }\pard \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright {\f4 +\par As indicated above, }{\b\f4 ls}{\f4 has a wide number of options available to format the output. Use the command "}{\b\f4 ls -?}{\f4 "}{\b\f4 }{\f4 to get a short list of these options. It is left as an exercise for the user to discover how these options affect the output of }{\b\f4 ls}{\f4 . For a complete description of the }{\b\f4 ls}{\f4 command and its options use the command }{\b\f4 man}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 man}}}{\b\f4 ls}{\f4 . +\par +\par As an example of the usage and importance of long options}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 long options}}}{\f4 , the following is the result of the }{\f6\fs20 +help}{\f4 option given to the }{\b\f4 coff}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 coff}}}{\f4 utility. Note the use of both short and long options: +\par +\par }{\f6\fs20 \tab coff }{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 coff }}}{\f6\fs20 [-OPTIONS] filename [segment..] [loadsegment..] +\par +\par \tab OPTIONS DESCRIPTION +\par \tab -v [+version] display coff's version number +\par \tab -D [+default] disable default options +\par \tab -d [+asm] dump segment body in 65816-format disassembly +\par \tab -T [+tool] interpret Toolbox, GS/OS, ProDOS, ROM calls +\par \tab -x [+hex] dump segment body in hex (can be used with '+asm') +\par \tab -l [+label] print expressions using labels (default is offsets) +\par \tab -t [+infix] display expressions in infix form +\par \tab -p [+postfix] display expressions in postfix form (default) +\par \tab -m [+merlin] format of '+asm' to use merlin opcodes (default) +\par \tab -o [+orca] format of '+asm' to use orca/m opcodes +\par \tab -a [+shorta] assume 8-bit accumulator for disassembly +\par \tab -i [+shorti] assume 8-bit index registers for disassembly +\par \tab -s [+header] dump segment headers only +\par \tab -n [+noheader] do not print segment headers +\par \tab -f [+nooffset] do not print offset into file +\par \tab -h [+help] print this information, then quit +\par \tab filename name of file to dump +\par \tab [segment] names of segments in file to dump +\par \tab [loadsegment] names of load segments in file to dump +\par }{\f4 +\par The long options are much more descriptive, and provide a very easy way to remember options of programs. If an option passed to a shell utility program is not understood by that program, you will generally receive an error message stating that the option is not understood. If the program is user-friendly, a brief list of supported options will also be displayed. +\par }{\f4 +\par }{\f4 +\par +\par }{\b\f4 Entering Multiple commands}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \b\v\f4\cgrid {\tc {\b\f4 {\*\bkmkstart _Toc364095776}Entering Multiple commands{\*\bkmkend _Toc364095776}\tcl1}}}{\f4 +\par +\par It is possible to give multiple commands to the GNO shell}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GNO shell}}}{\f4 for processing. To execute multiple commands, place a semi-colon, ";", between them. The commands will be executed sequentially in the order they are entered on the command-line. Take care not to exceed the 1024 character command-line buffer}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 command-line buffer}}}{\f4 . It is possible to execute multiple commands at the same time, this feature is discussed in Chapter 3 }{\b\f4 Background Execution of Commands}{\f4 . +\par +\par To run the }{\b\f4 echo}{\f4 command and the }{\b\f4 ls}{\f4 command in succession, enter the following on the command line: +\par }{\f6\fs20 \tab % }{\b\f6\fs20 echo Running ls ; ls -l}{\f6\fs20 +\par }{\f4 +\par The output of the preceeding command will display the string "}{\f6\fs20 Running ls}{\f4 " followed by the output of the "}{\b\f4 ls -l}{\f4 " command. This method of running several commands in succession is used often to save typing. +\par +\par +\par }{\b\f4 Using Aliases as Shorthand}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \b\v\f4\cgrid {\tc {\b\f4 {\*\bkmkstart _Toc364095777}Using Aliases as Shorthand{\*\bkmkend _Toc364095777}\tcl1}}}{\f4 +\par }\pard \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright {\f4 +\par }\pard \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright {\b\f4 gsh}{\f4 provides a built-in command, }{\f6\fs20 alias}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 alias}}}{\f4 , which allows any command you would type on the command-line to be renamed. You are not limited to renaming a single command name}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 command name}}}{\f4 . Rather, you could rename an entire command-line}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 command-line}}}{\f4 , which could allow you to use the name "}{\f6\fs20 backup}{\f4 " to execute the command "}{\f6\fs20 backup +source /system +destination /tape.drive}{\f4 ". The }{\f6\fs20 alias}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 alias}}}{\f4 command is also a very powerful means of customizing your GNO environment to emulate other computing environments. +\par +\par To emulate the ORCA}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 ORCA}}}{\f4 environment, the following aliases could be entered into your }{\i\f4 gshrc}{\f4 }{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\i\f4 gshrc }}}{\f4 file, or a script called }{\i\f4 orca.alias}{\f4 that }{\i\f4 gshrc}{\f4 would run: +\par +\par }{\f6\fs20 \tab }{\b\f6\fs20 alias copy cp}{\f6\fs20 +\par \tab }{\b\f6\fs20 alias cat "ls -l"}{\f6\fs20 +\par \tab }{\b\f6\fs20 alias catalog "ls -l" +\par }{\f6\fs20 \tab }{\b\f6\fs20 alias move mv}{\f6\fs20 +\par \tab }{\b\f6\fs20 alias rename mv}{\f6\fs20 +\par \tab }{\b\f6\fs20 alias delete rm}{\f6\fs20 +\par \tab }{\b\f6\fs20 alias type cat}{\f6\fs20 +\par \tab }{\b\f6\fs20 alias prefix cd}{\f6\fs20 +\par \tab }{\b\f6\fs20 alias create mkdir}{\f6\fs20 +\par }{\f4 +\par If you alias}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 alias}}}{\f4 a string containing multiple words, you must enclose the string in quotes, as done for the catalog alias.}{\b\f4 gsh}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 gsh}}}{\b\f4 }{\f4 interprets the string as one value. If you do not include both the opening and closing quotes, the alias command will notify you of your error. +\par +\par You can view any alias' that are set by entering the }{\f6\fs20 alias}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 alias}}}{\f4 command without any arguments. The setting of a particular alias can be viewed by entering one argument consisting of the name of the alias to view. +\par +\par If you wish to remove an alias, use the command }{\f6\fs20 unalias}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 unalias}}}{\f4 with the aliased name as the argument. To remove the aliases from the }{\f6\fs20 orca.alias}{\f4 file given above, you could do the following: +\par +\par }{\f6\fs20 \tab % }{\b\f6\fs20 unalias copy cat catalog move rename delete type prefix create}{\f6\fs20 +\par }{\f4 +\par Unlike the }{\f6\fs20 alias}{\f4 command, the }{\f6\fs20 unalias}{\f4 command can take multiple arguments. See Chapter 5 }{\b\f4 Built-in Commands}{\f4 for further discussion of the }{\f6\fs20 alias}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 alias}}}{\f4 and }{\f6\fs20 unalias}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 unalias}}}{\f4 commands. +\par }{\b\f4 Redirecting Input and Output}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \b\v\f4\cgrid {\tc {\b\f4 {\*\bkmkstart _Toc364095778}Redirecting Input and Output{\*\bkmkend _Toc364095778}\tcl1}}}{\f4 +\par +\par Most shell utilities write their output to the screen. However, under GNO/ME}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GNO/ME}}}{\f4 , like ORCA}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 ORCA}}}{\f4 , it is possible to redirect}{\b\f4 }{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 redirect }}}{\f4 that output to a file or a GS/OS}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GS/OS}}}{\f4 device. The output of the }{\b\f4 ls}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 ls}}}{\f4 command above was imported into this manual by redirecting it to a file. In addition to redirecting the output of a shell utility, it is also possible to redirect the input of that utility. Consider the following }{\b\f4 gsh}{\f4 }{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 gsh }}}{\f4 session: +\par +\par }{\f6\fs20 \tab [1]% }{\b\f6\fs20 echo}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\b\f6\fs20 echo}}}{\b\f6\fs20 this is a test}{\f6\fs20 +\par }\pard \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright {\f6\fs20 \tab this is a test +\par \tab [2]% }{\b\f6\fs20 echo this is a test >}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\b\f6\fs20 >}}}{\b\f6\fs20 file1}{\f6\fs20 +\par \tab [3]% }{\b\f6\fs20 cat}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\b\f6\fs20 cat}}}{\b\f6\fs20 file1}{\f6\fs20 +\par \tab this is a test +\par \tab [4]% }{\b\f6\fs20 cat <}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\b\f6\fs20 <}}}{\b\f6\fs20 file1}{\f6\fs20 +\par \tab this is a test +\par }{\f4 +\par In the example above, }{\b\f4 cat}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 cat}}}{\f4 takes input from }{\i\f4 standard input}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\i\f4 standard input}}}{\f4 . In command 3 above, }{\b\f4 cat}{\f4 takes as an argument the filename file1 and writes the contents of that file to }{\i\f4 standard output}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\i\f4 standard output}}}{\f4 . Where no filename argument is given, }{\b\f4 cat}{\f4 reads input from standard input}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 standard input}}}{\f4 and writes the output to standard output}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 standard output}}}{\f4 +\par +\par In the case of command 4 above, }{\b\f4 cat}{\f4 contains no arguments and therefore reads from standard input}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 standard input}}}{\f4 . However, }{\b\f4 gsh}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 gsh}}}{\f4 interprets the "<}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 <}}}{\f4 " redirection}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 redirection}}}{\f4 operator and opens the file }{\f6\fs20 file1}{\f4 for use as standard input}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 standard input}}}{\f4 . Therefore, }{\b\f4 cat}{\f4 will take its input from }{\f6\fs20 file1}{\f4 , even though it thinks it is reading input from standard input}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 standard input}}}{\f4 . This input redirection}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 redirection}}}{\f4 is transparent to the utility, making it work with most shell utilities. +\par +\par Command 2 above created a new file called file1. If this file had existed prior to the command then it would have been erased. It is possible to append output to the end of the file by using the "}{\f6\fs20 >>}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 >>}}}{\f4 " redirection }{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 redirection }}}{\f4 operator. Consider the following }{\b\f4 gsh}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 gsh}}}{\f4 session: +\par +\par \tab }{\f6\fs20 [5]% }{\b\f6\fs20 echo second line >>}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\b\f6\fs20 >>}}}{\b\f6\fs20 file1}{\f6\fs20 +\par \tab [6]% }{\b\f6\fs20 cat file1}{\f6\fs20 +\par }\pard \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright {\f6\fs20 \tab this is a test +\par }\pard \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright {\f6\fs20 \tab second line}{\f4 +\par +\par Output that is sent to }{\i\f4 standard error}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\i\f4 standard error}}}{\f4 , can also be redirected. The "}{\f6\fs20 >&}{\f4 " operator redirects standard error to a file and "}{\f6\fs20 >>&}{\f4 " appends standard error}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 standard error}}}{\f4 to the end of the file. Below is a summary of the redirection operators}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 redirection operators}}}{\f4 : +\par +\par }\pard \qj\nowidctlpar\widctlpar\tx720\tx2160\tx4320\tx6480\tqr\tx9360\adjustright {\f4 Standard Input}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tx2160\tx4320\tx6480\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 Standard Input}}}{\f4 \tab Standard Output}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tx2160\tx4320\tx6480\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 Standard Output}}}{\f4 \tab Standard Error}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tx2160\tx4320\tx6480\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\f4 Standard Error}}}{\f4 +\par }\pard \qj\nowidctlpar\widctlpar\tx720\tx2520\tx4680\tx6480\tqr\tx9360\adjustright {\f4 \tab }{\f6\fs20 <}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tx2520\tx4680\tx6480\tqr\tx9360\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 <}}}{\f4 \tab \tab \tab Redirect Input from file +\par \tab \tab }{\f6\fs20 >}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tx2520\tx4680\tx6480\tqr\tx9360\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 >}}}{\f4 \tab }{\f6\fs20 >&}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tx2520\tx4680\tx6480\tqr\tx9360\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 >&}}}{\f4 \tab Redirect Output to file +\par \tab \tab }{\f6\fs20 >>}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tx2520\tx4680\tx6480\tqr\tx9360\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 >>}}}{\f4 \tab }{\f6\fs20 >>&}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tx2520\tx4680\tx6480\tqr\tx9360\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 >>&}}}{\f4 \tab Redirect Output to EOF +\par }\pard \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright {\f4 +\par Output can be redirected to a storage device}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 storage device}}}{\f4 , printer}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 printer}}}{\f4 , modem}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 modem}}}{\f4 , or any other valid GNO or GS/OS}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GS/OS}}}{\f4 device. This provides a very powerful means of communicating directly with these devices from within }{\b\f4 gsh}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 gsh}}}{\f4 . One quick and dirty example of redirection allows a background version of }{\b\f4 gsh}{\f4 to be run on a terminal}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 terminal}}}{\f4 connected directly through the modem serial port}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 serial port}}}{\f4 : +\par +\par }{\f6\fs20 [1]% }{\b\f6\fs20 gsh < ttya}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\b\f6\fs20 ttya}}}{\b\f6\fs20 > ttya >& ttya &}{\f4 +\par +\par +\par }{\b\f4 +\par }{\b\f4 Pipelines}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \b\v\f4\cgrid {\tc {\b\f4 {\*\bkmkstart _Toc364095779}Pipelines{\*\bkmkend _Toc364095779}\tcl1}}}{\f4 +\par +\par In addition to the redirection operators, there is one additional operator which gives control over how input and output are handled. The operator is a }{\b\f4 pipeline}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 pipeline}}}{\f4 , "}{\f6\fs20 |}{\f4 ". Pipelines allow the standard output of one command to be used as the standard input to another command. This is almost equivalent to running the first command with its output redirected to a temporary file, then running the second command with its input redirected from the temporary file, then removing the temporary file. Pipelines make useful }{\i\f4 filter}{\f4 processes}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\i\f4 filter processes}}}{\f4 where the output of one command can be sent to another command which filters the output to whatever parameters you give the second command. As an example, you could display all the filenames with the character "a" in their name: +\par +\par }{\f6\fs20 \tab [1]% }{\b\f6\fs20 echo foo > file1; echo abc >> file1; echo aabc >> file1}{\f6\fs20 +\par \tab [2]% }{\b\f6\fs20 echo GNO >> file1; echo standard >> file1; echo oof >> file1}{\f6\fs20 +\par \tab [3]% }{\b\f6\fs20 cat file1}{\f6\fs20 +\par \tab foo +\par \tab abc +\par \tab aabc +\par \tab GNO +\par \tab standard +\par \tab oof +\par \tab [4]% }{\b\f6\fs20 cat file1 | grep}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\b\f6\fs20 grep}}}{\b\f6\fs20 'a'}{\f6\fs20 +\par \tab abc +\par \tab aabc +\par \tab standard +\par }{\f4 +\par Pipelines are useful when you wish to view lines of text in a file that contain a phrase, or if you want to connect two programs directly, bypassing intermediate files. It is also possible to connect multiple commands with multiple pipelines. +\par +\par Pipelines are frequently used for paging }{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 paging }}}{\f4 output. The }{\b\f4 coff}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 coff}}}{\f4 program mentioned above prints the output of an OMF}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 OMF}}}{\f4 disassembly to the screen but does not pause when a key is pressed. In order to pause the display, the output must be piped through a paging utility. The ORCA shell}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 ORCA shell}}}{\f4 requires that you wait for the entire command to complete execution before the pipeline is processed. However, GNO/ME}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GNO/ME}}}{\f4 executes both commands concurrently which allows the }{\b\f4 coff}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 coff}}}{\f4 utility to execute while the paging utility displays the program output. GNO/ME}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GNO/ME}}}{\f4 comes with two page utilities, }{\b\f4 more}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 more}}}{\f4 and }{\b\f4 less}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 less}}}{\f4 . Complete desciptions of }{\b\f4 coff}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 coff}}}{\f4 , }{\b\f4 more}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 more}}}{\f4 , }{\b\f4 less}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 less}}}{\f4 can be found in the electronic manual using the }{\b\f4 man}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 man}}}{\f4 command. +\par +\par +\par }{\v\f4 c.}{\b\f4 Background}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 Background}}}{\b\f4 Execution of Commands}{\f4 +\par }\pard \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright {\f4 +\par }\pard \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright {\f4 A major benefit of GNO/ME}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GNO/ME}}}{\f4 is }{\i\f4 multitasking}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\i\f4 multitasking}}}{\f4 . Multitasking is a means of running multiple applications at once (not literally but very close). On the Apple IIGS, GNO/ME}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GNO/ME}}}{\f4 accomplishes pre-emptive multitasking}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 pre-emptive multitasking}}}{\f4 by switching among applications that are running in the background}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 background}}}{\f4 . Any GNO/ME}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GNO/ME}}}{\f4 utility can be run in the background}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 background}}}{\f4 . Applications running in the background}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 background}}}{\f4 generally run for the same period of time (GNO/ME}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GNO/ME}}}{\f4 switches between applications 20 times a second). +\par +\par To background }{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 background }}}{\f4 a shell utility, place the "}{\f6\fs20 &}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 &}}}{\f4 " character at the end of the command-line}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 command-line}}}{\f4 . The GNO shell displays a unique process ID}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 process ID}}}{\f4 and job number}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 job number}}}{\f4 for each backgrounded command. +\par +\par It is possible to use the background character "}{\f6\fs20 &}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f6\fs20 &}}}{\f4 " to separate commands as with the ";}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 \;}}}{\f4 " character. Each command with a following "}{\f6\fs20 &}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f6\fs20 &}}}{\f4 " is executed in the background. +\par +\par Up to 32 processes can executed concurrently under the GNO Kernel}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GNO Kernel}}}{\f4 . +\par +\par Warning: When you exit the GNO Shell}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GNO Shell}}}{\f4 all processes will be terminated including any you may have running in the background. +\par +\par Below is a sample session with background tasks: +\par +\par }\pard \nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright {\f6\fs20 \tab [5] script> }{\b\f6\fs20 ps}{\pard\plain \nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \b\v\f6\fs20\cgrid {\xe {\b\f6\fs20 ps}}}{\f6\fs20 +\par \tab ID STATE TT MMID UID TIME COMMAND +\par \tab 1 ready co 1002 0000 0:45 NullProcess +\par \tab 2 ready co 1007 0000 0:05 gsh +\par \tab 138 running co 1006 0000 0:00 ps +\par \tab [6] script> }{\b\f6\fs20 cmpl}{\pard\plain \nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\b\f6\fs20 cmpl}}}{\b\f6\fs20 +p script.c keep=script > outputfile &}{\f6\fs20 +\par \tab [1] + 141 Running cmpl +p script.c keep=script & +\par \tab [7] script> }{\b\f6\fs20 ps}{\f6\fs20 +\par \tab ID STATE TT MMID UID TIME COMMAND +\par \tab 1 ready co 1002 0000 0:45 NullProcess +\par \tab 2 ready co 1007 0000 0:05 gsh +\par \tab 141 waiting co 1006 0000 0:00 cmpl +p script.c keep=script +\par \tab 142 ready co 100B 0000 0:00 5/cc +\par \tab 143 running co 100D 0000 0:00 ps +\par \tab [8] script> }{\b\f6\fs20 cmpl}{\pard\plain \nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\b\f6\fs20 cmpl}}}{\b\f6\fs20 +p script.asm keep=script1 > output2 & ps ; ls -s}{\f6\fs20 +\par \tab [2] - 145 Running cmpl +p script.asm keep=script1 & +\par \tab ID STATE TT MMID UID TIME COMMAND +\par \tab 1 ready co 1002 0000 0:45 NullProcess +\par \tab 2 ready co 1007 0000 0:05 gsh +\par \tab 141 waiting co 1006 0000 0:00 cmpl +p script.c keep=script +\par \tab 144 ready co 100E 0000 0:07 5/linker +\par \tab .145 ready co 100D 0000 0:00 cmpl +p script.asm keep=script1 +\par \tab 146 running co 100F 0000 0:00 ps +\par \tab 147 ready co 1011 0000 0:00 5/asm65816 +\par \tab 3 barf 1 outputfile 6 script.asm 1 script.root +\par \tab 1 foobar 19 script 3 script.c 36 script.sym +\par \tab 1 output2 6 script.a 6 script.mac 1 typescript +\par \tab [9] script> }{\b\f6\fs20 cp}{\pard\plain \nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\b\f6\fs20 cp}}}{\b\f6\fs20 script.asm script2 &}{\f6\fs20 +\par \tab [3] 150 Running cp script.asm script2 & +\par +\par }\pard \nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright {\f6\fs20 \tab [2] - Done cmpl +p script.asm keep=script1 & +\par }\pard \nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright {\f6\fs20 +\par \tab [1] + Done cmpl +p script.c keep=script & +\par +\par \tab [3] - Done cp script.asm script2 & +\par +\par \tab [10] script> }{\b\f6\fs20 ps}{\pard\plain \nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \b\v\f6\fs20\cgrid {\xe {\b\f6\fs20 ps}}}{\f6\fs20 +\par \tab ID STATE TT MMID UID TIME COMMAND +\par \tab 1 ready co 1002 0000 0:45 NullProcess +\par \tab 2 ready co 1007 0000 0:05 gsh +\par \tab 151 running co 1006 0000 0:00 ps +\par }{\f4 +\par The first command line sends the }{\b\f6\fs20 ps}{\pard\plain \nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\b\f6\fs20 ps}}}{\f4 command to the shell. }{\b\f6\fs20 ps}{\pard\plain \nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\b\f6\fs20 ps}}}{\f4 lists the processes currently being executed by the GNO kernel}{\pard\plain \nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 kernel}}}{\f4 . The processes named }{\b\f4 gsh}{\pard\plain \nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 gsh}}}{\f4 and }{\b\f4 NullProcess}{\pard\plain \nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 NullProcess}}}{\f4 are always present. For a complete description of the }{\b\f6\fs20 ps}{\pard\plain \nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\fs20\cgrid {\xe {\v\f4\fs20 }{\b\f6\fs20 ps}}}{\b\f4 }{\f4 command see Chapter 4 }{\b\f4 Kernel Commands}{\f4 . +\par }\pard \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright {\f4 +\par When a command is executing in the background, keyboard input is not sent to it. However, output is still treated in the same way. If the command sends output to the standard output}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 standard output}}}{\f4 or standard error}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 standard error}}}{\f4 , the screen will become cluttered. Try this example: +\par +\par }{\f6\fs20 +\par }{\f6\fs20 \tab [1]% }{\b\f6\fs20 ls}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\b\f6\fs20 ls}}}{\b\f6\fs20 -l&}{\f6\fs20 +\par \tab [2]% }{\b\f6\fs20 ls -l +\par }{\f4 +\par Both the output of commands #1 and #2 will be sent to the screen. After command #1 is entered and you begin typing command #2, you will see the output of the first "}{\f6\fs20 ls -l}{\f4 " command being sent to the screen while you enter command #2. Utilities which produce output should have their standard output}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 standard output}}}{\f4 and standard error}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 standard error}}}{\f4 redirected to a file when they are executed in the background. See Chapter 3 }{\b\f4 Redirecting }{\b\f4 +\par }{\b\f4 Input and Output}{\f4 . +\par }{\f4 +\par }{\f4 Executing commands in the background hinders the performance}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 performance}}}{\f4 of the Apple IIGS. This is not too noticeable when one or two commands are being executed but performance will degrade more noticably as more commands are started. The Apple IIGS was not designed as a multitasking}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 multitasking}}}{\f4 computer so the performance of GNO/ME}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GNO/ME}}}{\f4 should be understandable. If you have an accelerator}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 accelerator}}}{\f4 (such as the Transwarp GS or Zip GS) installed, performance of multiple tasks will be acceptable. +\par }{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \b\v\f4\cgrid {\tc {\b\f4 }{\f4 {\*\bkmkstart _Toc364095780}.i.Job Control{\*\bkmkend _Toc364095780}\tcl1}}}{\b\f4 +\par }{\f4 Now that command backgrounding and multitasking have been discussed, some more definitions can be mentioned. A process}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 process}}}{\f4 is a command which has been submitted to the shell for execution. }{\b\f4 Gsh}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 Gsh}}}{\f4 contains a set of special commands which make dealing with processes much easier. }{\b\f4 gsh}{\f4 treats each command entered at the command-line as a }{\b\f4 job}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 job}}}{\f4 , where a single job may contain multiple processes. For example: +\par +\par }{\f6\fs20 \tab % }{\b\f6\fs20 ls}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\b\f6\fs20 ls}}}{\f6\fs20 \tab \{one command, one process, one job\} +\par \tab % }{\b\f6\fs20 ls ; ps}{\f6\fs20 \tab \{two commands, two processes, two jobs\} +\par \tab % }{\b\f6\fs20 ls & ps}{\f6\fs20 \tab \{two commands, two processes, two jobs\} +\par \tab % }{\b\f6\fs20 ls | more}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\b\f6\fs20 more}}}{\f6\fs20 \tab \{two processes, one job) +\par }{\f4 +\par When a job is run from the shell, it can be in several modes of operation. Jobs can be in any of three states: }{\b\f4 running}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 running}}}{\f4 , }{\b\f4 stopped}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 stopped}}}{\f4 , or }{\b\f4 done}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 done}}}{\f4 . A job can be executing in either the foreground}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 foreground}}}{\f4 or the background}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 background}}}{\f4 . +\par +\par Commands exist to place a job in any mode of operation. When a job is run directly from a command-line}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 command-line}}}{\f4 it is running and it is in the foreground}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 foreground}}}{\f4 . Since the command-line}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 command-line}}}{\f4 cannot be accessed, two special keys have been defined: }{\b\f6\fs20 ^C}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\b\f6\fs20 ^C}}}{\f4 kill}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 kill}}}{\f4 s the job and }{\b\f6\fs20 ^Z}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\b\f6\fs20 ^Z}}}{\f4 will stop}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 stop}}}{\f4 the job. When the job is killed, it is gone forever, but a stopped job can be restarted. When a job is stopped, the kernel suspends each of the processes in the job. +\par +\par Jobs that are running in the background or have been stopped can be accessed using several built-in commands. The }{\b\f4 bg}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 bg}}}{\f4 command will place a job in the background}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 background}}}{\f4 , placing it in the running state if necessary. The }{\b\f4 fg}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 fg}}}{\f4 command will similarly place a job in the foreground}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 foreground}}}{\f4 , and the }{\b\f4 stop}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 stop}}}{\f4 command will stop a backgrounded job. The }{\b\f4 kill}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 kill}}}{\f4 command will terminate a job. +\par +\par Each time }{\b\f4 job control}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 job control}}}{\f4 is accessed, a special job status line is displayed following the command. The first item on the left in brackets is the job number. Next is a single character, either a '}{\f6\fs20 +}{\f4 ', '}{\f6\fs20 -}{\f4 ', or a blank. The '}{\f6\fs20 +}{\f4 ' designates the currently accessed job, the '}{\f6\fs20 -}{\f4 ' is the previously accessed job, and all other jobs are not specified. The }{\f6\fs20 jobs}{\f4 command will display a list of all jobs. +\par +\par This example was used in Chapter 3 }{\b\f4 Background Execution of Commands}{\f4 , but now more of the notation will be understandable +\par +\par }\pard \nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright {\f6\fs20 \tab [5] script> }{\b\f6\fs20 ps}{\pard\plain \nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \b\v\f6\fs20\cgrid {\xe {\b\f6\fs20 ps}}}{\f6\fs20 +\par }\pard \nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright {\f6\fs20 \tab ID STATE TT MMID UID TIME COMMAND +\par }\pard \nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright {\f6\fs20 \tab 1 ready co 1002 0000 0:45 NullProcess +\par \tab 2 ready co 1007 0000 0:05 gsh +\par \tab 138 running co 1006 0000 0:00 ps +\par \tab [6] script> }{\b\f6\fs20 cmpl}{\pard\plain \nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\b\f6\fs20 cmpl}}}{\b\f6\fs20 +p script.c keep=script > outputfile &}{\f6\fs20 +\par \tab [1] + 141 Running cmpl +p script.c keep=script & +\par \tab [7] script> }{\b\f6\fs20 ps}{\f6\fs20 +\par \tab ID STATE TT MMID UID TIME COMMAND +\par \tab 1 ready co 1002 0000 0:45 NullProcess +\par \tab 2 ready co 1007 0000 0:05 gsh +\par \tab 141 waiting co 1006 0000 0:00 cmpl +p script.c keep=script +\par \tab 142 ready co 100B 0000 0:00 5/cc +\par \tab 143 running co 100D 0000 0:00 ps +\par \tab [8] script> }{\b\f6\fs20 cmpl}{\pard\plain \nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\b\f6\fs20 cmpl}}}{\b\f6\fs20 +p script.asm keep=script1 > output2 & ps ; ls -s}{\f6\fs20 +\par \tab [2] - 145 Running cmpl +p script.asm keep=script1 & +\par \tab ID STATE TT MMID UID TIME COMMAND +\par \tab 1 ready co 1002 0000 0:45 NullProcess +\par \tab 2 ready co 1007 0000 0:05 gsh +\par \tab 141 waiting co 1006 0000 0:00 cmpl +p script.c keep=script +\par \tab 144 ready co 100E 0000 0:07 5/linker +\par \tab .145 ready co 100D 0000 0:00 cmpl +p script.asm keep=script1 +\par \tab 146 running co 100F 0000 0:00 ps +\par \tab 147 ready co 1011 0000 0:00 5/asm65816 +\par \tab 3 barf 1 outputfile 6 script.asm 1 script.root +\par \tab 1 foobar 19 script 3 script.c 36 script.sym +\par \tab 1 output2 6 script.a 6 script.mac 1 typescript +\par \tab [9] script> }{\b\f6\fs20 cp}{\pard\plain \nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\b\f6\fs20 cp}}}{\b\f6\fs20 script.asm script2 &}{\f6\fs20 +\par \tab [3] 150 Running cp script.asm script2 & +\par +\par \tab [2] - Done cmpl +p script.asm keep=script1 & +\par +\par \tab [1] + Done cmpl +p script.c keep=script & +\par +\par \tab [3] - Done cp script.asm script2 & +\par +\par \tab [10] script> }{\b\f6\fs20 ps}{\pard\plain \nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \b\v\f6\fs20\cgrid {\xe {\b\f6\fs20 ps}}}{\f6\fs20 +\par \tab ID STATE TT MMID UID TIME COMMAND +\par \tab 1 ready co 1002 0000 0:45 NullProcess +\par \tab 2 ready co 1007 0000 0:05 gsh +\par \tab 151 running co 1006 0000 0:00 ps +\par }\pard \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright {\f4 +\par Each of the special commands, bg, fg, stop and kill, take an argument which specifies the job to perform the operation on. The argument is either a number specifying the process id, or a '}{\f6\fs20 %}{\f4 ' followed by one of the following: '}{\f6\fs20 +}{\f4 ' or '}{\f6\fs20 %}{\f4 ' for the current job, a '}{\f6\fs20 -}{\f4 ' for the previous job, or a number to specify any specific job. If nothing follows the '}{\f6\fs20 %}{\f4 ' or the argument is missing, then the current job is the default. +\par +\par }\pard \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright {\f6\fs20 \tab [1] gno> }{\b\f6\fs20 cat gshrc}{\f6\fs20 +\par }\pard \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright {\f6\fs20 +\par }\pard \nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright {\f6\fs20 \tab ### +\par \tab # +\par \tab # GNO 2.0 gshrc file +\par \tab # +\par \tab ### +\par \tab # +\par \tab # Initialize our environment +\par \tab # +\par \tab set path=":right:gno:bin :right:gno:usr:bin" +\par \tab set prompt="[%h] %S%t%s %C> " +\par \tab set home=":right:gno:user:root" +\par \tab set term=gnocon +\par \tab export path prompt home term +\par \tab setenv history=100 savehist=25 +\par \tab ### +\par \tab # +\par \tab #Set up standard prefixes for utilities. +\par \tab # +\par \tab ### +\par \tab prefix 2 :software:orca:libraries +\par \tab prefix 3 :software:orca +\par \tab prefix 4 :software:orca:shell +\par \tab prefix 5 :software:or}{\b\f6\fs20 ^Z +\par }\pard \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright {\f6\fs20 \tab [1] + Stopped (signal) cat gshrc +\par \tab [2] gno> }{\b\f6\fs20 jobs}{\f6\fs20 +\par \tab [1] + Running cat gshrc +\par \tab [3] gno> }{\b\f6\fs20 bg\tab }{\f6\fs20 \{output was not redirected, so screen gets cluttered\} +\par }\pard \nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright {\f6\fs20 \tab [1] + Running cat gshrc +\par \tab ca:languages +\par \tab prefix 6 :software:orca:utilities +\par \tab prefix 7 :tmp +\par \tab ### +\par \tab # +\par \tab # Set up prefixes for Orca2.0(tm)'s benefit +\par \tab # +\par \tab ### +\par \tab prefix 13 :software:orca:libraries +\par \tab prefix 14 :software:orca +\par }\pard \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright {\f6\fs20 \tab prefix 15 :software:or +\par \tab [4] gno> }{\b\f6\fs20 stop\tab }{\f6\fs20 \{Incredibly fast typing :-) \} +\par \tab [1] + Stopped (signal) cat gshrc +\par }\pard \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright {\f6\fs20 \tab [5] gno> }{\b\f6\fs20 jobs}{\f6\fs20 +\par }\pard \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright {\f6\fs20 \tab [1] + Running cat gshrc +\par \tab [6] gno> }{\b\f6\fs20 fg}{\f6\fs20 +\par \tab [1] + Running cat gshrc +\par }\pard \nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright {\f6\fs20 \tab ca:shell +\par \tab prefix 16 :software:orca:languages +\par \tab prefix 17 :software:orca:utilities +\par \tab alias ls 'ls -CF' +\par \tab alias dir 'ls -al' +\par \tab alias cp 'cp -i' +\par \tab alias rm 'cp -p rm' +\par \tab alias mv 'cp -p mv' +\par \tab setenv usr}{\b\f6\fs20 ^Z +\par }\pard \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright {\f6\fs20 \tab [1] + Stopped (signal) cat gshrc +\par \tab [7] gno> }{\b\f6\fs20 jobs}{\f6\fs20 +\par \tab [1] + Running cat gshrc +\par }\pard \nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright {\f6\fs20 \tab [8] gno> }{\b\f6\fs20 kill %1 +\par \tab }{\f6\fs20 [9] gno> }{\b\f6\fs20 jobs}{\f6\fs20 +\par }\pard \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright {\f6\fs20 \tab [10] gno>}{\f4 +\par +\par There is one additional way that a job may be stopped. If the job is placed in the background and it attempts to read from the console, the job will be stopped, and the status line says "}{\f6\fs20 (tty input)}{\f4 " as the reason for the job being stopped. The job should be foregrounded so that the user may enter input to the program. It can then be placed back in the background as necessary (with }{\f6\fs20 ^Z}{\f4 and }{\f6\fs20 bg}{\f4 ). +\par +\par +\par }{\b\f4 Working with Pathnames}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \b\v\f4\cgrid {\tc {\b\f4 {\*\bkmkstart _Toc364095781}Working with Pathnames{\*\bkmkend _Toc364095781}\tcl1}}}{\f4 +\par +\par To move easily to directories descended from the home directory, }{\b\f4 gsh}{\f4 provides the "}{\b\f6\fs20 ~}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\b\f6\fs20 ~}}}{\f4 " (tilde}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 tilde}}}{\f4 ) character. This character represents the home directory}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 home directory}}}{\f4 . Therefore, if your home directory}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 home directory}}}{\f4 was "}{\f6\fs20 :hard:gno:user:root}{\f4 ", you could use the command "}{\b\f6\fs20 cd ~}{\f4 " to move to the home directory (note that }{\f6\fs20 cd}{\f4 without any arguments also defaults to the home directory). To move to subdirectories of the home directory, you could use the command "}{\b\f6\fs20 cd ~/dir1}{\f4 " command. The tilde}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 tilde}}}{\f4 character is recognized by }{\b\f4 gsh}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 gsh}}}{\f4 before the command is interpreted. +\par }\pard \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright {\f4 +\par Another special sequence "}{\b\f6\fs20 ..}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\b\f6\fs20 ..}}}{\f4 ", when used as part of a pathname, will strip the last path between pathname seperators. For example, the pathname "/dev/gno/.." would be expanded to "}{\f6\fs20 /dev}{\f4 ". The "}{\f6\fs20 /gno}{\f4 " path is stripped as it is before the periods. This provides an excellent way to backup into your directories. "Backing up" is limited by the volume directory of the device being used. +\par +\par Additionally, the character "}{\b\f6\fs20 .}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\b\f6\fs20 .}}}{\f4 ", can be used to signify the current directory. +\par +\par Examples: +\par +\par }\pard \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\tqr\tx10080\adjustright {\f6\fs20 \tab [/dev/gno]% }{\b\f6\fs20 cd ~\tab }{\f4\fs20 \{ change to home directory \}}{\f6\fs20 +\par \tab [/dev/gno]% }{\b\f6\fs20 cd ~/src}{\f6\fs20 +\par \tab [/dev/gno/src]% }{\b\f6\fs20 cp ~/file1 file2\tab }{\f4\fs20 \{ copy /dev/gno/file1 to /dev/gno/src/file2 \} +\par }{\f6\fs20 \tab [/dev/gno/src]% }{\b\f6\fs20 echo ~/..}{\f6\fs20 +\par \tab /dev/gno/.. +\par \tab [/dev/gno/src]% }{\b\f6\fs20 cd ~/..}{\f6\fs20 +\par \tab [/dev]% }{\b\f6\fs20 mkdir}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\tqr\tx10080\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\b\f6\fs20 mkdir}}}{\b\f6\fs20 ~/utilities\tab }{\f4\fs20 \{ create directory /dev/gno/utilities \} +\par \tab }{\f6\fs20 [/dev]% }{\b\f6\fs20 mkdir ./libraries}{\f4\fs20 \tab \{ create directory /dev/libraries \}}{\f6\fs20 +\par }\pard \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\tqr\tx10080\adjustright {\f6\fs20 \tab [/dev]% }{\b\f6\fs20 cd ~}{\f6\fs20 +\par }\pard \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright {\f6\fs20 \tab [/dev/gno]% }{\b\f6\fs20 cp src/file1}{\f6\fs20 }{\b\f6\fs20 .}{\f6\fs20 \tab }{\f4\fs20 \{ copy /dev/gno/src/file1 to /dev/gno/file1 \}}{\f4 +\par +\par }{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \b\v\f4\cgrid {\tc {\b\f4 }{\f4 {\*\bkmkstart _Toc364095782}.i.Pathname Expansion{\*\bkmkend _Toc364095782}\tcl1}}}{\f4 +\par +\par Many utilities supplied with }{\b\f4 gsh}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 gsh}}}{\f4 take, as an argument}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 argument}}}{\f4 , a filename or filenames. The shell utilities }{\b\f4 cat}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 cat}}}{\f4 , }{\b\f4 ls}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 ls}}}{\f4 , }{\b\f4 grep}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 grep}}}{\f4 , and }{\b\f4 cp}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 cp}}}{\f4 can take multiple filenames as arguments. If you wish to invoke any of these utilities on filenames that have a sequence of characters in common (ie. }{\f6\fs20 AND}{\f4 , }{\f6\fs20 APPLE}{\f4 , }{\f6\fs20 SHK}{\f4 , }{\f6\fs20 TXT}{\f4 , }{\f6\fs20 FILE2}{\f4 , }{\f6\fs20 FILE3}{\f4 , etc.), }{\b\f4 gsh}{\f4 provides special characters, called regular expressions}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 regular expressions}}}{\f4 or wildcards}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 wildcards}}}{\f4 , which match multiple filenames without having to enter all filename arguments manually. +\par +\par }\pard \qj\nowidctlpar\widctlpar\tx720\tx2160\tqr\tx9360\adjustright {\f4 \tab }{\b\f6\fs20 *}{\f4 \tab Matches any string of characters. +\par \tab }{\b\f6\fs20 ?}{\f4 \tab Matches a single character. +\par \tab }{\b\f6\fs20 [}{\f6\fs20 abc}{\b\f6\fs20 ]}{\f4 \tab Matches any of the characters enclosed in brackets. +\par \tab }{\b\f6\fs20 [^}{\f6\fs20 abc}{\b\f6\fs20 ]}{\f4 \tab Matches any of the characters not enclosed in brackets. +\par \tab }{\b\f6\fs20 [}{\f6\fs20 a}{\b\f6\fs20 -}{\f6\fs20 c}{\b\f6\fs20 ]}{\f4 \tab Matches the ascending sequence of characters enclosed in brackets. +\par }\pard \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright {\f4 +\par This method of matching filenames is known as }{\b\f4 globbing}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 globbing}}}{\f4 . }{\b\f4 gsh}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 gsh}}}{\f4 performs globbing on the word prior to executing the command. The following }{\b\f4 gsh}{\f4 session illustrates file globbing: +\par +\par }{\f6\fs20 \tab [1]% }{\b\f6\fs20 cd /dev/gno/utilities}{\f6\fs20 +\par \tab [2]% }{\b\f6\fs20 ls}{\f6\fs20 +\par \tab :dev:gno:utilities +\par \tab CONV Crunch CrunchIIGS DeRez DiskCheck +\par \tab DumpObj Duplicate EMACS Equal Express +\par \tab Files LinkIIGS MakeBin MakeDirect OrcaDumpIIGS +\par \tab Prizm ResEqual Search canon choose +\par \tab clrff cmdfix coff compact count +\par \tab detab dir dirff dumpfile eject +\par \tab emacs.doc emacs.hlp emacs.rc emacs.tut help +\par \tab init join link macgen makelib +\par \tab mem online pageeject pause pwd +\par \tab src +\par \tab [3]% }{\b\f6\fs20 ls e*}{\f6\fs20 +\par \tab :dev:gno:utilities +\par \tab EMACS Equal Express eject emacs.doc +\par \tab emacs.hlp emacs.rc emacs.tut +\par \tab [4]% }{\b\f6\fs20 echo *r *m}{\f6\fs20 +\par \tab dir Prizm mem +\par \tab [5]% }{\b\f6\fs20 echo *i*}{\f6\fs20 +\par \tab cmdfix CrunchIIGS Prizm DiskCheck Duplicate Files init join LinkIIGS makelib +\par \tab MakeBin MakeDirect link dirff dumpfile online OrcaDumpIIGS dir +\par \tab [6]% }{\b\f6\fs20 echo NoMatch*}{\f6\fs20 +\par \tab No match. +\par \tab [7]% }{\b\f6\fs20 echo [a-f]*}{\f6\fs20 +\par \tab coff canon cmdfix compact Crunch CrunchIIGS DeRez DiskCheck DumpObj Duplicate +\par }\pard \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright {\f6\fs20 \tab EMACS emacs.doc emacs.hlp emacs.rc emacs.tut Equal Express Files choose clrff +\par }\pard \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright {\f6\fs20 \tab count detab CONV dirff dumpfile eject dir +\par \tab [8]% }{\b\f6\fs20 echo [a-fs-t]*}{\f6\fs20 +\par \tab coff canon cmdfix compact Crunch CrunchIIGS DeRez DiskCheck DumpObj Duplicate +\par \tab EMACS emacs.doc emacs.hlp emacs.rc emacs.tut Equal Express Files choose clrff +\par \tab count detab Search src CONV dirff dumpfile eject dir +\par \tab [9]% }{\b\f6\fs20 echo emacs?*}{\f6\fs20 +\par \tab EMACS emacs.doc emacs.hlp emacs.rc emacs.tut +\par \tab [10]% }{\b\f6\fs20 echo [^a-f]*}{\f6\fs20 +\par \tab Prizm help init join LinkIIGS makelib MakeBin MakeDirect link mem ResEqual +\par \tab Search src online pageeject pause OrcaDumpIIGS pwd macgen +\par \tab [11]% }{\b\f6\fs20 echo [^a-fs-t]*}{\f6\fs20 +\par \tab Prizm help init join LinkIIGS makelib MakeBin MakeDirect link mem ResEqual +\par \tab online pageeject pause OrcaDumpIIGS pwd macgen +\par \tab [12]% }{\b\f6\fs20 echo ???}{\f6\fs20 +\par \tab mem src pwd dir +\par \tab [13]% }{\b\f6\fs20 echo ?}{\f6\fs20 +\par \tab No match. +\par \tab [14]% }{\b\f6\fs20 echo "???"}{\f6\fs20 +\par \tab ??? +\par \tab [15]% }{\b\f6\fs20 do you have a light?}{\f6\fs20 +\par \tab No match. +\par }{\f4 +\par As can be seen by the above example, character matches are case insensitive. The ProDOS}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 ProDOS}}}{\f4 file system treats the filenames "}{\f6\fs20 file}{\f4 " and "}{\f6\fs20 FILE}{\f4 " as the same file. }{\b\f4 gsh}{\f4 recognizes this and does not detract from the underlying file system. +\par +\par File globbing makes passing arguments to commands much easier and much more powerful. You could easily use "}{\f6\fs20 *.c}{\f4 " as an argument in a number of ways: +\par +\par }{\f6\fs20 \tab [1]% }{\b\f6\fs20 ls *.C +\par \tab ...\tab }{\f4\fs20 \{ lists all filenames ending in ".C" \}}{\f6\fs20 +\par \tab [2]% }{\b\f6\fs20 cc *.C +\par \tab ...\tab }{\f4\fs20 \{ compiles all files ending in ".C" \}}{\f6\fs20 +\par \tab [3]% }{\b\f6\fs20 more *.C +\par \tab ...\tab }{\f4\fs20 \{ displays contents of all files ending in ".C" \}}{\f6\fs20 +\par }{\f4 +\par +\par }{\b\f4 Quoting Special Characters}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \b\v\f4\cgrid {\tc {\b\f4 {\*\bkmkstart _Toc364095783}Quoting Special Characters{\*\bkmkend _Toc364095783}\tcl1}}}{\f4 +\par +\par Beginning with Apple II}{\f4\fs20 GS}{\f4 System Software 6.0, GS/OS is able to read files from Macintosh computers. The Macintosh uses a filesystem known as HFS}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 HFS}}}{\f4 , which allows filenames to contain any character except the colon ("}{\f6\fs20 :}{\f4 "). Because a filename such as "emacs?*" is valid under HFS, care must be taken or unexpected results will occur. The word "emacs?*" was used as a regular expression above to specify a list of filenames beginning with the word "emacs" and one or more trailing characters. }{\b\f4 gsh}{\f4 does provide a way to pass an argument which contains special shell characters to a command. This is known as quoting an argument. There are three different ways to quote an expression: +\par +\par The single quote will quote everything between the single quote marks. Thus, to display the contents of a file on an HFS volume named "emacs?*": +\par +\par }{\f6\fs20 \tab % }{\b\f6\fs20 more}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\b\f6\fs20 more}}}{\b\f6\fs20 'emacs?*' +\par }{\f4 +\par The double quote will quote everything between the double quote marks except variables. See Chapter 5 for more on variables. +\par }\pard \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright {\f4 +\par }\pard \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright {\f6\fs20 \tab % }{\b\f6\fs20 echo "emacs?* $home"}{\f6\fs20 +\par \tab emacs?* /dev/gno +\par }{\f4 +\par The backslash is used to quote one character. To pass "}{\f6\fs20 emacs?*}{\f4 " as a regular expression using the backslash, enter the following: +\par +\par }{\f6\fs20 \tab % }{\b\f6\fs20 ls emacs\\?\\*}{\f6\fs20 +\par }{\f4 +\par One additional purpose of the quoting mechanism built into }{\b\f4 gsh}{\f4 is to add spaces to command arguments. Each command and its arguments is separated by a space. Multiple spaces between arguments are treated as one space. Thus, consider the following: +\par +\par }{\f6\fs20 \tab % }{\b\f6\fs20 echo}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\b\f6\fs20 echo}}}{\b\f6\fs20 a b c}{\f6\fs20 +\par \tab a b c +\par \tab % }{\b\f6\fs20 echo 'a b c'}{\f6\fs20 +\par \tab a b c +\par }{\f4 +\par +\par }{\b\f4 How gsh Finds a Command}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \b\v\f4\cgrid {\tc {\b\f4 {\*\bkmkstart _Toc364095784}How gsh Finds a Command{\*\bkmkend _Toc364095784}\tcl1}}}{\b\f4 +\par }{\f4 +\par }{\b\f4 gsh}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 gsh}}}{\f4 has a special variable, }{\f6\fs20 PATH}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 PATH}}}{\f4 , which specifies the directories and order of directories to search for shell utilities. This variable is often setup in the }{\i\f4 gshrc}{\f4 file although it can be changed as often as needed. The purpose of the }{\f6\fs20 PATH}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 PATH}}}{\f4 variable was discussed in Chapter 1 }{\b\f4 Customizing the Shell Environment}{\f4 . +\par +\par When }{\b\f4 gsh}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 gsh}}}{\f4 starts up, it searches all directories specified in the }{\f6\fs20 PATH}{\f4 variable and establishes a table of all commands, called a hash table. Because of this table, }{\b\f4 gsh}{\f4 "knows" where a command is and can execute the command much faster than searching through all directories every time the command is entered. +\par +\par The search process begins with alias names. See Chapter 3 }{\b\f4 Using aliases as shorthand}{\f4 . If an alias is found that matches the command, the alias is replaced with its value and the command-line is again parsed. If it was not an alias, }{\b\f4 gsh}{\f4 checks to see if it was a special built-in utility. The search process then searches for the name in the hash table. If an entry is found in the hash table, the path name of the command is retrieved and the command is executed. If an entry is not found, the current path is searched. If the command name is not found, an error results. +\par +\par When the }{\f6\fs20 PATH}{\f4 }{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 PATH }}}{\f4 variable is changed, }{\b\f4 gsh}{\f4 does not automatically recreate the command hash table. You need to issue the command }{\b\f6\fs20 rehash}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\b\f6\fs20 rehash}}}{\f4 to recreate the hash table. The more pathnames specified, the greater the delay in starting }{\b\f4 gsh}{\f4 and in invoking the }{\f6\fs20 rehash}{\f4 command. The following shell script }{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 script }}}{\f4 changes }{\f6\fs20 PATH}{\f4 and invokes the rehash command in one step. +\par }\pard \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright {\f4 +\par }{\f6\fs20 \tab echo Resetting PATH variable $PATH to $1 +\par \tab set path=$1 +\par \tab rehash +\par }{\f4 +\par The }{\f6\fs20 $1}{\f4 variable will be expanded with the first argument passed to the script. +\par +\par }{\f6\fs20 rehash}{\f4 should also be used if a new utility is copied to one of the directories specified in the PATH variable. Of}{\f4 }{\f4 course, it is possible to specify the absolute pathname of any command, but this is undesirable if the command is frequently used. +\par +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\b\f4 \page \sect }\sectd \psz1\linex0\endnhere\titlepg\sectdefaultcl {\headerl \pard\plain \s18\nowidctlpar\widctlpar\tqr\tx10080\adjustright \b\f1\ul\cgrid {Built-in Commands\tab Chapter 4 +\par }}{\headerr \pard\plain \s18\nowidctlpar\widctlpar\tqr\tx10080\adjustright \b\f1\ul\cgrid {Chapter 4\tab Built-in Commands +\par }}\pard\plain \qj\nowidctlpar\widctlpar\adjustright \f12\cgrid {\f4\fs48 Chapter 4 +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4\fs48 Built-in Commands}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\fs48\cgrid {\tc {\v\f4\fs48 }{\f4\fs48 {\*\bkmkstart _Toc364095785}Built-in Commands{\*\bkmkend _Toc364095785}\tcl1}}}{\f4\fs48 +\par }{\f4 +\par +\par +\par }{\b\f4 Built-ins vs EXE Commands}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \b\v\f4\cgrid {\tc {\b\f4 {\*\bkmkstart _Toc364095786}Built-ins vs EXE Commands{\*\bkmkend _Toc364095786}\tcl1}}}{\f4 +\par +\par The term "built-ins}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 built-ins}}}{\f4 " is used to describe commands that exist within the shell itself. These utilities run faster than external commands because the code is already loaded into memory. Files of type "EXE}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 EXE}}}{\f4 ", on the other hand, must be loaded into memory by }{\b\f4 gsh}{\f4 and executed. If an EXE command is executed again, it might, again, have to be loaded into memory. This results in longer execution time for the program. +\par +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\b\f4 gsh}{\f4 has a number of built-in commands which allow you to work with the shell, the GNO kernel}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GNO kernel}}}{\f4 , and the shell environment. +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 +\par The following section describes the commands that are built-in to }{\b\f4 gsh}{\f4 . The "[..]" character sequence represents an optional argument to a command. The term "}{\f6\fs20 SIGNAL}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 SIGNAL}}}{\f4 " is used to represent one of the signal names or numbers listed in Appendix D }{\b\f4 Signals}{\f4 . The sequence "..." means the command accepts multiple arguments of the same type as the argument before the "..." sequence. The sequence "\{..\}" is used to represent a set, which is a list of possible arguments to choose from. +\par +\par +\par }{\b\f4 Shell Commands}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \b\v\f4\cgrid {\tc {\b\f4 {\*\bkmkstart _Toc364095787}Shell Commands{\*\bkmkend _Toc364095787}\tcl1}}}{\f4 +\par +\par Shell built-ins provide support for external shell commands (i.e. EXE}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 EXE}}}{\f4 files and shell scripts) and provide some commands used in every-day work. +\par +\par }{\b\f6\fs20 bindkey }{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\b\f6\fs20 bindkey }}}{\b\f6\fs20 [-l] function string +\par }{\f4 Bindkey is used to customize the shell's command-line editor}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 command-line editor}}}{\f4 . Any key on the keyboard can be mapped to any of a number of functions. The various functions are as follows: +\par }\pard \qj\li720\nowidctlpar\widctlpar\tx3240\adjustright {\f6\fs20 backward-char}{\pard\plain \qj\li720\nowidctlpar\widctlpar\tx3240\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 backward-char}}}{\f4 \tab move cursor left +\par }{\f6\fs20 backward-delete-char}{\pard\plain \qj\li720\nowidctlpar\widctlpar\tx3240\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 backward-delete-char}}}{\f4 \tab delete character to left +\par }{\f6\fs20 backward-word}{\pard\plain \qj\li720\nowidctlpar\widctlpar\tx3240\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 backward-word}}}{\f4 \tab move cursor left one word +\par }{\f6\fs20 beginning-of-line}{\pard\plain \qj\li720\nowidctlpar\widctlpar\tx3240\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 beginning-of-line}}}{\f4 \tab move cursor to beginning of line +\par }{\f6\fs20 clear-screen}{\pard\plain \qj\li720\nowidctlpar\widctlpar\tx3240\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 clear-screen}}}{\f4 \tab clear screen and redraw prompt +\par }{\f6\fs20 complete-word}{\pard\plain \qj\li720\nowidctlpar\widctlpar\tx3240\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 complete-word}}}{\f4 \tab perform filename completion +\par }{\f6\fs20 delete-char}{\pard\plain \qj\li720\nowidctlpar\widctlpar\tx3240\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 delete-char}}}{\f4 \tab delete character under cursor +\par }{\f6\fs20 down-history}{\pard\plain \qj\li720\nowidctlpar\widctlpar\tx3240\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 down-history}}}{\f4 \tab replace command line with next history +\par }{\f6\fs20 end-of-line}{\pard\plain \qj\li720\nowidctlpar\widctlpar\tx3240\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 end-of-line}}}{\f4 \tab move cursor to end of line +\par }{\f6\fs20 forward-char}{\pard\plain \qj\li720\nowidctlpar\widctlpar\tx3240\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 forward-char}}}{\f4 \tab move cursor to the right +\par }{\f6\fs20 forward-word}{\pard\plain \qj\li720\nowidctlpar\widctlpar\tx3240\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 forward-word}}}{\f4 \tab move cursor one word to the right +\par }{\f6\fs20 kill-end-of-line}{\pard\plain \qj\li720\nowidctlpar\widctlpar\tx3240\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 kill-end-of-line}}}{\f4 \tab delete line from cursor to end of line +\par }{\f6\fs20 kill-whole-line}{\pard\plain \qj\li720\nowidctlpar\widctlpar\tx3240\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 kill-whole-line}}}{\f4 \tab delete the entire command line +\par }{\f6\fs20 list-choices}{\pard\plain \qj\li720\nowidctlpar\widctlpar\tx3240\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 list-choices}}}{\f4 \tab list file completion matches +\par }{\f6\fs20 newline}{\pard\plain \qj\li720\nowidctlpar\widctlpar\tx3240\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 newline}}}{\f4 \tab finished editing, accept command line +\par }{\f6\fs20 raw-char}{\pard\plain \qj\li720\nowidctlpar\widctlpar\tx3240\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 raw-char}}}{\f4 \tab character as-is +\par }{\f6\fs20 redisplay}{\pard\plain \qj\li720\nowidctlpar\widctlpar\tx3240\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 redisplay}}}{\f4 \tab redisplay the command line +\par }{\f6\fs20 toggle-cursor}{\pard\plain \qj\li720\nowidctlpar\widctlpar\tx3240\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 toggle-cursor}}}{\f4 \tab toggle between insert and overwrite cursor +\par }{\f6\fs20 undefined-char}{\pard\plain \qj\li720\nowidctlpar\widctlpar\tx3240\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 undefined-char}}}{\f4 \tab this key does nothing +\par }{\f6\fs20 up-history}{\pard\plain \qj\li720\nowidctlpar\widctlpar\tx3240\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 up-history}}}{\f4 \tab replace command line with previous history +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 +\par Keys are bound to functions, not vice-versa. This means that you can have any number of commands refer to the same function. For example, the default bindings have }{\f6\fs20 CTRL-A}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 CTRL-A}}}{\f4 and }{\f6\fs20 OA-<}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 OA-<}}}{\f4 both bound to }{\f6\fs20 beginning-of-line}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 beginning-of-line}}}{\f4 . +\par +\par Most of the function names are self-explanatory, and are explained in Chapter 2, but a few deserve discussion. }{\f6\fs20 raw-char}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 raw-char}}}{\f4 is what you should bind a key that should be inserted into the command-line as-is. The regular printable ASCII set, such as the letters a-z, numbers, etc. are bound to }{\f6\fs20 raw-char}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 raw-char}}}{\f4 . Control characters should not be bound to }{\f6\fs20 raw-char}{\f4 because the command-line editor}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 command-line editor}}}{\f4 will become confused (most control characters act as special GNO/ME console feature codes - see the }{\i\f4 GNO Kernel Reference Manual}{\f4 , Chapter 4 }{\b\f4 TextTools Replacement}{\f4 ). +\par +\par Any keystroke that should be rejected by the editor should be bound to }{\f6\fs20 undefined-char}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 undefined-char}}}{\f4 . By default, this includes control characters and OA-sequences that are not assigned to any editing features. Any key bound to }{\f6\fs20 undefined-char}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 undefined-char}}}{\f4 will cause }{\b\f4 gsh}{\f4 }{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 gsh }}}{\f4 to beep and ignore the key. +\par +\par You can actually bind key sequences, not just keystrokes, to functions. There is no limit other than memory to how many characters are in a command sequence. +\par +\par Because terminals do not have the OA}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 OA}}}{\f4 (Open Apple) key, }{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 .i.OA}}}{\v\f4 ;}{\f4 is actually mapped by the kernel}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 kernel}}}{\f4 to a two-character sequence consisting of }{\f6\fs20 ESC}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 ESC}}}{\f4 and the key. For example, OA-Y}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 OA-Y}}}{\f4 would actually produce }{\f6\fs20 ESC-Y}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 ESC-Y}}}{\f4 . +\par +\par Control characters in the }{\b\f6\fs20 string}{\f4 are represented in ^X format; e.g. CTRL-A is represented by ^A. ESC (and OA) is represented by ^[. +\par +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 Examples: +\par }\pard \qj\nowidctlpar\widctlpar\tx4320\adjustright {\f6\fs20 % }{\b\f6\fs20 bindkey kill-end-of-line ^K}{\f4 \tab map CTRL-K}{\pard\plain \qj\nowidctlpar\widctlpar\tx4320\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 CTRL-K}}}{\f4 to kill-end-of-line (like Emacs) +\par }{\f6\fs20 % }{\b\f6\fs20 bindkey clear-screen ^[^X}{\f4 \tab map OA-CLEAR}{\pard\plain \qj\nowidctlpar\widctlpar\tx4320\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 OA-CLEAR}}}{\f4 to clear-screen +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 +\par }{\b\f6\fs20 commands}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \b\v\f6\fs20\cgrid {\xe {\b\f6\fs20 commands}}}{\f4 +\par Displays a list of all built-in shell commands. +\par +\par }{\b\f6\fs20 cd }{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\b\f6\fs20 cd }}}{\b\f6\fs20 [pathname] +\par chdir }{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\b\f6\fs20 chdir }}}{\b\f6\fs20 [pathname] +\par }{\f4 Changes the current working directory to pathname. If }{\f6\fs20 pathname}{\f4 is not given, the default }{\f6\fs20 HOME}{\f4 directory (i.e. the value of the }{\f6\fs20 HOME}{\f4 environment variable) is used. This makes it easy to move back to your home directory. Under }{\b\f4 gsh}{\f4 , unlike most U}{\f4\fs20 NIX}{\f4 shells, the cd is not necessary, except to change automatically to your HOME directory. If a command is not a built-in or EXE file, but is instead the name of a directory, a cd is implied and performed on the directory unless the }{\f6\fs20 NODIREXEC}{\f4 variable has been set. +\par +\par }{\f6\fs20 \tab [1] gno> }{\b\f6\fs20 cd utilities}{\f6\fs20 +\par \tab [2] gno/utilities> }{\b\f6\fs20 echo $HOME}{\f6\fs20 +\par \tab /dev/gno +\par \tab [3] gno/utilities> }{\b\f6\fs20 cd}{\f6\fs20 +\par \tab [4] gno> }{\b\f6\fs20 utilities}{\f6\fs20 +\par \tab [5] gno/utilities> }{\b\f6\fs20 ../utilities}{\f6\fs20 +\par \tab [6] gno/utilities> }{\b\f6\fs20 ~}{\f6\fs20 +\par \tab [7] gno> _ +\par }{\f4 +\par }{\b\f6\fs20 clear}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \b\v\f6\fs20\cgrid {\xe {\b\f6\fs20 clear}}}{\b\f6\fs20 +\par }{\f4 This command takes no arguments. When invoked, the screen will be cleared. +\par +\par }{\b\f6\fs20 df}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \b\v\f6\fs20\cgrid {\xe {\b\f6\fs20 df}}}{\b\f6\fs20 +\par }{\f4 This command takes no arguments. When invoked, a listing of free blocks for every block device is given. In addition, the device name, type, file system, and capacity is listed. +\par +\par }{\f6\fs20 \tab [1] gno> }{\b\f6\fs20 df}{\f6\fs20 +\par +\par }\pard \nowidctlpar\widctlpar\adjustright {\f6\fs20 \tab .d## Volume Device Free Total Capacity System +\par \tab ---- ---------------- ---------------- ------- ------- -------- ----------- +\par \tab .d1 :Procyon .CVTECH.S6.A 3166 41037 92% ProDOS +\par \tab .d2 Apple 3.5 Drive .APPLEDISK3.5A +\par \tab .d3 Apple 3.5 Drive .APPLEDISK3.5B +\par \tab .d4 Console Driver .CONSOLE +\par \tab .d5 :Day .CVTECH.S6.B 15881 65535 75% ProDOS +\par \tab .d6 :Night .CVTECH.S6.C 39274 65535 40% HFS +\par \tab .d7 :Left .CVTECH.S6.D 5365 51776 89% ProDOS +\par \tab .d8 :Right .CVTECH.S6.E 27477 65535 58% ProDOS +\par \tab .d9 :Software .CVTECH.S6.F 3289 40960 91% ProDOS +\par \tab .d10 :RAM5 .RAMDISK 505 512 1% ProDOS +\par \tab .d11 :Conner 40 .AFP1 7368 80604 90% AppleShare +\par \tab .d12 AppleTalk fsd .AFP2 +\par \tab .... +\par \tab .d24 AppleTalk fsd .AFP14 +\par }\pard \nowidctlpar\widctlpar\adjustright {\f6\fs20 \tab .d25 AppleTalk RPM .RPM +\par }\pard \nowidctlpar\widctlpar\adjustright {\f6\fs20 \tab .d26 AppleTalk Main .APPLETALK +\par \tab .d27 Serial Modem .SERIAL2 +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f6\fs20 \tab .d28 :system .APPLESCSI.HD01. 27561 50773 45% ProDOS +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f6\fs20 \tab .d29 :dev .APPLESCSI.HD01. 43431 65108 33% ProDOS +\par \tab .d30 :usr .APPLESCSI.HD01. 44376 48725 8% ProDOS +\par }{\f4 +\par }{\f6\fs20 Volume}{\f4 - Name of device. +\par }{\f6\fs20 Device}{\f4 - GS/OS device name. +\par }{\f6\fs20 Free}{\f4 - Total number of free blocks on device. +\par }{\f6\fs20 Total}{\f4 - Total number of blocks on device. +\par }{\f6\fs20 Capacity}{\f4 - Percentage of used blocks on device. +\par }{\f6\fs20 System}{\f4 - Format of file system. With System Software 6.0.1, the file systems available are ProDOS, HFS, Pascal, MS-DOS, and DOS 3.3, and some CD-ROM formats. +\par +\par }{\b\f6\fs20 echo }{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\b\f6\fs20 echo }}}{\b\f6\fs20 [-n] arg [arg ...] +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 Expands the "}{\f6\fs20 arg}{\f4 " expression(s) and outputs them to the screen. If the "}{\f6\fs20 -n}{\f4 " switch is specified, a }{\f6\fs20 NEWLINE}{\f4 character is not output after the last "}{\f6\fs20 arg}{\f4 " expression. Special escape sequences may also be included in the arguments, similar to those used in C strings: +\par \tab }{\f6\fs20 \\b}{\f4 - Backspace +\par \tab }{\f6\fs20 \\f}{\f4 - Clears screen (form feed) +\par \tab }{\f6\fs20 \\n}{\f4 }{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 \\\\n }}}{\f4 - Newline +\par \tab }{\f6\fs20 \\r}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 \\\\r}}}{\f4 - Return +\par \tab }{\f6\fs20 \\t}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 \\\\t}}}{\f4 - Tab +\par \tab }{\f6\fs20 \\nnn}{\f4 - A decimal ASCII code. nnn represents the ASCII code. +\par +\par }{\f6\fs20 \tab [1] gno> }{\b\f6\fs20 echo Hello World}{\f6\fs20 +\par \tab Hello World +\par \tab [2] gno> }{\b\f6\fs20 echo -n Hello World}{\f6\fs20 +\par \tab Hello World[3] gno> }{\b\f6\fs20 echo $PATH $HOME 'come get to $gnome'}{\f6\fs20 +\par \tab /dev/gno/utilities /dev/orca/utilities /dev/gno come get to $gnome +\par }{\f4 +\par }{\b\f6\fs20 exit}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \b\v\f6\fs20\cgrid {\xe {\b\f6\fs20 exit}}}{\b\f6\fs20 +\par }{\f4 Exits the shell or terminates a shell script. +\par +\par }{\b\f6\fs20 history}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \b\v\f6\fs20\cgrid {\xe {\b\f6\fs20 history}}}{\b\f6\fs20 +\par }{\f4 This command displays the list of previous command-line entries. The number of entries saved is set in the }{\f6\fs20 $HISTORY}{\f4 variable. +\par +\par }{\b\f4 pushd}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \b\v\f4\cgrid {\xe {\b\f4 pushd}}}{\f4 +\par }{\b\f4 popd}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 popd}}}{\b\f4 [+n]}{\f4 +\par }{\b\f4 dirs}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \b\v\f4\cgrid {\xe {\b\f4 dirs}}}{\f4 +\par +\par These three commands maintain the shell's }{\i\f4 directory stack.}{\f4 Let's say you're working in a directory /src/myprogs/class/program.1/, and you want to temporarily go to another directory. Instead of having to 'cd' there and 'cd' back to a very long directory name (i.e., lots of typing), you can use the pushd command, like so: +\par +\par }\pard \qj\nowidctlpar\widctlpar\tqr\tx9900\adjustright {\f6\fs20 gsh> }{\b\f6\fs20 pushd /etc}{\f6\fs20 \tab }{\f4\fs20 \{ start in /src/myprogs/class/program.1/ \}}{\f6\fs20 +\par ... +\par gsh> }{\b\f6\fs20 popd}{\f6\fs20 \tab }{\f4\fs20 \{ back in /src/myprogs/class/program.1/ \}}{\f6\fs20 +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 The }{\f6\fs20 pushd}{\f4 command stores the current directory on a stack, and then changes the current directory to the argument. When you want to go back to the original directory, type popd. The shell will pull the last directory off the stack and 'cd' to that directory. +\par +\par The }{\f6\fs20 popd }{\f4 command when given an argument of +n will remove the n'th directory from the stack. It does not change to that directory. +\par +\par The }{\f6\fs20 dirs }{\f4 command displays the current directory stack. +\par +\par }{\b\f6\fs20 pwd}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \b\v\f6\fs20\cgrid {\xe {\b\f6\fs20 pwd}}}{\b\f6\fs20 +\par }{\f4 Displays the current working directory. This is useful if you have not configured the }{\f6\fs20 $PROMPT}{\f4 string to output your current working directory. +\par +\par }{\f6\fs20 \tab [1]> }{\b\f6\fs20 cd $HOME}{\f6\fs20 +\par \tab [2]> }{\b\f6\fs20 pwd}{\f6\fs20 +\par \tab /user/root +\par \tab [3]> }{\b\f6\fs20 cd utilities}{\f6\fs20 +\par \tab [4]> }{\b\f6\fs20 pwd}{\f6\fs20 +\par \tab /user/root/utilities +\par }{\f4 +\par }{\b\f6\fs20 source}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \b\v\f6\fs20\cgrid {\xe {\b\f6\fs20 source}}}{\f4 +\par When a script }{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 script }}}{\f4 is executed, }{\b\f4 gsh}{\f4 creates a new process to run the script. As a result, scripts cannot change the shell's prefixes and certain other parameters. Instead of executing the script directly, you may use the }{\f6\fs20 source}{\f4 command which does not create a new process to execute the script. Thus, the }{\f6\fs20 source}{\f4 command is effectively exactly like typing all the commands in the script from the keyboard. +\par }{\f4 +\par +\par }{\b\f6\fs20 tset}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \b\v\f6\fs20\cgrid {\xe {\b\f6\fs20 tset}}}{\f4 +\par The }{\f6\fs20 tset}{\f4 command causes the shell to reread the }{\f6\fs20 /etc/termcap}{\f4 file and reset its output system to use the terminal type specified in the $TERM variable. On startup, after reading the }{\f6\fs20 gshrc}{\f4 file, }{\b\f4 gsh}{\f4 automatically does a }{\f6\fs20 tset}{\f4 . }{\b\f4 gsh}{\f4 also automatically does a tset whenever the }{\f6\fs20 $TERM}{\f4 variable is changed with the }{\f6\fs20 set}{\f4 command. You would use tset manually if, for example, a utility changed the value of }{\f6\fs20 $TERM}{\f4 . +\par +\par }{\b\f6\fs20 which }{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\b\f6\fs20 which }}}{\b\f6\fs20 command_name [command_name ...] +\par }{\f4 Let's say that you are working on a new version of the venerable shell utility }{\f6\fs20 ls}{\f4 . Since a search of the hash table is done before searching the current directory, you might accidentally be using the wrong version of the command. You make changes and run the new program, but your changes don't seem to appear! Use the }{\f6\fs20 which}{\f4 command to check your sanity. Which also comes in handy in locating duplicate program names in the }{\f6\fs20 $PATH}{\f4 directories (for example, an }{\f6\fs20 ls}{\f4 in both }{\f6\fs20 /bin}{\f4 and }{\f6\fs20 /usr/bin}{\f4 .) +\par +\par The way to access a utility in the current directory which has the same name as a program in the }{\f6\fs20 $PATH}{\f4 is to prefix the command name with '}{\f6\fs20 .}{\f4 ', as in "}{\f6\fs20 ./ls}{\f4 ". Also, see }{\f6\fs20 unhash}{\f4 . +\par +\par }{\b\f4 +\par }{\b\f4 Kernel Commands}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \b\v\f4\cgrid {\tc {\b\f4 {\*\bkmkstart _Toc364095788}Kernel Commands{\*\bkmkend _Toc364095788}\tcl1}}}{\f4 +\par +\par }{\b\f4 gsh}{\f4 provides a set of commands to control the GNO kernel. These commands mainly deal with job control. See Chapter 3 }{\b\f4 Job Control}{\f4 . +\par +\par }\pard\plain \s37\qj\nowidctlpar\widctlpar\adjustright \b\f6\fs20\cgrid {bg }{\pard\plain \s37\qj\nowidctlpar\widctlpar\adjustright \b\v\f6\fs20\cgrid {\xe {\v }{bg }}}{\{ %job | pid \} +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \f12\cgrid {\f4 Starts the specified job, if stopped, and places it in the background. +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 +\par }\pard\plain \s37\qj\nowidctlpar\widctlpar\adjustright \b\f6\fs20\cgrid {fg }{\pard\plain \s37\qj\nowidctlpar\widctlpar\adjustright \b\v\f6\fs20\cgrid {\xe {\v }{fg }}}{\{ %job | pid \} +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \f12\cgrid {\f4 Starts the specified job, if stopped, and brings it into the foreground. +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 +\par }\pard\plain \s37\qj\nowidctlpar\widctlpar\adjustright \b\f6\fs20\cgrid {jobs }{\pard\plain \s37\qj\nowidctlpar\widctlpar\adjustright \b\v\f6\fs20\cgrid {\xe {\v }{jobs }}}{[-l] +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \f12\cgrid {\f4 Displays a list of the shell's jobs. If the "}{\f6\fs20 -l}{\f4 " switch is specified, the process id is included in the job list. +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 +\par }{\f6\fs20 \tab [1] gno> }{\b\f6\fs20 cmpl foo.c keep=foo &}{\f6\fs20 +\par \tab [1] + Running cmpl foo.c keep=foo & +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f6\fs20 \tab [2] gno> }{\b\f6\fs20 echo hello}{\f6\fs20 +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f6\fs20 \tab hello +\par \tab [3] gno> }{\b\f6\fs20 jobs}{\f6\fs20 +\par \tab [1] + Running cmpl foo.c keep=foo & +\par }{\f4 +\par }\pard\plain \s37\qj\nowidctlpar\widctlpar\adjustright \b\f6\fs20\cgrid {kill }{\pard\plain \s37\qj\nowidctlpar\widctlpar\adjustright \b\v\f6\fs20\cgrid {\xe {\v }{kill }}}{\{[-SIGNAL] %job | pid | [-l] +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \f12\cgrid {\f4 The kill command will send the signal}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 signal}}}{\f4 }{\f6\fs20 SIGNAL}{\f4 to the process number pid. The ps command documented below describes how to list all process ID's currently executing. +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 +\par }{\f6\fs20 SIGNAL}{\f4 can be either a numeric value or string representing the signal to be sent to the process. All signals are documented in Appendix D }{\b\f4 Signals}{\f4 , with numeric and string value listed. Alternatively, specifying the }{\f6\fs20 -l}{\f4 option will list all the signals and their names. +\par +\par If the process number isn't known, but the job number is, replace the pid with a '%' followed by the job number. +\par +\par }{\b\f6\fs20 +\par +\par }{\b\f6\fs20 ps}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \b\v\f6\fs20\cgrid {\xe {\b\f6\fs20 ps}}}{\b\f6\fs20 +\par }{\f4 This command takes no arguments. When invoked, a list of all currently running processes is displayed. +\par }\pard \nowidctlpar\widctlpar\adjustright {\f6\fs20 +\par [2] 9:52pm root> }{\b\f6\fs20 ls -lR :hard:gno > /ram5/dev &}{\f6\fs20 +\par [1] + 35 Running ls -lR :hard:gno & +\par [3] 9:53pm root> }{\b\f6\fs20 ps}{\f6\fs20 +\par ID STATE TT MMID UID TIME COMMAND +\par 1 ready co 1002 0000 0:26 NullProcess +\par 2 ready co 1005 0000 0:02 gsh +\par 35 ready co 100A 0000 0:01 ls -lR :hard:gno +\par 36 running co 1007 0000 0:00 ps +\par [4] 9:53pm root> +\par [1] + Done ls -lR :hard:gno +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f6\fs20 ID}{\f4 - A unique process ID assigned to a command by GNO. Use this number to reference any process. +\par }\pard \nowidctlpar\widctlpar\adjustright {\f6\fs20 STATE}{\f4 - Current state of the process. Each process can be in any of the following states: +\par +\par }\pard \fi-2160\li2880\nowidctlpar\widctlpar\adjustright {\f6 RUNNING}{\pard\plain \fi-2160\li2880\nowidctlpar\widctlpar\adjustright \v\f6\cgrid {\xe {\v\f6 }{\f6 RUNNING}}}{\f4 \tab the process is currently in execution. +\par }\pard \fi-2160\li2880\nowidctlpar\widctlpar\adjustright {\f6 READY}{\pard\plain \fi-2160\li2880\nowidctlpar\widctlpar\adjustright \v\f6\cgrid {\xe {\v\f6 }{\f6 READY}}}{\f4 \tab the process is not currently executing, but is ready to be executed as soon as it is assigned a time slice. +\par }{\f6 BLOCKED}{\pard\plain \fi-2160\li2880\nowidctlpar\widctlpar\adjustright \v\f6\cgrid {\xe {\v\f6 }{\f6 BLOCKED}}}{\f4 \tab the process is waiting for a slow I/O operation to complete (for instance, a read from a TTY). +\par }{\f6 NEW}{\pard\plain \fi-2160\li2880\nowidctlpar\widctlpar\adjustright \v\f6\cgrid {\xe {\v\f6 }{\f6 NEW}}}{\f4 \tab the process has been created, but has not executed yet. +\par }{\f6 SUSPENDED}{\pard\plain \fi-2160\li2880\nowidctlpar\widctlpar\adjustright \v\f6\cgrid {\xe {\v\f6 }{\f6 SUSPENDED}}}{\f4 \tab the process was stopped with SIGSTOP,SIGTSTP,SIGTTIN, or SIGTTOU. +\par }{\f6 WAITING}{\pard\plain \fi-2160\li2880\nowidctlpar\widctlpar\adjustright \v\f6\cgrid {\xe {\v\f6 }{\f6 WAITING}}}{\f4 \tab the process is waiting on a semaphore 'signal' operation. Programs waiting for data from a pipe have this state. +\par }{\f6 WAITSIGCH}{\pard\plain \fi-2160\li2880\nowidctlpar\widctlpar\adjustright \v\f6\cgrid {\xe {\v\f6 }{\f6 WAITSIGCH}}}{\f4 \tab the process is waiting to receive a SIGCHLD signal. +\par }{\f6 PAUSED}{\pard\plain \fi-2160\li2880\nowidctlpar\widctlpar\adjustright \v\f6\cgrid {\xe {\v\f6 }{\f6 PAUSED}}}{\f4 \tab the process is waiting for any signal. +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f6\fs20 +\par TTY}{\f4 - Terminal connected to process. +\par MMID - Memory Manager ID assigned to process. +\par UID - ID of the user who initiated the process. +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f6\fs20 TIME}{\f4 - How much CPU time this process has used. This is not the elapsed time of the process. +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f6\fs20 COMMAND}{\f4 - Command-line string used to invoke process. +\par +\par }{\b\f6\fs20 setdebug }{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\b\f6\fs20 setdebug }}}{\b\f6\fs20 \{ val | \{+|-\}flag \} +\par }{\f4 Turns GNO kernel debugging code on or off. The value passed consists of a bit field, where each bit specifies a different type of debugging code to activate. An alternate method is to provide a list of debug flags, either preceded by a '+' or a '-'. Those preceded by a '+' are activated, and those preceeded with a '-' are deactivated. All debugging is deactivated by passing a value of 0. Running setdebug wtth no arguments returns a list of the debugging flags. Legal flags include: +\par \tab }{\f6\fs20 gsostrace}{\f4 \tab - Trace GS/OS calls +\par \tab }{\f6\fs20 gsosblocks}{\f4 \tab - Trace GS/OS parameter blocks +\par \tab }{\f6\fs20 gsoserrors}{\f4 \tab - Trace GS/OS errors +\par \tab }{\f6\fs20 pathtrace}{\f4 \tab - Trace GS/OS pathnames +\par \tab }{\f6\fs20 sigtrace}{\f4 \tab - Trace signals +\par \tab }{\f6\fs20 systrace}{\f4 \tab - Trace system calls +\par +\par }{\b\f6\fs20 stop }{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\b\f6\fs20 stop }}}{\b\f6\fs20 \{ %job | pid \} +\par }{\f4 Stops the execution of all processes in a specified job. +\par +\par }{\b\f4 Environment Commands}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \b\v\f4\cgrid {\tc {\b\f4 {\*\bkmkstart _Toc364095789}Environment Commands{\*\bkmkend _Toc364095789}\tcl1}}}{\f4 +\par +\par The last set of commands, environment commands, modify the }{\b\f4 gsh}{\f4 environment. Many of these commands have been used in other parts of this manual and, therefore, should not be new. +\par +\par }{\b\f6\fs20 alias }{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\b\f6\fs20 alias }}}{\b\f6\fs20 [name] [value] +\par }{\f4 Creates an alias for a string. When this alias is referenced as a command, }{\f6\fs20 value}{\f4 will be expanded into the command line. For commands that require many arguments or have several steps, you could set up an alias to save typing. You can also use aliases to create new names for commands. To obtain a list of all aliases, invoke }{\f6\fs20 alias}{\f4 with no arguments. To list the value of an alias, invoke }{\f6\fs20 alias}{\f4 with name only. Here are some alias examples: +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 +\par }\pard \qj\nowidctlpar\widctlpar\tx720\tx2880\adjustright {\f4 \tab }{\f4\ul Alias}{\f4 \tab }{\f4\ul Command Name}{\f4 +\par }{\f6\fs20 \tab ll or list_long\tab ls -l +\par \tab backup_sys\tab cp -r /system /BackupDrive& +\par \tab backup_home\tab cp -r $HOME /BackupDrive& +\par \tab print\tab echo +\par \tab catalog\tab ls -l +\par \tab delete\tab rm +\par \tab copy\tab cp +\par \tab type\tab more +\par \tab rename\tab mv +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 }}}{\f6\fs20 +\par }{\b\f6\fs20 export }{\v\f6\fs20 ;}{\b\f6\fs20 [variable ...] +\par }{\f4 When a shell environment variable is marked as exportable, any process that is created from within the current process (most likely }{\b\f4 gsh}{\f4 ), will be passed copies of the exported variables. See }{\b\f6\fs20 setenv}{\f4 and Chapter 5 }{\b\f4 Scope of shell variables.}{\f4 +\par +\par }{\b\f6\fs20 hash}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \b\v\f6\fs20\cgrid {\xe {\b\f6\fs20 hash}}}{\f4 +\par Displays a list of all commands currently in the shell's hash table; i.e., a list of commands in the various $PATH directories. +\par +\par }{\b\f6\fs20 prefix }{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\b\f6\fs20 prefix }}}{\b\f6\fs20 [prefixnum [prefixname]] +\par }{\f4 GNO maintains a list of 32 'prefixes' for each process. Prefixes allow the user to reference a directory with a number. While }{\b\f4 gsh}{\f4 provides this ability with environment variables, the prefix command exists to support the ORCA compilers and other utilities that are dependent on certain GS/OS prefixes. Appendix B contains a list of these prefixes and their "default" meanings, as documented in the "}{\i\f4 Apple IIGS GS/OS Reference}{\f4 ", Volume 1. +\par +\par If }{\f6\fs20 prefixname}{\f4 is not given, the value of }{\f6\fs20 prefixnum}{\f4 is displayed. If neither argument is given, a list of currently assigned prefixes is displayed. +\par +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\b\f6\fs20 rehash}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \b\v\f6\fs20\cgrid {\xe {\b\f6\fs20 rehash}}}{\f4 +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 To decrease the time spent searching for a command, }{\b\f4 gsh}{\f4 builds a table of all commands which were found in the pathnames set in the }{\f6\fs20 $PATH}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 $PATH}}}{\f4 variable. When a command is invoked, only this list is searched. When the }{\f6\fs20 $PATH}{\f4 variable is changed, }{\b\f4 gsh}{\f4 must rebuild this list. The }{\b\f6\fs20 rehash}{\f4 command tells }{\b\f4 gsh}{\f4 to rebuild the list. +\par +\par While the old list is still active, if }{\f6\fs20 $PATH}{\f4 is changed and one of the previous search paths is no longer online, }{\b\f4 gsh}{\f4 will try and execute the command from the offline device, resulting in a command failure. +\par +\par To make this a one-step process, the }{\f6\fs20 change.path}{\f4 shell script listed in Chapter 5, }{\b\f4 Accessing shell variables}{\f4 can be used. +\par +\par }{\b\f6\fs20 set }{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\b\f6\fs20 set }}}{\b\f6\fs20 [var] [value] [\{var value\} ...] +\par set var=value [var=value ...] +\par setenv }{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\b\f6\fs20 setenv }}}{\b\f6\fs20 [var value]... +\par }{\f4 Use these command to create or modify environment variables. If }{\f6\fs20 set}{\f4 is invoked with no arguments, a list of the current environment variables is displayed. If only }{\f6\fs20 var}{\f4 is given as an argument, the value of }{\f6\fs20 var}{\f4 is displayed. To set or reset a variable, use both the }{\f6\fs20 var}{\f4 and }{\f6\fs20 value}{\f4 arguments. There are two ways to set a variable, either by "}{\f6\fs20 var value}{\f4 " or "}{\f6\fs20 var=value}{\f4 ". To set multiple variables at once, simply list them all on the command line as shown above. +\par +\par }{\f6\fs20 setenv}{\f4 works just like }{\f6\fs20 set}{\f4 , but automatically exports the variable(s) or lists only exported variables. +\par +\par When using }{\f6\fs20 set}{\f4 or }{\f6\fs20 setenv}{\f4 to view a list of variables, exported variables appear in ALL CAPS. +\par +\par }{\b\f6\fs20 unalias }{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\b\f6\fs20 unalias }}}{\b\f6\fs20 name [name ...] +\par }{\f4 To remove an alias from the alias list, use this command. To remove multiple aliases with one command, specify all the aliases on the command line. +\par +\par }{\b\f6\fs20 unhash}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \b\v\f6\fs20\cgrid {\xe {\b\f6\fs20 unhash}}}{\b\f6\fs20 +\par }{\f4 To disable the internal hash table created with the }{\f6\fs20 rehash}{\f4 command, use this command. This is useful if you wish to use only utilities in the current working directory (during testing, for example). +\par }{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 }}}{\f6\fs20 +\par }{\b\f6\fs20 unset }{\v\f6\fs20 ;}{\b\f6\fs20 var [var...] +\par }{\f4 To remove a variable from the environment, use }{\f6\fs20 unset}{\f4 . }{\f6\fs20 unset}{\f4 accepts multiple names if more than one variable is to be deleted. Future attempts to access the variable }{\f6\fs20 var}{\f4 will result in an error or a NULL string, depending on the circumstances. +\par }\pard \nowidctlpar\widctlpar\adjustright {\f6\fs20 +\par [8] 9:57pm root> }{\b\f6\fs20 set}{\f6\fs20 +\par PAGER = less +\par PATH = :hard:gno:bin :right:gno:usr:bin +\par user1 = foo +\par USRMAN = /usr/man +\par HISTORY = 30 +\par status = 227 +\par fignore = .a .root .sym +\par TERM = gnocon +\par LESS = -e +\par PROMPT = [%h] %S%t%s %C> +\par HOME = :hard:gno:user:root +\par user = user1 +\par nonewline = 1 +\par [9] 9:57pm root> }{\b\f6\fs20 unset user1}{\f6\fs20 +\par [10] 9:57pm root> }{\b\f6\fs20 unset user}{\f6\fs20 +\par [11] 9:57pm root> }{\b\f6\fs20 set}{\f6\fs20 +\par PAGER = less +\par PATH = :hard:gno:bin :right:gno:usr:bin +\par USRMAN = /usr/man +\par }\pard \nowidctlpar\widctlpar\adjustright {\f6\fs20 HISTORY = 30 +\par }\pard \nowidctlpar\widctlpar\adjustright {\f6\fs20 status = 0 +\par fignore = .a .root .sym +\par TERM = gnocon +\par LESS = -e +\par PROMPT = [%h] %S%t%s %C> +\par HOME = :hard:gno:user:root +\par nonewline = 1 +\par }{ +\par }\pard \nowidctlpar\widctlpar\adjustright {\page \sect }\sectd \psz1\linex0\endnhere\titlepg\sectdefaultcl {\headerl \pard\plain \s18\nowidctlpar\widctlpar\tqr\tx10080\adjustright \b\f1\ul\cgrid {Shell Variables\tab Chapter 5 +\par }}{\headerr \pard\plain \s18\nowidctlpar\widctlpar\tqr\tx10080\adjustright \b\f1\ul\cgrid {Chapter 5\tab Shell Variables +\par }}\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqc\tx5760\adjustright \f12\cgrid {\f4\fs48 Chapter 5 +\par }\pard \qj\nowidctlpar\widctlpar\tx720\tqc\tx5760\adjustright {\f4\fs48 Shell Variables}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqc\tx5760\adjustright \v\f4\fs48\cgrid {\tc {\v\f4\fs48 }{\f4\fs48 {\*\bkmkstart _Toc364094779}{\*\bkmkstart _Toc364095790}Shell Variables{\*\bkmkend _Toc364094779}{\*\bkmkend _Toc364095790}\tcl1}}}{\f4\fs48 +\par }\pard \qr\nowidctlpar\widctlpar\tx720\adjustright {\f4\fs20 And then one day, hurray! Another way for gnomes to say hooray! +\par Syd Barret, }{\f4\fs20\ul The Gnome}{\f4\fs20 +\par }\pard \qj\nowidctlpar\widctlpar\tx720\tqc\tx5760\adjustright {\f4 +\par +\par +\par }{\b\f4 Using shell variables}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqc\tx5760\adjustright \b\v\f4\cgrid {\tc {\b\f4 {\*\bkmkstart _Toc364094780}{\*\bkmkstart _Toc364095791}Using shell variables{\*\bkmkend _Toc364094780}{\*\bkmkend _Toc364095791}\tcl1}}}{\b\f4 +\par }{\f4 +\par }{\b\f4 gsh}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqc\tx5760\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 gsh}}}{\f4 supports }{\b\f4 variables}{\f4 }{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqc\tx5760\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 variables }}}{\f4 in the shell environment. These variables can be used by any shell utility or script. Many EXE}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqc\tx5760\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 EXE}}}{\f4 files and shell scripts pre-define certain shell variables that contain formatting options or other options for a specific utility. As an example, the }{\b\f4 ls}{\f4 }{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqc\tx5760\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 ls }}}{\f4 utility looks for the variable }{\f6\fs20 TERM}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqc\tx5760\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 TERM}}}{\f4 that defines the terminal type currently being used. When }{\b\f4 ls}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqc\tx5760\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 ls}}}{\f4 is started, it reads the value of the }{\f6\fs20 TERM}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqc\tx5760\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 TERM}}}{\f4 variable and avoids printing Apple II specific MouseText}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqc\tx5760\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 MouseText}}}{\f4 characters if the set terminal does not support them. +\par +\par }{\b\f4 gsh}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqc\tx5760\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 gsh}}}{\f4 has set aside certain variables for its specific use. Shell utilities should be aware of these variables and use them appropriately. Use caution when changing shell variables, because the change could affect more than just the shell. +\par +\par +\par }{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqc\tx5760\adjustright \v\f4\cgrid {\tc {\v\f4 }{\f4 {\*\bkmkstart _Toc364094781}{\*\bkmkstart _Toc364095792}.i.Scope{\*\bkmkend _Toc364094781}{\*\bkmkend _Toc364095792}\tcl1}}}{\b\f4 of Shell Variables}{\f4 +\par +\par There are two types of processes that are involved in any discussion of a multitasking}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqc\tx5760\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 multitasking}}}{\f4 system.The original process, }{\b\f4 gsh}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqc\tx5760\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 gsh}}}{\f4 for example, is called a parent process}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqc\tx5760\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 parent process}}}{\f4 . If }{\b\f4 gsh}{\f4 invokes a process, such as }{\b\f4 ls}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqc\tx5760\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 ls}}}{\f4 , }{\b\f4 cp}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqc\tx5760\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 cp}}}{\f4 , or }{\b\f4 mv}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqc\tx5760\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 mv}}}{\f4 , that process is called a child process}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqc\tx5760\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 child process}}}{\f4 . It is possible for any process to define a variable. These variables will not be made available to other processes unless the program that defined the variable specifically makes them available. +\par +\par The }{\i\f4 export}{\f4 }{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqc\tx5760\adjustright \v\f4\cgrid {\xe {\v\f4 }{\i\f4 export }}}{\f4 command makes variables defined by one process available to its children. See the example }{\i\f4 gshrc}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqc\tx5760\adjustright \v\f4\cgrid {\xe {\v\f4 }{\i\f4 gshrc}}}{\f4 shell script shown in Chaper 1 }{\b\f4 Customizing the Shell Environment}{\f4 . In the case of the shell, most of its variables are export}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqc\tx5760\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 export}}}{\f4 ed and, therefore, all shell utilities can read the value of a shell variable. However, programs cannot change the value of a shell variable. In general, executables share their environment with that of the shell, so that a utility can change variables in its parent's environment. This allows communication between programs and the shell. +\par }{\f4 +\par }{\f4 +\par }{\b\f4 Description of Pre-defined Shell Variables}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqc\tx5760\adjustright \b\v\f4\cgrid {\tc {\b\f4 {\*\bkmkstart _Toc364094782}{\*\bkmkstart _Toc364095793}Description of Pre-defined Shell Variables{\*\bkmkend _Toc364094782}{\*\bkmkend _Toc364095793}\tcl1}}}{\f4 +\par }\pard\plain \s38\qj\nowidctlpar\widctlpar\tx720\tqc\tx5760\adjustright \f6\fs20\cgrid { +\par }\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqc\tx5760\adjustright \f12\cgrid {\f4 The following variables have special meaning to }{\b\f4 gsh}{\f4 . Shell variables are not case sensitive. +\par }\pard \qj\nowidctlpar\widctlpar\tx720\tqc\tx5760\adjustright {\f4 +\par }\pard \qj\fi-1440\li1440\nowidctlpar\widctlpar\tx720\tqc\tx5760\adjustright {\f6\fs20 $0}{\pard\plain \qj\fi-1440\li1440\nowidctlpar\widctlpar\tx720\tqc\tx5760\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 $0}}}{\f6\fs20 , $1}{\pard\plain \qj\fi-1440\li1440\nowidctlpar\widctlpar\tx720\tqc\tx5760\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 $1}}}{\f6\fs20 , $2}{\pard\plain \qj\fi-1440\li1440\nowidctlpar\widctlpar\tx720\tqc\tx5760\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 $2}}}{\f6\fs20 , ... +\par \tab }{\f4 \tab String values that contain the arguments to a shell script}{\pard\plain \qj\fi-1440\li1440\nowidctlpar\widctlpar\tx720\tqc\tx5760\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 shell script}}}{\f4 . Variable 0 contains the name of the script. The first argument begins with variable 1 and so on. To expand a variable, use the dollar character, "$" (See Chapter 5 }{\b\f4 Accessing shell variables}{\f4 ) +\par +\par }{\f6\fs20 $<}{\pard\plain \qj\fi-1440\li1440\nowidctlpar\widctlpar\tx720\tqc\tx5760\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 $<}}}{\f4 \tab \tab When encountered, the variable is expanded using a value obtained from standard input}{\pard\plain \qj\fi-1440\li1440\nowidctlpar\widctlpar\tx720\tqc\tx5760\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 standard input}}}{\f4 . This provides a means of obtaining user input in script files. Note that the shell variables are expanded before the command-line is executed (See Chapter 5 }{\b\f4 Accessing shell variables}{\f4 ) When prompting the user for input, be sure that the prompt is in a separate command-line than the $<. Also, if the user wishes to enter a value with spaces, he must quote what he types with double-quotes. +\par }\pard \qj\fi-1440\li1440\nowidctlpar\widctlpar\tx720\tqc\tx5760\adjustright {\f4 +\par }\pard \qj\fi-1440\li1440\nowidctlpar\widctlpar\tx720\tqc\tx5760\adjustright {\f6\fs20 $ECHO}{\pard\plain \qj\fi-1440\li1440\nowidctlpar\widctlpar\tx720\tqc\tx5760\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 $ECHO}}}{\f4 \tab \tab A boolean value that, if defined, will cause commands in a shell script to be echoed to standard output. +\par +\par }{\f6\fs20 $FIGNORE}{\pard\plain \qj\fi-1440\li1440\nowidctlpar\widctlpar\tx720\tqc\tx5760\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 $FIGNORE}}}{\f6\fs20 \tab }{\f4 This variable, if set, contains a list of filename suffixes. When doing command or filename completion, }{\b\f4 gsh}{\f4 will ignore any filename with a suffix listed in }{\f6\fs20 FIGNORE}{\f4 . For example, you might want to }{\f6\fs20 set\~fignore=".A\~.ROOT\~.SYM"}{\f4 to ignore object files and other compiler droppings.}{\f6\fs20 +\par +\par $HISTORY}{\pard\plain \qj\fi-1440\li1440\nowidctlpar\widctlpar\tx720\tqc\tx5760\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 $HISTORY}}}{\f4 \tab A numeric value that contains the number of history }{\pard\plain \qj\fi-1440\li1440\nowidctlpar\widctlpar\tx720\tqc\tx5760\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 history }}}{\f4 commands (command-lines) remembered. If the value is 0 or }{\f6\fs20 HISTORY}{\f4 is undefined, all commands will be remembered. Previous command-lines can be called back with the UP-ARROW and DOWN-ARROW (See Chapter 2}{\b\f4 , History Editing Commands}{\f4 ). +\par }\pard \qj\fi-1440\li1440\nowidctlpar\widctlpar\tx720\tqc\tx5760\adjustright {\f4 +\par }{\f6\fs20 $HOME}{\pard\plain \qj\fi-1440\li1440\nowidctlpar\widctlpar\tx720\tqc\tx5760\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 $HOME}}}{\f4 \tab \tab The }{\f6\fs20 HOME}{\f4 directory is the main directory of the shell; it is the directory }{\b\f4 gsh}{\f4 defaults to when it starts. The tilde character ("~") can be used as a shorthand method of accessing the }{\f6\fs20 HOME}{\f4 directory (as discussed in Chapter 3, }{\b\f4 Tilde Expansion}{\f4 ). +\par +\par }{\f6\fs20 $IGNOREEOF}{\pard\plain \qj\fi-1440\li1440\nowidctlpar\widctlpar\tx720\tqc\tx5760\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 $IGNOREEOF}}}{\f6\fs20 \tab }{\f4 A boolean value that, if enabled, will prevent ^D from exiting the shell.}{\f6\fs20 +\par +\par $NOBEEP}{\pard\plain \qj\fi-1440\li1440\nowidctlpar\widctlpar\tx720\tqc\tx5760\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 $NOBEEP}}}{\f4 \tab A boolean value that, if set, will prevent }{\b\f4 gsh}{\f4 from sounding the speaker when errors occur while editing a command-line. +\par +\par }{\f6\fs20 $NODIREXEC}{\pard\plain \qj\fi-1440\li1440\nowidctlpar\widctlpar\tx720\tqc\tx5760\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 $NODIREXEC}}}{\f4 \tab A boolean value that, if set, will disable }{\b\f4 gsh}{\f4 's feature of treating directory names as commands; i.e. if a directory is specified as a command, }{\b\f4 gsh}{\f4 will move to that directory as though the cd command was being used. +\par +\par }{\f6\fs20 $NOGLOB}{\pard\plain \qj\fi-1440\li1440\nowidctlpar\widctlpar\tx720\tqc\tx5760\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 $NOGLOB}}}{\f4 \tab A boolean value that, if enabled, will disable filename globbing}{\pard\plain \qj\fi-1440\li1440\nowidctlpar\widctlpar\tx720\tqc\tx5760\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 globbing}}}{\f4 . Command arguments will be passed to their commands "as-is", without any wildcard expansion. +\par +\par }{\f6\fs20 $NONEWLINE}{\pard\plain \qj\fi-1440\li1440\nowidctlpar\widctlpar\tx720\tqc\tx5760\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 $NONEWLINE}}}{\f4 \tab A boolean value that, if set, will disable carriage returns being output before and after command execution. Previous examples given in this manual have this option set. +\par +\par }{\f6\fs20 $PATH}{\pard\plain \qj\fi-1440\li1440\nowidctlpar\widctlpar\tx720\tqc\tx5760\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 $PATH}}}{\f4 \tab \tab A string value that defines the pathnames where shell scripts, EXE}{\pard\plain \qj\fi-1440\li1440\nowidctlpar\widctlpar\tx720\tqc\tx5760\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 EXE}}}{\f4 utilities, and SYS16}{\pard\plain \qj\fi-1440\li1440\nowidctlpar\widctlpar\tx720\tqc\tx5760\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 SYS16}}}{\f4 programs can be found (See }{\b\f4 Chapter 3, How gsh finds a command}{\f4 ). Because GS/OS uses colons as separators in pathnames, }{\b\f4 gsh}{\f4 cannot allow colons to be used as separators in the PATH variable, as U}{\f4\fs20 NIX}{\pard\plain \qj\fi-1440\li1440\nowidctlpar\widctlpar\tx720\tqc\tx5760\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 UNIX}}}{\f4 does. If one of the path entries has a space within it (which is possible with the HFS}{\pard\plain \qj\fi-1440\li1440\nowidctlpar\widctlpar\tx720\tqc\tx5760\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 HFS}}}{\f4 FST), then the space should be quoted with a backslash, "\\". +\par +\par }{\f6\fs20 $PRECMD}{\pard\plain \qj\fi-1440\li1440\nowidctlpar\widctlpar\tx720\tqc\tx5760\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 $PRECMD}}}{\f6\fs20 \tab }{\f4 Actually an }{\f4\ul alias}{\f4 }{\pard\plain \qj\fi-1440\li1440\nowidctlpar\widctlpar\tx720\tqc\tx5760\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4\ul alias }}}{\f4 and not a variable, if }{\f6\fs20 PRECMD}{\f4 is defined it will be executed just before gsh prints the prompt for a command line. For example, }{\f6\fs20 alias precmd qtime}{\f4 will print the time in English text before every prompt.}{\f6\fs20 +\par +\par $PROMPT}{\pard\plain \qj\fi-1440\li1440\nowidctlpar\widctlpar\tx720\tqc\tx5760\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 $PROMPT}}}{\f4 \tab When }{\b\f4 gsh}{\f4 prompts you to enter a command, the prompt that appears before the cursor can be customized for your }{\b\f4 gsh}{\f4 environment. If }{\f6\fs20 PROMPT}{\f4 is undefined, the default prompt of "% " is used. The prompt string recognizes certain character sequences in the }{\f6\fs20 PROMPT}{\f4 variable and interprets them accordingly. The following are the special characters: +\par }\pard \qj\fi-2160\li3600\nowidctlpar\widctlpar\tx3600\adjustright {\f6\fs20 %h, %!, !}{\f4 \tab Current history number. +\par }{\f6\fs20 %t, %@}{\f4 \tab Current time of day in 12 hour am/pm format. +\par }{\f6\fs20 %d, %/}{\f4 \tab Current working directory. +\par }{\f6\fs20 %~}{\f4 \tab Current working directory with tilde ("}{\f6\fs20 ~}{\f4 ") replacement. +\par }{\f6\fs20 %c, %C, %.}{\f4 \tab Trailing component of current working directory. +\par }{\f6\fs20 %S, %s}{\f4 \tab Inverse mode ON (}{\f6\fs20 %S}{\f4 ) / OFF (}{\f6\fs20 %s}{\f4 ). +\par }{\f6\fs20 %U, %u}{\f4 \tab Begin and end Underline mode (only on terminals that support underline. }{\f6\fs20 gnocon}{\f4 will use inverse mode instead.) +\par }{\f6\fs20 %%}{\f4 \tab Displays a single "}{\f6\fs20 %}{\f4 " character. +\par }{\f6\fs20 %n}{\f4 \tab User name (contents of }{\f6\fs20 $USER}{\f4 variable). +\par }{\f6\fs20 %W}{\f4 \tab The date in mm/dd/yy format. +\par }{\f6\fs20 %D}{\f4 \tab The date in yy-mm-dd format. +\par }{\f6\fs20 \\n}{\pard\plain \qj\fi-2160\li3600\nowidctlpar\widctlpar\tx3600\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 \\\\n}}}{\f4 \tab Newline +\par }{\f6\fs20 \\r}{\pard\plain \qj\fi-2160\li3600\nowidctlpar\widctlpar\tx3600\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 \\\\r}}}{\f4 \tab Carriage Return +\par }{\f6\fs20 \\t}{\pard\plain \qj\fi-2160\li3600\nowidctlpar\widctlpar\tx3600\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 \\\\t}}}{\f4 \tab Tab +\par }{\f6\fs20 \\b}{\f4 \tab Bell (beep) +\par +\par }\pard \qj\li1440\nowidctlpar\widctlpar\tx3600\adjustright {\f4 Examples of prompts already used in this manual are "}{\f6 [1]%}{\f4 ", and "}{\f6 [/user/root]%}{\f4 " +\par }\pard \li1440\nowidctlpar\widctlpar\tx3600\adjustright {\f4 These were created by using the commands }{\b\f4 set prompt "[%h]}{\b\f6 %}{\f4 " and }{\b\f4 set prompt "[%d]}{\b\f6 %}{\b\f4 "}{\f4 . +\par }\pard \qj\fi-1440\li1440\nowidctlpar\widctlpar\tx720\tqc\tx5760\adjustright {\f4 +\par }{\f6\fs20 $PUSHDSILENT}{\pard\plain \qj\fi-1440\li1440\nowidctlpar\widctlpar\tx720\tqc\tx5760\adjustright \v\f6\fs20\cgrid {\xe {\f6\fs20 $PUSHDSILENT}}}{\f6\fs20 +\par \tab \tab }{\f4 If this variable is defined, }{\b\f4 gsh}{\f4 will not print the directory stack after any of the directory stack commands (See Chapter 4 }{\b\f6\fs20 pushd}{\pard\plain \qj\fi-1440\li1440\nowidctlpar\widctlpar\tx720\tqc\tx5760\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\b\f6\fs20 pushd}}}{\f4 , }{\b\f6\fs20 popd}{\pard\plain \qj\fi-1440\li1440\nowidctlpar\widctlpar\tx720\tqc\tx5760\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\b\f6\fs20 popd}}}{\f4 , .) }{\f6\fs20 +\par +\par $SAVEHIST}{\pard\plain \qj\fi-1440\li1440\nowidctlpar\widctlpar\tx720\tqc\tx5760\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 $SAVEHIST}}}{\f4 \tab A numeric value that contains the number of commands to save to disk when exiting }{\b\f4 gsh}{\f4 . These commands are then read back in when }{\b\f4 gsh}{\f4 is restarted which allows old commands to be reused. If the value is 0 or }{\f6\fs20 SAVEHIST}{\f4 is undefined, no commands will be saved to disk. +\par +\par }{\f6\fs20 $TERM}{\pard\plain \qj\fi-1440\li1440\nowidctlpar\widctlpar\tx720\tqc\tx5760\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 $TERM}}}{\f6\fs20 \tab \tab }{\f4 This variable contains the name of the terminal emulation}{\pard\plain \qj\fi-1440\li1440\nowidctlpar\widctlpar\tx720\tqc\tx5760\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 terminal emulation}}}{\f4 that the shell and other applications should use. By default, it is '}{\f6\fs20 gnocon}{\pard\plain \qj\fi-1440\li1440\nowidctlpar\widctlpar\tx720\tqc\tx5760\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 gnocon}}}{\f4 '. When the shell encounters a '}{\f6\fs20 set term}{\f4 ' command, it automatically calls the }{\b\f6\fs20 tset}{\pard\plain \qj\fi-1440\li1440\nowidctlpar\widctlpar\tx720\tqc\tx5760\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\b\f6\fs20 tset}}}{\f4 command to reload the termcap information. See Appendix F }{\b\f4 Termcaps}{\f4 .}{\f6\fs20 +\par +\par $TERMCAP}{\pard\plain \qj\fi-1440\li1440\nowidctlpar\widctlpar\tx720\tqc\tx5760\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 $TERMCAP}}}{\f6\fs20 \tab }{\f4 This variable specifies the location of the }{\i\f4 termcap}{\f4 }{\pard\plain \qj\fi-1440\li1440\nowidctlpar\widctlpar\tx720\tqc\tx5760\adjustright \v\f4\cgrid {\xe {\v\f4 }{\i\f4 termcap }}}{\f4 file. The shell and other applications look for }{\i\f4 termcap}{\f4 in the /etc directory, but if }{\f6\fs20 TERMCAP}{\f4 is set, the fully specified termcap file is used instead. This allows users to install custom termcap entries. See Appendix F }{\b\f4 Termcaps}{\f4 .}{\f6\fs20 +\par +\par $USER}{\pard\plain \qj\fi-1440\li1440\nowidctlpar\widctlpar\tx720\tqc\tx5760\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 $USER}}}{\f4 \tab \tab A string that represents the name of the current user. This variable is usually set by }{\b\f4 login}{\f4 (1)}{\pard\plain \qj\fi-1440\li1440\nowidctlpar\widctlpar\tx720\tqc\tx5760\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 login(1)}}}{\f4 . +\par +\par }\pard \qj\nowidctlpar\widctlpar\tx720\tqc\tx5760\adjustright {\f4 +\par }{\b\f4 Accessing shell variables}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqc\tx5760\adjustright \b\v\f4\cgrid {\tc {\b\f4 {\*\bkmkstart _Toc364094783}{\*\bkmkstart _Toc364095794}Accessing shell variables{\*\bkmkend _Toc364094783}{\*\bkmkend _Toc364095794}\tcl1}}}{\f4 +\par +\par Shell variables}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqc\tx5760\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 variables}}}{\f4 are defined or changed with the }{\f6\fs20 set}{\f4 }{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqc\tx5760\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 set }}}{\f4 command. The }{\f6\fs20 unset}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqc\tx5760\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 unset}}}{\f4 command is used to delete a variable. See Chapter 4 }{\b\f4 Environment Commands}{\f4 for more information on the }{\f6\fs20 set}{\f4 and }{\f6\fs20 unset}{\f4 commands +\par +\par To access shell variables from the command line or a shell script, use the character "$}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqc\tx5760\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 $}}}{\f4 " followed by the variable name. The dollar sign character will expand the variable to its value. If you wish to use the dollar sign character in a string from the command line, remember to enclose it in single quote}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tqc\tx5760\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 quote}}}{\f4 s or use the "\\" escape character. If you use double quotes, the shell will try to expand the variable. To differentiate the variable name from characters that may immediately follow it, the variable name may be optionally surrounded with braces, "\{" and "\}".This provides a very powerful way of user interaction with shell scripts. As an example, +\par +\par }\pard \nowidctlpar\widctlpar\adjustright {\f6\fs20 +\par \tab [1] 9:41pm root> }{\b\f6\fs20 set}{\f6\fs20 +\par \tab PAGER = less +\par \tab SAVEHIST = 25 +\par \tab PATH = :hard:gno:bin :right:gno:usr:bin +\par \tab USRMAN = /usr/man +\par \tab HISTORY = 100 +\par \tab status = 0 +\par \tab fignore = .a .root .sym +\par \tab TERM = gnocon +\par \tab LESS = -e +\par \tab PROMPT = [%h] %S%t%s %C> +\par \tab HOME = :hard:gno:user:root +\par \tab user = root +\par \tab nonewline = 1 +\par \tab [2] 9:41pm root> }{\b\f6\fs20 set history 30 user user1 ; set}{\f6\fs20 +\par \tab PAGER = less +\par \tab SAVEHIST = 25 +\par }\pard \nowidctlpar\widctlpar\adjustright {\f6\fs20 \tab PATH = :hard:gno:bin :right:gno:usr:bin +\par }\pard \nowidctlpar\widctlpar\adjustright {\f6\fs20 \tab USRMAN = /usr/man +\par \tab HISTORY = 30 +\par \tab status = 0 +\par \tab fignore = .a .root .sym +\par \tab TERM = gnocon +\par \tab LESS = -e +\par \tab PROMPT = [%h] %S%t%s %C> +\par \tab HOME = :hard:gno:user:root +\par \tab user = user1 +\par \tab nonewline = 1 +\par \tab [3] 9:41pm root> }{\b\f6\fs20 unset savehist ; set}{\f6\fs20 +\par \tab PAGER = less +\par \tab PATH = :hard:gno:bin :hard:gno:usr:bin +\par \tab USRMAN = /usr/man +\par \tab HISTORY = 30 +\par \tab status = 0 +\par \tab fignore = .a .root .sym +\par \tab TERM = gnocon +\par \tab LESS = -e +\par \tab PROMPT = [%h] %S%t%s %c> +\par \tab HOME = :hard:gno:user:root +\par \tab user = user1 +\par \tab nonewline = 1 +\par \tab [6] 9:43pm root> }{\b\f6\fs20 echo 'Current value of $path = ' $path}{\f6\fs20 +\par \tab Current value of $path = :right:gno:bin :right:gno:usr:bin +\par \tab [7] 9:44pm root> }{\b\f6\fs20 echo "value of $path = " $path}{\f6\fs20 +\par \tab value of :right:gno:bin :right:gno:usr:bin = :right:gno:bin \tab :right:gno:usr:bin +\par \tab [9] 9:45pm root> }{\b\f6\fs20 set user1 foo}{\f6\fs20 +\par \tab [10] 9:45pm root> }{\b\f6\fs20 echo $user1}{\f6\fs20 +\par \tab foo +\par \tab [11] 9:45pm root> }{\b\f6\fs20 echo $\{user\}1}{\f6\fs20 +\par \tab user11 +\par }\pard \qj\nowidctlpar\widctlpar\tx720\tqc\tx5760\adjustright {\f6\fs20 \tab [12] 9:46pm root> }{\b\f6\fs20 echo "echo '\\$path = ' \\$path" >> change.path}{\f6\fs20 +\par }\pard \qj\nowidctlpar\widctlpar\tx720\tqc\tx5760\adjustright {\f6\fs20 \tab [13] 9:46pm root> }{\b\f6\fs20 echo "set path \\$1" >> change.path}{\f6\fs20 +\par \tab [14] 9:47pm root> }{\b\f6\fs20 echo 'rehash' >> change.path}{\f6\fs20 +\par \tab [15] 9:47pm root> }{\b\f6\fs20 cat change.path}{\f6\fs20 +\par \tab echo '$path = ' $path +\par \tab set path $1 +\par \tab rehash +\par \tab [16] 9:48pm root> }{\b\f6\fs20 change.path '/dev/gno/utilities'}{\f6\fs20 +\par \tab $path = /dev/gno/orca /dev/gno/utilities +\par \tab hashed 22 files. +\par \tab [17] 9:49pm root> }{\b\f6\fs20 change.path $PATH}{\f6\fs20 +\par }\pard \qj\nowidctlpar\widctlpar\tx720\tqc\tx5760\adjustright {\f6\fs20 \tab $path = /dev/gno/orca /dev/gno/utilities +\par }\pard \qj\nowidctlpar\widctlpar\tx720\tqc\tx5760\adjustright {\f6\fs20 \tab hashed 55 files. +\par }\pard \qj\nowidctlpar\widctlpar\tx720\tqr\tx9360\adjustright {\f6\fs20 \tab [18] 9:50pm root> }{\b\f6\fs20 echo this is $homeplate}{\f6\fs20 +\par \tab this is\tab }{\f4\fs20 \{ variable }{\f6\fs20 homeplate}{\f4\fs20 wasn't found \} +\par }{\f6\fs20 \tab [19] 9:51pm root> }{\b\f6\fs20 echo this is $\{home\}plate}{\f6\fs20 +\par \tab this is /dev/gnoplate\tab }{\f4\fs20 \{ variable }{\f6\fs20 home}{\f4\fs20 is found \}}{\f6\fs20 +\par }\pard \qj\nowidctlpar\widctlpar\tx720\tqc\tx5760\adjustright {\f4\fs20 +\par +\par +\par +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\b\f4 \page \sect }\sectd \linex0\endnhere\titlepg\sectdefaultcl {\headerl \pard\plain \s18\nowidctlpar\widctlpar\tqr\tx10080\adjustright \b\f1\ul\cgrid {Sample gsh session\tab Appendix A}{ +\par }}{\headerr \pard\plain \s18\nowidctlpar\widctlpar\tqr\tx10080\adjustright \b\f1\ul\cgrid {Appendix A\tab Sample gsh session}{ +\par }}{\footerl \pard\plain \s17\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright \f12\cgrid {\ul \tab \tab +\par }\pard \s17\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright {\chpgn +\par }}{\footerr \pard\plain \s17\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright \f12\cgrid {\ul \tab \tab +\par }\pard \s17\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright {\tab \tab \chpgn +\par }}{\footerf \pard\plain \s17\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright \f12\cgrid {\ul \tab \tab +\par }\pard \s17\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright {\tab \tab \chpgn +\par }}\pard\plain \nowidctlpar\widctlpar\tqr\tx9900\adjustright \f12\cgrid {\f4\fs48 Appendix A}{\f4\fs48 +\par }\pard \nowidctlpar\widctlpar\tqr\tx9900\adjustright {\f4\fs48 Sample gsh session}{\f4\fs48 +\par }{\pard\plain \nowidctlpar\widctlpar\tqr\tx9900\adjustright \v\f4\fs48\cgrid {\tc {\f4\fs48 {\*\bkmkstart _Toc364094784}{\*\bkmkstart _Toc364095795}.i.Sample gsh session{\*\bkmkend _Toc364094784}{\*\bkmkend _Toc364095795}\tcl1}}}{\f4 +\par +\par The following represents a sample session in gsh. Many of the features discussed in this manual are reviewed here. Comments are enclosed in braces ("\{\}"). +\par }{ +\par }\pard \nowidctlpar\widctlpar\tqr\tx9900\adjustright {\f6\fs20 [1] gno> }{\b\f6\fs20 set}{\f6\fs20 +\par }\pard \nowidctlpar\widctlpar\tqr\tx9900\adjustright {\f6\fs20 savehist = 25 +\par path = /dev/orca/utilities /dev/gno/orca /dev/gno/utilities +\par history = 25 +\par prompt = [%h] %C> +\par user = achin +\par home = /dev/gno +\par nonewline = 1 +\par [2] gno> }{\b\f6\fs20 echo environment variable PROMPT = $PROMPT}{\f6\fs20 +\par environment variable PROMPT = [%h] %C> +\par [3] gno> }{\b\f6\fs20 cat gshrc}{\f6\fs20 +\par \tab }{\f4\fs20 \{ }{\b\f4\fs20 gshrc}{\f4\fs20 is the startup file. \}}{\f6\fs20 +\par }\pard \nowidctlpar\widctlpar\adjustright {\f6\fs20 ### +\par # +\par # GNO 2.0 gshrc file +\par # +\par ### +\par # +\par # Initialize our environment +\par # +\par set path=":hard:gno:bin :right:gno:usr:bin" +\par set prompt="[%h] %S%t%s %C> " +\par set home=":hard:gno:user:root" +\par set term=gnocon +\par }\pard \nowidctlpar\widctlpar\adjustright {\f6\fs20 export path prompt home term +\par }\pard \nowidctlpar\widctlpar\adjustright {\f6\fs20 setenv history=100 savehist=25 +\par ### +\par # +\par #Set up standard prefixes for utilities. +\par # +\par ### +\par prefix 2 :software:orca:libraries +\par prefix 3 :software:orca +\par prefix 4 :software:orca:shell +\par prefix 5 :software:orca:languages +\par prefix 6 :software:orca:utilities +\par prefix 7 :tmp +\par ### +\par # +\par # Set up prefixes for Orca2.0(tm)'s benefit +\par # +\par ### +\par prefix 13 :software:orca:libraries +\par prefix 14 :software:orca +\par prefix 15 :software:orca:shell +\par prefix 16 :software:orca:languages +\par prefix 17 :software:orca:utilities +\par alias ls 'ls -CF' +\par alias dir 'ls -al' +\par alias cp 'cp -i' +\par alias rm 'cp -p rm' +\par alias mv 'cp -p mv' +\par setenv usrman='/usr/man' +\par set fignore='.a .root .sym' +\par alias zcat 'compress -cd' +\par setenv pager=less +\par setenv less=-e +\par set nonewline=1 +\par # +\par # Move to home directory +\par # +\par cd +\par }\pard \nowidctlpar\widctlpar\tqr\tx9900\adjustright {\f6\fs20 [4] gno> }{\b\f6\fs20 cat gshrc > .ttyb&}{\f6\fs20 +\par }\pard \nowidctlpar\widctlpar\tqr\tx9900\adjustright {\f6\fs20 \tab }{\f4\fs20 \{ }{\b\f4\fs20 .ttyb}{\f4\fs20 is the printer connected to the printer port. \}}{\f6\fs20 +\par [2] +\par [5] gno> }{\b\f6\fs20 echo File \\'gshrc\\' sent to printer.}{\f6\fs20 +\par File 'gshrc' sent to printer. +\par [6] gno> }{\b\f6\fs20 alias l 'ls -F'; l}{\f6\fs20 +\par }\pard \nowidctlpar\widctlpar\tqr\tx9900\adjustright {\f6\fs20 \tab }{\f4\fs20 \{ The ls "-F" option displays executable and directory files differently. \}}{\f6\fs20 +\par }\pard \nowidctlpar\widctlpar\tqr\tx9900\adjustright {\f6\fs20 :dev:gno +\par doc/ foo* gsh* gshrc* kern* +\par man/ message message2 orca/ press.release +\par release.notes samples/ todo updates utilities/ +\par [7] gno> }{\b\f6\fs20 history}{\f6\fs20 +\par 1: set +\par 2: echo environment variable PROMPT = $PROMPT +\par 3: cat .gshrc +\par 4: cat .gshrc > .printer& +\par 5: echo File \\'gshrc\\' sent to printer. +\par 6: ls +\par 7: history +\par [8] gno> }{\b\f6\fs20 no_file}{\f6\fs20 +\par no_file: Command not found. +\par [9] gno> }{\b\f6\fs20 message}{\f6\fs20 +\par message: Not executable. +\par [10] gno> }{\b\f6\fs20 unset USER}{\f6\fs20 +\par \tab }{\f4\fs20 \{ Environment variables are not case sensitive. \}}{\f6\fs20 +\par [11] gno> }{\b\f6\fs20 set PATH}{\f6\fs20 +\par +\par path = /dev/orca/utilities /dev/gno/orca /dev/gno/utilities +\par [12] gno> }{\b\f6\fs20 set PROMPT}{\f6\fs20 +\par +\par prompt = [%h] %C> +\par [13] gno> }{\b\f6\fs20 unset PROMPT}{\f6\fs20 +\par % }{\b\f6\fs20 cp message message2&}{\f6\fs20 +\par [2] +\par % }{\b\f6\fs20 rm doc&}{\f6\fs20 +\par rm: :dev:gno:doc directory +\par % }{\b\f6\fs20 rm -r doc&}{\f6\fs20 +\par [3] +\par % }{\b\f6\fs20 ls *}{\f6\fs20 +\par :dev:gno +\par foo* gsh* gshrc* kern* man/ +\par message message2 orca/ press.release release.notes +\par samples/ todo updates utilities/ +\par }{\f6\fs20 +\par }{\f6\fs20 % }{\b\f6\fs20 echo *}{\f6\fs20 +\par gshrc foo message Finder.Data utilities press.release man release.notes todo +\par updates gsh kern samples doc orca message2 +\par % }{\b\f6\fs20 echo g* m*}{\f6\fs20 +\par gshrc gsh message man message2 +\par % }{\b\f6\fs20 echo g?}{\f6\fs20 +\par No match. +\par }\pard \nowidctlpar\widctlpar\tqr\tx9900\adjustright {\f6\fs20 % }{\b\f6\fs20 pwd}{\f6\fs20 +\par }\pard \nowidctlpar\widctlpar\tqr\tx9900\adjustright {\f6\fs20 /dev/gno +\par % }{\b\f6\fs20 clear ; df +\par }{\f6\fs20 .d## Volume Device Free Total Capacity System +\par ---- ---------------- ---------------- ------- ------- -------- ----------- +\par .d1 :system .APPLESCSI.HD01. 25746 50773 49% ProDOS +\par .d2 :dev .APPLESCSI.HD01. 44868 65108 31% ProDOS +\par .d3 :usr .APPLESCSI.HD01. 44526 48725 8% ProDOS +\par .d4 :ram5 .DEV2 493 512 3% ProDOS +\par % }{\b\f6\fs20 which ls cp echo ps}{\f6\fs20 +\par ls: /dev/gno/utilities/ls +\par cp: /dev/gno/utilities/cp +\par echo: Shell Built-in Command +\par ps: Shell Built-in Command +\par % }{\b\f6\fs20 echo -n foo}{\f6\fs20 +\par foo % }{\b\f6\fs20 l .dev2 .applescsi.hd01.01}{\f6\fs20 +\par }{\f4\fs20 \tab \{ Because of the previous "echo -n", the }{\f6\fs20 PROMPT}{\f4\fs20 is displayed on the line where echo output ended. \}}{\f6\fs20 +\par :ram5 +\par df echo history ls ls.ram5 +\par ls.system prefix ps set which +\par +\par :system +\par AppleworksGS/ BASIC.System* HyperCard/ ProDOS* a2fx/ +\par basic.launcher* emacs.icon fontasm/ gutenberg/ icons/ +\par kermit/ publish.it/ review shr.pic/ shrinkit/ +\par snowterm/ system/ +\par % }{\b\f6\fs20 alias print 'echo'; alias copy 'cp'; alias delete 'rm'; alias}{\f6\fs20 +\par }{\b\f6\fs20 catalog 'ls -l'; alias rename 'mv'}{\f6\fs20 +\par \tab }{\f4\fs20 \{ Useful aliases for Orca fans. \}}{\f6\fs20 +\par % }{\b\f6\fs20 alias}{\f6\fs20 +\par l: ls -F +\par print: echo +\par copy: cp +\par delete: rm +\par catalog: ls -l +\par rename: mv +\par % }{\b\f6\fs20 set PROMPT='[!] %C> '}{\f6\fs20 +\par [30] gno> }{\b\f6\fs20 cd samples}{\f6\fs20 +\par [31] samples> }{\b\f6\fs20 cmpl ps.c keep=ps > .dev2/ps&}{\f6\fs20 +\par [2] +\par [32] samples> }{\b\f6\fs20 cmpl kill.c keep=kill > .dev2/kill&}{\f6\fs20 +\par [3] +\par [34] samples> }{\b\f6\fs20 ls dummy_dir}{\f6\fs20 +\par [35] samples> }{\b\f6\fs20 ls -9}{\f6\fs20 +\par ls: unrecognized option `-9' +\par }\pard \nowidctlpar\widctlpar\tqr\tx9900\adjustright {\f6\fs20 usage: ls [-acdfgilqrstu1ACLFR] [name ...] +\par }\pard \nowidctlpar\widctlpar\tqr\tx9900\adjustright {\f6\fs20 [36] samples> }{\b\f6\fs20 ls -9 >& .dev2/error}{\f6\fs20 +\par \tab \{ Each pathname has a device name entry (cf. ps). \} +\par [37] samples> }{\b\f6\fs20 cat < /ram5/error}{\f6\fs20 +\par ls: unrecognized option `-9' +\par usage: ls [-acdfgilqrstu1ACLFR] [name ...] +\par [38] samples> }{\b\f6\fs20 ls *.c;grep \\#\\i\\n\\c\\l\\u\\d\\e [^sfd]*.c}{\f6\fs20 +\par \tab }{\f4\fs20 \{ grep searches for a regular expression in a file and outputs the lines that match. \}}{\f6\fs20 +\par comp.c dp.c edit.c ffdir.c gar.c +\par kill.c link.c ps.c setdebug.c +\par kill.c:#include +\par kill.c:#include +\par kill.c:#include "3/work/gno/conf.h" +\par kill.c:#include "3/work/gno/proc.h" +\par kill.c:#include "3/work/gno/kerntool.h" +\par gar.c:#include +\par gar.c:#include +\par gar.c:#include "3/work/gno/kerntool.h" +\par gar.c:#include +\par ps.c:#include +\par ps.c:#include +\par ps.c:#include +\par ps.c:#include +\par ps.c:#include "3/work/gno/conf.h" +\par ps.c:#include "3/work/gno/proc.h" +\par ps.c:#include "3/work/gno/kvm.h" +\par edit.c:#include +\par edit.c:#include +\par edit.c:#include +\par edit.c:#include +\par edit.c:#include +\par edit.c:#include +\par edit.c:#include +\par edit.c:#include +\par edit.c:#include +\par edit.c:#include +\par edit.c:#include +\par comp.c:#include +\par comp.c:#include +\par comp.c:#include +\par comp.c:#include +\par comp.c:#include +\par comp.c:#include +\par comp.c:#include +\par comp.c:#include +\par }\pard \nowidctlpar\widctlpar\tqr\tx9900\adjustright {\f6\fs20 comp.c:#include +\par }\pard \nowidctlpar\widctlpar\tqr\tx9900\adjustright {\f6\fs20 comp.c:#include +\par link.c:#include +\par link.c:#include +\par link.c:#include +\par link.c:#include +\par link.c:#include +\par link.c:#include +\par link.c:#include +\par link.c:#include +\par link.c:#include +\par [39] samples> }{\b\f6\fs20 head link.c}{\f6\fs20 +\par \tab }{\f4\fs20 \{ head displays the first few lines of a file. \}}{\f6\fs20 +\par /*\tab +\par +\par parsing code for compile, cmpl, cmplg +\par +\par The options flags are set up in a bizarre format as follows: +\par +\par 76543210 76543210 76543210 76543210 +\par yz qrstuvwx ijklmnop abcdefgh +\par [40] samples> }{\b\f6\fs20 set PATH}{\f6\fs20 +\par path = /dev/orca/utilities:/dev/gno/orca:/dev/gno/utilities +\par [41] samples> }{\b\f6\fs20 unset PATH}{\f6\fs20 +\par [42] samples> }{\b\f6\fs20 set PATH}{\f6\fs20 +\par Variable Not Found +\par [43] samples> }{\b\f6\fs20 rm m[e][s][s]age[2]}{\f6\fs20 +\par [44] samples> }{\b\f6\fs20 rehash}{\f6\fs20 +\par hashed 0 files. +\par [45] samples> }{\b\f6\fs20 rm who_cares about_the parameters}{\f6\fs20 +\par \tab }{\f4\fs20 \{ rm will not be recognized as a command because the hash-table is empty. \}}{\f6\fs20 +\par rm: Command not found. +\par [46] samples> }{\b\f6\fs20 set path = /dev/orca/utilities ~/orca ~/utilities}{\f6\fs20 +\par +\par /dev/orca/utilities /dev/gno/orca /dev/gno/utilities = +\par [47] samples> }{\b\f6\fs20 set PATH}{\f6\fs20 +\par +\par path = = +\par [48] samples> }{\b\f6\fs20 set path="~/../orca/utilities ~/orca $HOME/utilities" +\par }{\f6\fs20 \tab }{\f4\fs20 \{ Filename expansion will be performed before PATH is set. \}}{\f6\fs20 +\par [49] samples> }{\b\f6\fs20 set path}{\f6\fs20 +\par +\par path = /dev/orca/utilities /dev/gno/orca /dev/gno/utilities +\par [49] samples> }{\b\f6\fs20 rehash}{\f6\fs20 +\par hashed 68 files. +\par }\pard \nowidctlpar\widctlpar\tqr\tx9900\adjustright {\f6\fs20 +\par }\pard \nowidctlpar\widctlpar\adjustright {\f4\fs48 \page \sect }\sectd \linex0\endnhere\titlepg\sectdefaultcl \pard\plain \nowidctlpar\widctlpar\adjustright \f12\cgrid {\f4\fs48 Appendix B +\par }\pard \nowidctlpar\widctlpar\adjustright {\pard\plain \nowidctlpar\widctlpar\adjustright \v\f4\fs48\cgrid {\tc {\f4\fs48 {\*\bkmkstart _Toc364094785}{\*\bkmkstart _Toc364095796}.i.Prefix Conventions{\*\bkmkend _Toc364094785}{\*\bkmkend _Toc364095796}\tcl1}}}{\f4\fs48 +\par }{\f4 +\par +\par When }{\b\f4 gsh}{\f4 is started, GS/OS assigns certain values to individual prefixes, and usually the }{\i\f4 gshrc}{\f4 file also sets some prefixes. A total of 32 prefixes are available to the user. The following list documents each prefix and the purpose of each. +\par +\par }\pard \fi-1440\li1440\nowidctlpar\widctlpar\adjustright {\f4\ul Number}{\f4 \tab }{\f4\ul Description}{\f4 +\par }\pard \fi-1440\li1440\nowidctlpar\widctlpar\adjustright {\f4 @\tab AppleShare }{\pard\plain \fi-1440\li1440\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 AppleShare }}}{\f4 prefix. If GNO resides on an AppleShare volume, this prefix is set to the pathname of the user's directory on the file server; otherwise, this prefix is set to the same pathname as prefix number 9. +\par *\tab Boot volume prefix. It is not possible to modify the value of this prefix with the shell's }{\f6\fs20 prefix}{\f4 command. The only other way to access this prefix is the GS/OS _GetBootVol call. +\par 0\tab Prefix 0 is the current working directory. It is the prefix that is changed by the }{\f6\fs20 cd}{\pard\plain \fi-1440\li1440\nowidctlpar\widctlpar\adjustright \v\f6\fs20\cgrid {\xe {\v\f6\fs20 }{\f6\fs20 cd}}}{\f4 command. +\par 1\tab Directory a program resides in. In the shell, this is usually /bin. The kernel sets this prefix (and 9/) appropriately for each program that is executed. +\par 2-8\tab Used by Orca 1.0 languages and utilities +\par 2\tab If the ORCA languages are being used, prefix 2 points to the ORCA Libraries directory. +\par 3\tab This prefix should point to the directory that contains ORCA.SYS16. +\par 4\tab ORCA Shell directory should point to the directory that contains the EDITOR, SYSTABS, SYSCMND, etc. files. +\par 5\tab ORCA Languages directory +\par 6\tab ORCA Utilities directory +\par 7\tab ORCA Temp directory - setting this to a RAM disk makes certain editor operations faster. +\par 9\tab Same as prefix 1/ +\par 10-12\tab Standard input, output, and error device names. GNO sets these to be '.ttyco'. +\par 13\tab Same as prefix 2/ above if Orca 2.0 languages are being used. +\par 14\tab Same as prefix 3/ +\par 15\tab Same as prefix 4/ +\par 16\tab Same as prefix 5/ +\par 17\tab Same as prefix 6/ +\par 18\tab Same as prefix 7/ +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\b\f4 \sect }\sectd \linex0\endnhere\titlepg\sectdefaultcl {\headerl \pard\plain \s18\nowidctlpar\widctlpar\tqr\tx10080\adjustright \b\f1\ul\cgrid {Errors\tab Appendix C}{ +\par }}{\headerr \pard\plain \s18\nowidctlpar\widctlpar\tqr\tx10080\adjustright \b\f1\ul\cgrid {Appendix C\tab Errors}{ +\par }}{\footerl \pard\plain \s17\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright \f12\cgrid {\ul \tab \tab +\par }\pard \s17\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright {\chpgn +\par }}{\footerr \pard\plain \s17\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright \f12\cgrid {\ul \tab \tab +\par }\pard \s17\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright {\tab \tab \chpgn +\par }}{\footerf \pard\plain \s17\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright \f12\cgrid {\ul \tab \tab +\par }\pard \s17\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright {\tab \tab \chpgn +\par }}\pard\plain \qj\nowidctlpar\widctlpar\adjustright \f12\cgrid {\f4\fs48 Appendix C +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\fs48\cgrid {\tc {\v\f4\fs48 }{\f4\fs48 {\*\bkmkstart _Toc364094786}{\*\bkmkstart _Toc364095797}.i.Errors{\*\bkmkend _Toc364094786}{\*\bkmkend _Toc364095797}\tcl1}}}{\f4\fs48 +\par }{\f4 +\par +\par }{\b\f4 gsh}{\f4 tries, when an error occurs, to output an informative error message that will lead you to the solution of your problem. This appendix documents all }{\b\f4 gsh}{\f4 error messages and what the probable cause of the problem might be. There are five classes of errors: generic gsh, command-entry, syntax, execution, and built-in. Each error is discussed separately. +\par +\par +\par }{\b\f4 Generic gsh Errors +\par }{\f4 +\par These errors can typically occur at any time and may not be directly related to something the user has done. Some of them are trivial, and some are very serious and should be reported immediately. +\par +\par }{\b\i\f6\fs20 gsh: There are stopped jobs. +\par }{\f4 All jobs must be killed before exiting the shell. Use the jobs and kill commands. +\par +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\b\f4 Command Editing Errors}{\f4 +\par +\par Command editing errors occur when entering information on the command-line. If you try to move the cursor too far to the left or right of your command-line (i.e. before the first character or after the last character), an error will occur. At present, gsh indicates a command-entry error with a }{\b\i\f6\fs20 Beep}{\f4 . This is to notify you that the action you requested is not possible. +\par +\par +\par }{\b\f4 Syntax Errors}{\f4 +\par +\par Syntax errors occur while gsh is trying to understand the command you have entered on the command-line. Problems arise when you wish to quote an argument (") and only enter one quote. +\par +\par }{\b\i\f6\fs20 gsh: Missing ending ". +\par }{\f4 A second " wasn't supplied when quoting text. +\par +\par }{\b\i\f6\fs20 gsh: Missing ending '. +\par }{\f4 A second ' wasn't supplied when quoting text. +\par +\par }{\b\i\f6\fs20 gsh: Too many arguments, so no dessert tonight. +\par }{\f4 The command-line contained too many arguments which exceeded the available memory allocated by }{\b\f4 gsh}{\f4 . +\par +\par }{\b\i\f6\fs20 gsh: Not enough memory for arguments. +\par }{\f4 No memory was available for allocating command-line arguments. +\par +\par }{\b\i\f6\fs20 gsh: Extra '<' encountered. +\par gsh: Extra '>' or '>>' encountered. +\par gsh: Extra '>&' or '>>&' encountered +\par }{\f4 Text may be redirected to only one file. +\par +\par }{\b\i\f6\fs20 gsh: No file specified for '<'. +\par gsh: No file specified for '>' or '>>'. +\par gsh: No file specified for '>&' or '>>&'. +\par }{\f4 A file must be specified when redirecting I/O. +\par +\par }{\b\i\f6\fs20 gsh: '|' conflicts with '>' or '>>'. +\par gsh: '|' conflicts with '<'. +\par }{\f4 Piping is another form of redirection, thus pipes and redirections cannot be mixed. +\par +\par +\par }{\b\f4 Execution Errors}{\f4 +\par +\par After }{\b\f4 gsh}{\f4 parses the command-line, it will then execute the command and pass any arguments to the command. If, however, the command does not exist, }{\b\f4 gsh}{\f4 will report an error. The reason the command does not exist could be either the command name was typed wrong or the command does not exist. +\par +\par }{\b\i\f6\fs20 $0: Command not found. +\par }{\f4 $0 represents the command to be executed. Either the command name was entered incorrectly or the command does not exist. Recheck the spelling of the command and check $PATH to make sure the command exists in the pathname list. +\par +\par }{\b\i\f6\fs20 $0: Not executable. +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 $0 represents the command to be executed. +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 +\par }{\b\i\f6\fs20 heh heh, next time you'll need to specify a command before redirecting. +\par }{\f4 Redirection was specified but the command-line had no command. +\par +\par }{\b\i\f6\fs20 Cannot fork (too many processes?) +\par }{\f4 An error was encountered forking a process. The most likely culprit is there are too many processes running. +\par +\par +\par }{\b\f4 Built-in Command Errors +\par }{\f4 +\par These are errors which can be returned by many of the built-in commands. Every built-in also contains a Usage message on the proper invocation method. +\par +\par }{\b\i\f6\fs20 cd: Not a directory +\par }{\f4 Tried to change the cwd to a file that isn't a directory. +\par +\par }{\b\i\f6\fs20 prefix: could not set prefix, pathname may not exist. +\par }{\f4 GS/OS Prefix command failed, most likely the pathname did not exist or the disk is damaged. +\par +\par }{\b\i\f6\fs20 setdebug: Unknown flag +\par }{\f4 An unknown flag was sent to }{\f6\fs20 setdebug}{\f4 . Run }{\f6\fs20 setdebug}{\f4 with no arguments for a list of possible flags. +\par +\par }{\b\i\f6\fs20 ps: error in kvm_open() +\par }{\f4 ps was unable to access the process data structure. It would be amazing that the kernel is still running for this error to occur. +\par +\par }{\b\i\f6\fs20 set: Variable not specified +\par }{\f4 A variable was not passed to set, for example, "}{\f6\fs20 set =bar}{\f4 ". Make sure the variable name was specified without the preceding dollar sign. For example, if foo is not set, then "}{\f6\fs20 set $foo=bar}{\f4 " would be expanded to "}{\f6\fs20 set =bar}{\f4 ", this resulting in this error. +\par +\par }{\b\i\f6\fs20 kill: Invalid signal number +\par kill: Invalid signal name +\par }{\f4 See Appendix C for a list of valid signal numbers and names. +\par +\par }{\b\i\f6\fs20 fg: No job to foreground. +\par bg: No job to background. +\par stop: No job to stop. +\par }{\f4 There aren't any jobs so this command is useless. +\par +\par }{\b\i\f6\fs20 fg: No such job. +\par bg: No such job. +\par stop: No such job. +\par kill: No such job. +\par }{\f4 The specified job (or process) doesn't exist. +\par +\par }{\b\i\f6\fs20 fg: Gee, this job is already in the foreground. +\par bg: Gee, this job is already in the background. +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\b\i\f6\fs20 stop: Gee, this job is already stopped. +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 Well, this should be self-explanatory. Also, some of these should be impossible to get, unless you're bound and determined to crash gsh, but then, these errors will keep you from crashing it, so, what's the point? +\par }{\b\f4 \sect }\sectd \linex0\endnhere\titlepg\sectdefaultcl {\headerl \pard\plain \s18\nowidctlpar\widctlpar\tqr\tx10080\adjustright \b\f1\ul\cgrid {\f5 Signals\tab Ap}{\f5 pendix D +\par }\pard \s18\nowidctlpar\widctlpar\tqr\tx10080\adjustright { +\par }}{\headerr \pard\plain \s18\nowidctlpar\widctlpar\tqr\tx10080\adjustright \b\f1\ul\cgrid {\f5 Appendix D\tab \tab Signals +\par }\pard \s18\nowidctlpar\widctlpar\tqr\tx10080\adjustright { +\par }}{\footerl \pard\plain \s17\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright \f12\cgrid {\ul \tab \tab +\par }\pard \s17\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright {\chpgn +\par }}{\footerr \pard\plain \s17\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright \f12\cgrid {\ul \tab \tab +\par }\pard \s17\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright {\tab \tab \chpgn +\par }}{\footerf \pard\plain \s17\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright \f12\cgrid {\ul \tab \tab +\par }\pard \s17\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright {\tab \tab \chpgn +\par }}\pard\plain \nowidctlpar\widctlpar\adjustright \f12\cgrid {\f4\fs48 Appendix D +\par }\pard \nowidctlpar\widctlpar\adjustright {\f4\fs48 Signals}{\pard\plain \nowidctlpar\widctlpar\adjustright \v\f4\fs48\cgrid {\tc {\f4\fs48 {\*\bkmkstart _Toc364094787}{\*\bkmkstart _Toc364095798}Signals{\*\bkmkend _Toc364094787}{\*\bkmkend _Toc364095798}\tcl1}}}{\f4\fs48 +\par }{\f4 +\par +\par +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 The following list describes all signals present in the GNO Multitasking Environment. These signals}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 signals}}}{\f4 are used to communicate with processes and the GNO kernel}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GNO kernel}}}{\f4 . }{\b\f4 gsh}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 gsh}}}{\f4 provides a means to send signals}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 signals}}}{\f4 to processes via the kill command. Furthermore, GNO/ME}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GNO/ME}}}{\f4 provides interfaces for C and Assembly Language programmers to handle signals in their programs. Note that not all of these signals are actually used in GNO/ME}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GNO/ME}}}{\f4 2.0. +\par }\pard \nowidctlpar\widctlpar\adjustright {\f4 +\par }\pard \fi-2160\li2880\nowidctlpar\widctlpar\adjustright {\f4\ul Name (Value)}{\f4 \tab }{\f4\ul Description +\par }\pard \fi-2160\li2880\nowidctlpar\widctlpar\adjustright {\f4 +\par }{\b\f4 SIGHUP}{\pard\plain \fi-2160\li2880\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 SIGHUP}}}{\f4 (1)\tab Hangup. +\par }{\b\f4 SIGINT}{\pard\plain \fi-2160\li2880\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 SIGINT}}}{\f4 (2)\tab Interrupt. +\par }{\b\f4 SIGQUIT}{\pard\plain \fi-2160\li2880\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 SIGQUIT}}}{\f4 (3)\tab Quit. +\par }{\b\f4 SIGILL}{\pard\plain \fi-2160\li2880\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 SIGILL}}}{\f4 (4)\tab Illegal Instruction. +\par }{\b\f4 SIGTRAP}{\pard\plain \fi-2160\li2880\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 SIGTRAP}}}{\f4 (5)\tab Trace trap. +\par }{\b\f4 SIGABRT}{\pard\plain \fi-2160\li2880\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 SIGABRT}}}{\f4 (6)\tab Abort (cf. abort(3)). +\par }{\b\f4 SIGEMT}{\pard\plain \fi-2160\li2880\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 SIGEMT}}}{\f4 (7)\tab Emulator trap. +\par }{\b\f4 SIGFPE}{\pard\plain \fi-2160\li2880\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 SIGFPE}}}{\f4 (8)\tab Arithmetic exception. +\par }{\b\f4 SIGKILL}{\pard\plain \fi-2160\li2880\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 SIGKILL}}}{\f4 (9)\tab Kill. This signal cannot be caught, blocked, or ignored. If a signal is not specified for the kill command, this signal is sent to the process. +\par }{\b\f4 SIGBUS}{\pard\plain \fi-2160\li2880\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 SIGBUS}}}{\f4 (10)\tab Bus error. +\par }{\b\f4 SIGSEGV}{\pard\plain \fi-2160\li2880\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 SIGSEGV}}}{\f4 (11)\tab Segmentation violation. +\par }{\b\f4 SIGSYS}{\pard\plain \fi-2160\li2880\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 SIGSYS}}}{\f4 (12)\tab Bad argument to system call. +\par }{\b\f4 SIGPIPE}{\pard\plain \fi-2160\li2880\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 SIGPIPE}}}{\f4 (13)\tab Write on a pipe or other socket with no one to read it. +\par }{\b\f4 SIGALRM}{\pard\plain \fi-2160\li2880\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 SIGALRM}}}{\f4 (14)\tab Alarm clock. +\par }{\b\f4 SIGTERM}{\pard\plain \fi-2160\li2880\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 SIGTERM}}}{\f4 (15)\tab Software termination signal. +\par }{\b\f4 SIGURG}{\pard\plain \fi-2160\li2880\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 SIGURG}}}{\f4 (16)\tab Urgent condition present on socket. +\par }{\b\f4 SIGSTOP}{\pard\plain \fi-2160\li2880\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 SIGSTOP}}}{\f4 (17)\tab Stop. This signal cannot be caught, blocked, or ignored. +\par }{\b\f4 SIGTSTP}{\pard\plain \fi-2160\li2880\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 SIGTSTP}}}{\f4 (18)\tab Stop signal generated from keyboard. +\par }{\b\f4 SIGCONT}{\pard\plain \fi-2160\li2880\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 SIGCONT}}}{\f4 (19)\tab Continue after stop. This signal cannot be blocked. +\par }{\b\f4 SIGCHLD}{\pard\plain \fi-2160\li2880\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 SIGCHLD}}}{\f4 (20)\tab Child status has changed. +\par }{\b\f4 SIGTTIN}{\pard\plain \fi-2160\li2880\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 SIGTTIN}}}{\f4 (21)\tab Background read attempted from control terminal. +\par }{\b\f4 SIGTTOU}{\pard\plain \fi-2160\li2880\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 SIGTTOU}}}{\f4 (22)\tab Background write attempted to control terminal. +\par }{\b\f4 SIGIO}{\pard\plain \fi-2160\li2880\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 SIGIO}}}{\f4 (23)\tab Input/Output possible signal. +\par }{\b\f4 SIGXCPU}{\pard\plain \fi-2160\li2880\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 SIGXCPU}}}{\f4 (24)\tab Exceeded CPU time limit. +\par }{\b\f4 SIGUSR1}{\pard\plain \fi-2160\li2880\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 SIGUSR1}}}{\f4 (30)\tab User defined signal 1. +\par }{\b\f4 SIGUSR2}{\pard\plain \fi-2160\li2880\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 SIGUSR2}}}{\f4 (31)\tab User defined signal 2. +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\b\f4 +\par \page \sect }\sectd \linex0\endnhere\titlepg\sectdefaultcl {\headerl \pard\plain \s18\nowidctlpar\widctlpar\tqr\tx10080\adjustright \b\f1\ul\cgrid {\f5 Non-Compliant Applications\tab Appendix E +\par }\pard \s18\nowidctlpar\widctlpar\tqr\tx10080\adjustright { +\par }}{\headerr \pard\plain \s18\qj\nowidctlpar\widctlpar\tqr\tx10080\adjustright \b\f1\ul\cgrid {\f5 Appendix E\tab Non-Compliant Applications +\par }\pard \s18\qj\nowidctlpar\widctlpar\tqr\tx10080\adjustright { +\par }}{\footerl \pard\plain \s17\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright \f12\cgrid {\ul \tab \tab +\par }{\chpgn +\par }}{\footerr \pard\plain \s17\qj\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright \f12\cgrid {\ul \tab \tab +\par }\pard \s17\qj\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright {\tab \tab \chpgn +\par }}{\footerf \pard\plain \s17\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright \f12\cgrid {\ul \tab \tab +\par }\pard \s17\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright {\tab \tab \chpgn +\par }}\pard\plain \qj\nowidctlpar\widctlpar\adjustright \f12\cgrid {\f4\fs48 Appendix E +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4\fs48 Non-Compliant Applications}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\fs48\cgrid {\tc {\f4\fs48 {\*\bkmkstart _Toc364094788}{\*\bkmkstart _Toc364095799}Non-Compliant Applications{\*\bkmkend _Toc364094788}{\*\bkmkend _Toc364095799}\tcl1}}}{\f4 +\par +\par +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 GNO/ME}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GNO/ME}}}{\f4 wasn't really designed with the intention of making EVERY program you currently run work under GNO/ME; that task would have been impossible. Our main goal was to provide a UNIX}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 UNIX}}}{\f4 -based multitasking environment; that we have done. We made sure as many existing applications as we had time to track and debug worked with GNO/ME}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GNO/ME}}}{\f4 . The current list of compatible and non-compatible applications can be found in the file "RELEASE.NOTES}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 RELEASE.NOTES}}}{\f4 " on the GNO/ME}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GNO/ME}}}{\f4 disk. +\par +\par However, due to the sheer number of applications and authors, there are some programs that just plain don't work; and some that mostly work, except for annoyances such as two cursors appearing, or keyboard characters getting 'lost'. The problem here is that some programs use their own text drivers (since TextTools}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 TextTools}}}{\f4 output was very slow at one time); since GNO/ME}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GNO/ME}}}{\f4 doesn't know about these custom drivers, it goes on buffering keyboard characters and displaying the cursor. There is a way, however, to tell GNO/ME}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GNO/ME}}}{\f4 about these programs that break GNO/ME}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GNO/ME}}}{\f4 's rules. +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 +\par We've defined an auxType}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 auxType}}}{\f4 for S16}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 S16}}}{\f4 and EXE}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 EXE}}}{\f4 files, to allow distinction between programs that are GNO/ME}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GNO/ME}}}{\f4 compliant and those that are not. Setting the auxType}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 auxType}}}{\f4 of an application to $DC00}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 $DC00}}}{\f4 disables the interrupt driven keyboard buffering and turns off the GNO/ME cursor. Desktop}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 Desktop}}}{\f4 programs use the GNO/ME}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 GNO/ME}}}{\f4 keyboard I/O}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 I/O}}}{\f4 via the Event Manager}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 Event Manager}}}{\f4 , and thus should }{\i\f4 not}{\f4 have their auxType}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 auxType}}}{\f4 changed. +\par +\par You can change a program's auxType}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 auxType}}}{\f4 with the following shell command: +\par +\par }{\f6 \tab chtyp}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f6\cgrid {\xe {\v\f6 }{\f6 chtyp}}}{\f6 -a \\$DC00 filename}{\f4 +\par +\par where filename is the name of the application. As more programmers become aware of GNO/ME and work to make their software compatible with it, this will become less of a problem, but for older applications that are unlikely to ever change (like the America OnLine software) $DC00 is a reasonable approach. +\par }{ +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\b\f4 \page \sect }\sectd \linex0\endnhere\titlepg\sectdefaultcl {\headerl \pard\plain \s18\nowidctlpar\widctlpar\tqr\tx10080\adjustright \b\f1\ul\cgrid {\f5 Termcaps\tab Appendix F +\par }\pard \s18\nowidctlpar\widctlpar\tqr\tx10080\adjustright { +\par }}{\headerr \pard\plain \s18\nowidctlpar\widctlpar\tqr\tx10080\adjustright \b\f1\ul\cgrid {\f5 Appendix F\tab Termcaps +\par }\pard \s18\nowidctlpar\widctlpar\tqr\tx10080\adjustright { +\par }}{\footerl \pard\plain \s17\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright \f12\cgrid {\ul \tab \tab +\par }\pard \s17\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright {\chpgn +\par }\pard \s17\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright { +\par }}{\footerr \pard\plain \s17\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright \f12\cgrid {\ul \tab \tab +\par }\pard \s17\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright {\tab \tab \chpgn +\par }\pard \s17\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright { +\par }}{\footerf \pard\plain \s17\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright \f12\cgrid {\ul \tab \tab +\par }\pard \s17\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright {\tab \tab \chpgn +\par }\pard \s17\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright { +\par }}\pard\plain \qj\nowidctlpar\widctlpar\adjustright \f12\cgrid {\f4\fs48 Appendix F +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4\fs48 Termcaps}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\fs48\cgrid {\tc {\f4\fs48 {\*\bkmkstart _Toc364095800}Termcaps{\*\bkmkend _Toc364095800}\tcl1}}}{\f4 +\par +\par +\par +\par 'Termcap' is short for 'terminal capability', and is the name of a database which applications can use to do full-screen output on any kind of terminal}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 terminal}}}{\f4 . The termcap}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 termcap}}}{\f4 database contains records for the various supported terminals, each of which contains fields that look like this: +\par +\par \tab }{\b\f4 cap}{\f4 =}{\b\f4 value}{\f4 +\par +\par }{\b\f4 cap}{\f4 is a two-letter code that represents a cursor movement, screen mode change (such as inverse or underline mode), and various other things. }{\b\f4 Value}{\f4 is usually a sequence of control characters that is sent to a terminal to initiate the desired action. }{\b\f4 Value}{\f4 can also be 'boolean', or yes/no, values, for such things as "Does this terminal support cursor movement?". The termcap file is documented in the electronic manual entry }{\b\f4 termcap}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 termcap}}}{\f4 (5). +\par +\par The termcap library does not specifically require GNO/ME. +\par +\par The following terminal types are supported in the GNO/ME termcap file: +\par +\par }\pard \qj\nowidctlpar\widctlpar\tx720\tx2880\adjustright {\f4 \tab gnocon}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tx2880\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 gnocon}}}{\f4 \tab GNO Console +\par \tab CONSOLE}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tx2880\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 CONSOLE}}}{\f4 \tab GS/OS .console driver +\par \tab ptse}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tx2880\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 ptse}}}{\f4 \tab Proterm Special Emulation +\par \tab vt100}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tx2880\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 vt100}}}{\f4 \tab DEC VT-100 terminal +\par \tab ansisys}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tx2880\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 ansisys}}}{\f4 \tab MS-DOS ANSI.SYS +\par \tab xerox820}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tx2880\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 xerox820}}}{\f4 \tab Xerox 820-II CP/M terminal +\par \tab iw1}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tx2880\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 iw1}}}{\f4 \tab Apple ImageWriter I printer +\par \tab iw-alt}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tx2880\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 iw-alt}}}{\f4 \tab Alternate ImageWriter I printer +\par \tab deskjet}{\pard\plain \qj\nowidctlpar\widctlpar\tx720\tx2880\adjustright \v\f4\cgrid {\xe {\v\f4 }{\f4 deskjet}}}{\f4 \tab Hewlett Packard DeskJet 500 printer +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 +\par The printer entries allow a formatted electronic manual page to be sent to the printer. For example, the following script would bring up the manual page for '}{\b\f4 ls}{\pard\plain \qj\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v\f4 }{\b\f4 ls}}}{\f4 ', format it for the DeskJet 500, and print it with italics and boldface: +\par +\par set temp=$term +\par set term=deskjet +\par man $1 > .ttyb +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 set term=$temp +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\b\f4 \sect }\sectd \linex0\endnhere\titlepg\sectdefaultcl {\headerl \pard\plain \s18\nowidctlpar\widctlpar\tqr\tx10080\adjustright \b\f1\ul\cgrid {\f5 \tab }{\f5 Glossary}{\f5 +\par }\pard \s18\nowidctlpar\widctlpar\tqr\tx10080\adjustright { +\par }}{\headerr \pard\plain \s18\nowidctlpar\widctlpar\tqr\tx10080\adjustright \b\f1\ul\cgrid {\f5 Glossary\tab }{\f5 +\par }\pard \s18\nowidctlpar\widctlpar\tqr\tx10080\adjustright { +\par }}{\footerl \pard\plain \s17\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright \f12\cgrid {\ul \tab \tab +\par }\pard \s17\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright {\chpgn +\par }\pard \s17\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright { +\par }}{\footerr \pard\plain \s17\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright \f12\cgrid {\ul \tab \tab +\par }\pard \s17\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright {\tab \tab \chpgn +\par }\pard \s17\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright { +\par }}{\footerf \pard\plain \s17\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright \f12\cgrid {\ul \tab \tab +\par }\pard \s17\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright {\tab \tab \chpgn +\par }\pard \s17\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright { +\par }}\pard\plain \qj\fi-2340\li2340\nowidctlpar\widctlpar\adjustright \f12\cgrid {\f4\fs48 Glossary}{\pard\plain \qj\fi-2340\li2340\nowidctlpar\widctlpar\adjustright \v\f4\fs48\cgrid {\tc {\f4\fs48 {\*\bkmkstart _Toc364095801}Glossary{\*\bkmkend _Toc364095801}\tcl1}}}{\f4\fs48 +\par }\pard \qj\fi-2340\li2340\nowidctlpar\widctlpar\adjustright {\f4 +\par +\par +\par }{\b\i\f4 Alias}{\f4 . \tab A name used as an abbreviation for one or more commands. An alias allows you to replace any command string with a short sequence of characters. +\par }{\b\i\f4 Applesoft}{\f4 .\tab An implementation of BASIC for the Apple II.}{\b\i\f4 +\par APW}{\f4 .\tab Apple Programmer's Workshop. Similar to ORCA. +\par }{\b\i\f4 BASIC}{\f4 .\tab Beginners All-purpose Symbolic Instruction Code. A simple computer language.}{\b\i\f4\fs28 +\par }{\b\i\f4 Built-in command}{\f4 .\tab A command processed by }{\b\f4 gsh}{\f4 . These commands are not external to the shell, but are included within the }{\b\f4 gsh}{\f4 program. +\par }{\b\i\f4 Command}{\f4 .\tab An action for }{\b\f4 gsh}{\f4 to perform. Commands can be either simple or compound. A simple command is an alias assignment, variable assignment, I/O redirection, or built-in command. A compound command is a pipeline. +\par }{\b\i\f4 Directory}{\f4 .\tab A special type of file that contains a list of other files; usually used to categorize files related in some way. +\par }{\b\i\f4 Environment}{\f4 .\tab The state of a process, which includes information such as its open files, current directory (working directory), and local and global variables. Three environments exist under }{\b\f4 gsh}{\f4 : +\par }{\i\f4 \tab Child environment}{\f4 :: The environment of the child process. +\par }{\i\f4 \tab Current environment}{\f4 :: The environment of the current process. +\par }{\i\f4 \tab Parent environment}{\f4 :: The environment of the parent process. +\par }{\b\i\f4 Environment file}{\f4 .\tab A file that is interpreted by an application to allow the user to customize its operation. For }{\b\f4 gsh}{\f4 , this file is "gshrc". +\par }{\b\i\f4 Export}{\f4 .\tab A way to pass a variable from a parent process to child process. +\par }{\b\i\f4 File}{\f4 .\tab An object used to store data and/or programs. On the II}{\f4\fs20 GS}{\f4 , files are tagged with types such as EXE, SRC, TXT, etc. +\par }{\b\i\f4 Filter}{\f4 .\tab A command that reads from its standard input and writes to its standard output. For example, a filter program could be written to convert all characters to upper case. Filters are used mainly in pipelines. +\par }{\b\i\f4 Flag}{\f4 .\tab A character used to represent an option to a command. Flags are either short or long options whose character representations are "-" and "+". +\par }{\b\i\f4 Glob}{\f4 .\tab Slang for Pathname Expansion. +\par }{\b\i\f4 GNO/ME}{\f4 .\tab GNO Multitasking Environment. The complete package including the GNO kernel and the GNO Shell. +\par }{\b\i\f4 GNO Kernel}{\f4 .\tab Heart of GNO/ME. Executes processes when asked by the GNO Shell +\par }{\b\i\f4 GNO Shell}{\f4 .\tab Provides an interface between the user and the GNO kernel. +\par }{\b\i\f4 gsh}{\f4 .\tab GNO Implementation of a UNIX-like shell. +\par }{\b\i\f4 GS/OS}{\f4 .\tab 16 bit Operating System for the Apple IIgs.}{\b\i\f4 +\par History}{\f4 .\tab A variable number of command-lines saved by }{\b\f4 gsh}{\f4 for future reference. The number of command-lines saved is dependent on the }{\f6\fs20 $HISTORY}{\f4 environment variable. +\par }{\b\i\f4 History file}{\f4 .\tab A file containing command-lines entered while in a }{\b\f4 gsh}{\f4 session. The number of command-lines saved is dependent on the }{\f6\fs20 $SAVEHIST}{\f4 environment variable. +\par }{\b\i\f4 Interrupt}{\f4 .\tab A signal generated by a sequence of keyboard characters or by a command that terminates the current executing process, unless the process has set up a trap to handle the interrupt signal. +\par }{\b\i\f4 I/O Redirection}{\f4 .\tab The process of changing the standard input, standard output, and standard error associated with a process so that it is redirected to a file instead of the console. +\par }{\b\i\f4 Job}{\f4 .\tab A set of related processes. A job can be either: +\par }{\i\f4 \tab Background job}{\f4 :A process that executes with the current process. Background jobs are not associated with the terminal. +\par }{\i\f4 \tab Foreground job}{\f4 : A process that is currently executing and which is associated with the terminal. +\par }{\b\i\f4 Multiprocessing}{\f4 .\tab Indicates a machine with more than one CPU. +\par }{\b\i\f4 Multitasking}{\f4 .\tab The ability to run more than one program at a time, or the illusion of more than one program running at a time - usually the latter. +\par }{\b\i\f4 ORCA}{\f4 \tab Shell programing environment for the Apple //gs. Also a type of whale. +\par }{\b\i\f4 Path search}{\f4 .\tab The means of searching a pathname list for a command or script. +\par }{\b\i\f4 Pathname}{\f4 .\tab A string used to identify a file. +\par }{\i\f4 \tab Pathname completion}{\f4 . The means of generating all pathnames matching a given pattern. +\par }{\i\f4 \tab Pathname expansion}{\f4 . The means of replacing a pattern with a list of pathnames matching that pattern. +\par }{\b\i\f4 Pattern}{\f4 .\tab A string of characters used to match literal characters and/or multiple characters. +\par }{\b\i\f4 Permission}{\f4 .\tab Each file has certain permissions associated with it: destroy, rename, backup, invisible, write, and read. +\par }\pard \qj\fi-2340\li2340\nowidctlpar\widctlpar\adjustright {\b\i\f4 Pipe}{\f4 .\tab A conduit through which a stream of characters can pass from one process to another. This is accomplished by linking the standard output of one process to the standard input of a second process. +\par }\pard \qj\fi-2340\li2340\nowidctlpar\widctlpar\adjustright {\b\i\f4 Pipeline}{\f4 .\tab Two or more processes connected together by pipes. +\par }{\b\i\f4 Process}{\f4 .\tab A single thread of execution that consists of a program and an execution environment. +\par }{\i\f4 \tab Child process}{\f4 : A new process created by another process. +\par }{\i\f4 \tab Parent process}{\f4 : A process that creates a child process. +\par }{\b\i\f4 Process id}{\f4 :\tab Each active process is uniquely identified by a positive integer called the process id. +\par }{\b\i\f4 ProDOS}{\f4 .\tab 8-bit Disk Operating System for Apple II computers. +\par }{\b\i\f4 Prompt}{\f4 .\tab A message displayed by }{\b\f4 gsh}{\f4 when it is ready to receive a command. +\par }{\b\i\f4 Quoting}{\f4 .\tab A means of including special characters as arguments to a command or as the command name. Certain characters have certain meanings to }{\b\f4 gsh}{\f4 and quoting them makes }{\b\f4 gsh}{\f4 ignore them. +\par }{\b\i\f4 Reserved word}{\f4 .\tab A word that is treated specially by }{\b\f4 gsh}{\f4 . This word is part of the }{\b\f4 gsh}{\f4 grammar. +\par }{\b\i\f4 Script}{\f4 .\tab A sequence of commands contained in a file.}{\b\i\f4 +\par Signal}{\f4 .\tab An asynchronous message that consists of a number or name that can be sent from one process to another. +\par }{\b\i\f4 Standard Error}{\f4 .\tab The file associated with error messages for a process. This file is usually the terminal. +\par }{\b\i\f4 Standard Input}{\f4 .\tab The file associated with a processes input. This file is usually the terminal. +\par }\pard \qj\fi-2340\li2340\nowidctlpar\widctlpar\adjustright {\b\i\f4 Standard Output}{\f4 .\tab The file associated with a processes output. This file is usually the terminal. +\par }{\b\i\f4 Tilde Expansion}{\f4 .\tab Words beginning with "}{\b\f4 ~}{\f4 " are treated specially by }{\b\f4 gsh}{\f4 . The "}{\b\f4 ~}{\f4 " is expanded to the value of the }{\f6\fs20 HOME }{\f4 variable. +\par }{\b\i\f4 UNIX}{\f4 .\tab Popular operating system which has growing use in education and business. One of the first operating systems to support multitasking.}{\b\i\f4 +\par Variable}{\f4 .\tab A named location in }{\b\f4 gsh}{\f4 that contains text. The text of a variable can be expanded in a command by preceding the variable name with a dollar sign ($). +\par }{\b\i\f4 Wildcard}{\f4 .\tab See Pattern and Pathname Expansion. +\par }{\b\i\f4 Working directory}{\f4 .\tab The current directory. +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\b\f4 +\par \sect }\sectd \sbknone\linex0\endnhere\titlepg\sectdefaultcl {\headerl \pard\plain \s18\nowidctlpar\widctlpar\tqr\tx10080\adjustright \b\f1\ul\cgrid {\f5 \tab }{\f5 Index}{\f5 +\par }\pard \s18\nowidctlpar\widctlpar\tqr\tx10080\adjustright { +\par }}{\headerr \pard\plain \s18\nowidctlpar\widctlpar\tqr\tx10080\adjustright \b\f1\ul\cgrid {\f5 Index\tab }{\f5 +\par }\pard \s18\nowidctlpar\widctlpar\tqr\tx10080\adjustright { +\par }}\pard\plain \qj\nowidctlpar\widctlpar\adjustright \f12\cgrid {\f4\fs48 \sect }\sectd \sbknone\linex0\endnhere\titlepg\sectdefaultcl \pard\plain \qj\nowidctlpar\widctlpar\adjustright \f12\cgrid {\f4\fs48 \sect }\sectd \linex0\endnhere\titlepg\sectdefaultcl \pard\plain \qj\nowidctlpar\widctlpar\adjustright \f12\cgrid {\f4\fs48 Index +\par }\pard\plain \s19\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright \fs20\cgrid { +\par }\pard \s19\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright {\field\fldedit{\*\fldinst {\fs24 INDEX \\h "A" \\c "2" }}{\fldrslt {\fs24\lang1024 \sect }\sectd \sbknone\linex0\cols2\endnhere\titlepg\sectdefaultcl \pard\plain \s28\li140\sb240\sa120\keepn\nowidctlpar\widctlpar\adjustright \b\f1\fs28\cgrid {\b0\f0\lang1024 $ +\par }\pard\plain \s19\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright \fs20\cgrid {\lang1024 $, 42 +\par }\pard \s19\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright {\lang1024 $<, 40 +\par $0, 39 +\par $1, 39 +\par $2, 39 +\par $DC00, 57 +\par $ECHO, 40 +\par $FIGNORE, 13, 40 +\par $HISTORY, 12, 40 +\par $HOME, 12, 40 +\par $IGNOREEOF, 40 +\par $NOBEEP, 40 +\par $NODIREXEC, 40 +\par $NOGLOB, 40 +\par $NONEWLINE, 40 +\par }\pard \s19\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright {\lang1024 $PATH, 36, 40 +\par }\pard \s19\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright {\lang1024 $PRECMD, 41 +\par $PROMPT, 41 +\par $PUSHDSILENT, 41 +\par $SAVEHIST, 12, 41 +\par $TERM, 41 +\par $TERMCAP, 41 +\par $USER, 42 +\par }\pard\plain \s28\li140\sb240\sa120\keepn\nowidctlpar\widctlpar\adjustright \b\f1\fs28\cgrid {\b0\f0\lang1024 & +\par }\pard\plain \s19\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright \fs20\cgrid {\lang1024 &, 20 +\par }\pard\plain \s28\li140\sb240\sa120\keepn\nowidctlpar\widctlpar\adjustright \b\f1\fs28\cgrid {\b0\f0\lang1024 . +\par }\pard\plain \s19\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright \fs20\cgrid {\b\lang1024 .}{\lang1024 , 24 +\par }\pard \s19\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright {\b\lang1024 ..}{\lang1024 , 24 +\par }\pard\plain \s28\li140\sb240\sa120\keepn\nowidctlpar\widctlpar\adjustright \b\f1\fs28\cgrid {\b0\f0\lang1024 ; +\par }\pard\plain \s19\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright \fs20\cgrid {\lang1024 ;, 20 +\par }\pard\plain \s28\li140\sb240\sa120\keepn\nowidctlpar\widctlpar\adjustright \b\f1\fs28\cgrid {\b0\f0\lang1024 \\ +\par }\pard\plain \s19\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright \fs20\cgrid {\lang1024 \\n, 32, 41 +\par }\pard \s19\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright {\lang1024 \\r, 32, 41 +\par \\t, 32, 41 +\par }\pard\plain \s28\li140\sb240\sa120\keepn\nowidctlpar\widctlpar\adjustright \b\f1\fs28\cgrid {\b0\f0\lang1024 ^ +\par }\pard\plain \s19\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright \fs20\cgrid {\b\lang1024 ^C}{\lang1024 , 21 +\par }\pard \s19\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright {\b\lang1024 ^Z}{\lang1024 , 21 +\par }\pard\plain \s28\li140\sb240\sa120\keepn\nowidctlpar\widctlpar\adjustright \b\f1\fs28\cgrid {\b0\f0\lang1024 ~ +\par }\pard\plain \s19\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright \fs20\cgrid {\b\lang1024 ~}{\lang1024 , 24 +\par }\pard\plain \s28\li140\sb240\sa120\keepn\nowidctlpar\widctlpar\adjustright \b\f1\fs28\cgrid {\b0\f0\lang1024 < +\par }\pard\plain \s19\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright \fs20\cgrid {\b\lang1024 <}{\lang1024 , 18 +\par }\pard\plain \s28\li140\sb240\sa120\keepn\nowidctlpar\widctlpar\adjustright \b\f1\fs28\cgrid {\b0\f0\lang1024 > +\par }\pard\plain \s19\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright \fs20\cgrid {\b\lang1024 >}{\lang1024 , 18 +\par }\pard \s19\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright {\lang1024 >&, 18 +\par >>, 18 +\par >>&, 18 +\par }\pard\plain \s28\li140\sb240\sa120\keepn\nowidctlpar\widctlpar\adjustright \b\f1\fs28\cgrid {\b0\f0\lang1024 A +\par }\pard\plain \s19\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright \fs20\cgrid {\lang1024 accelerator, 21 +\par }\pard \s19\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright {\lang1024 alias, 17, 18 +\par }{\b\lang1024 alias}{\lang1024 , 35, 41 +\par ansisys, 59 +\par AppleShare, 51 +\par argument, 24 +\par auxType, 57 +\par }\pard\plain \s28\li140\sb240\sa120\keepn\nowidctlpar\widctlpar\adjustright \b\f1\fs28\cgrid {\b0\f0\lang1024 B +\par }\pard\plain \s19\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright \fs20\cgrid {\b\lang1024 Background}{\lang1024 , 19, 20, 21, 22 +\par }\pard \s19\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright {\lang1024 background, 20 +\par }{\b\lang1024 backward-char}{\lang1024 , 10, 29 +\par }{\b\lang1024 backward-delete-char}{\lang1024 , 11, 29 +\par }{\b\lang1024 backward-word}{\lang1024 , 11, 29 +\par }\pard \s19\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright {\lang1024 BASIC, 15 +\par }\pard \s19\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright {\b\lang1024 beginning-of-line}{\lang1024 , 11, 29, 30 +\par }{\b\lang1024 bg}{\lang1024 , 22 +\par bg, 33 +\par bindkey, 9, 29 +\par BLOCKED, 34 +\par Bourne shell, 5 +\par }{\b\lang1024 Built-In Commands}{\lang1024 , 9 +\par built-ins, 29 +\par }\pard\plain \s28\li140\sb240\sa120\keepn\nowidctlpar\widctlpar\adjustright \b\f1\fs28\cgrid {\b0\f0\lang1024 C +\par }\pard\plain \s19\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright \fs20\cgrid {\lang1024 C shell, 5 +\par }\pard \s19\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright {\b\lang1024 cat}{\lang1024 , 18, 24 +\par cd, 51 +\par }{\b\lang1024 cd}{\lang1024 , 30 +\par }{\b\lang1024 chdir}{\lang1024 , 30 +\par child process, 39 +\par chtyp, 57 +\par CLEAR, 11, 31 +\par }{\b\lang1024 clear-screen}{\lang1024 , 10, 29 +\par }{\b\lang1024 cmpl}{\lang1024 , 20, 22 +\par }{\b\lang1024 coff}{\lang1024 , 16, 19 +\par coff, 16 +\par command arguments, 9 +\par command name, 9, 17 +\par command-line, 5, 9, 13, 17, 20, 21 +\par command-line buffer, 17 +\par command-line editor, 9, 12, 29, 30 +\par }{\b\lang1024 commands}{\lang1024 , 30 +\par }{\b\lang1024 complete-word}{\lang1024 , 12, 29 +\par CONSOLE, 59 +\par }{\b\lang1024 cp}{\lang1024 , 20, 22, 24, 39 +\par CTRL-A, 11, 30 +\par CTRL-B, 10 +\par CTRL-D, 10, 11, 12, 13 +\par CTRL-E, 11 +\par CTRL-F, 10 +\par CTRL-K, 30 +\par CTRL-L, 10 +\par CTRL-N, 12 +\par CTRL-P, 12 +\par CTRL-R, 10 +\par CTRL-X, 11 +\par }\pard\plain \s28\li140\sb240\sa120\keepn\nowidctlpar\widctlpar\adjustright \b\f1\fs28\cgrid {\b0\f0\lang1024 D +\par }\pard\plain \s19\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright \fs20\cgrid {\lang1024 DELETE, 11 +\par }\pard \s19\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright {\b\lang1024 delete-char}{\lang1024 , 11, 29 +\par }\pard \s19\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright {\lang1024 deskjet, 59 +\par }\pard \s19\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright {\lang1024 Desktop, 57 +\par }{\b\lang1024 df}{\lang1024 , 31 +\par }{\b\lang1024 dirs}{\lang1024 , 32 +\par }{\b\lang1024 done}{\lang1024 , 21 +\par DOWN-ARROW, 12 +\par }{\b\lang1024 down-history}{\lang1024 , 12, 29 +\par }\pard\plain \s28\li140\sb240\sa120\keepn\nowidctlpar\widctlpar\adjustright \b\f1\fs28\cgrid {\b0\f0\lang1024 E +\par }\pard\plain \s19\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright \fs20\cgrid {\b\lang1024 echo}{\lang1024 , 9, 18, 27, 31 +\par }\pard \s19\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright {\lang1024 editor, 6, 7 +\par }{\b\lang1024 end-of-line}{\lang1024 , 11, 29 +\par ESC, 13, 30 +\par ESC-E, 13 +\par ESC-Y, 30 +\par Event Manager, 57 +\par EXE, 7, 9, 29, 39, 40, 57 +\par EXEC, 7, 9 +\par }{\b\lang1024 exit}{\lang1024 , 32 +\par export, 39 +\par }{\i\lang1024 export}{\lang1024 , 39 +\par }\pard\plain \s28\li140\sb240\sa120\keepn\nowidctlpar\widctlpar\adjustright \b\f1\fs28\cgrid {\b0\f0\lang1024 F +\par }\pard\plain \s19\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright \fs20\cgrid {\b\lang1024 fg}{\lang1024 , 22 +\par }\pard \s19\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright {\lang1024 fg, 33 +\par }{\i\lang1024 filter processes}{\lang1024 , 19 +\par foreground, 21, 22 +\par }{\b\lang1024 forward-char}{\lang1024 , 10, 29 +\par }{\b\lang1024 forward-word}{\lang1024 , 11, 29 +\par }\pard\plain \s28\li140\sb240\sa120\keepn\nowidctlpar\widctlpar\adjustright \b\f1\fs28\cgrid {\b0\f0\lang1024 G +\par }\pard\plain \s19\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright \fs20\cgrid {\b\lang1024 globbing}{\lang1024 , 25, 40 +\par }\pard \s19\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright {\lang1024 GNO Installer, 5, 6, 12 +\par GNO Kernel, 5, 6, 7, 20, 29, 55 +\par GNO shell, 5, 6, 7, 12, 17, 20 +\par GNO/ME, 5, 6, 7, 15, 18, 19, 20, 21, 55, 57 +\par gnocon, 41, 59 +\par }{\b\lang1024 grep}{\lang1024 , 19, 24 +\par GS/OS, 18, 19 +\par }{\b\lang1024 gsh}{\lang1024 , 5, 7, 9, 12, 13, 17, 18, 19, 21, 24, 25, 27, 30, 39, 55 +\par }{\i\lang1024 gshrc}{\lang1024 , 5, 6, 7, 12, 13, 17, 39 +\par GUI, 5 +\par }\pard\plain \s28\li140\sb240\sa120\keepn\nowidctlpar\widctlpar\adjustright \b\f1\fs28\cgrid {\b0\f0\lang1024 H +\par }\pard\plain \s19\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright \fs20\cgrid {\b\lang1024 hash}{\lang1024 , 35 +\par }\pard \s19\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright {\lang1024 HFS, 26, 40 +\par HISTORY, 12, 32 +\par history, 40 +\par history buffer, 12 +\par }\pard \s19\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright {\lang1024 home directory, 24 +\par }\pard\plain \s28\li140\sb240\sa120\keepn\nowidctlpar\widctlpar\adjustright \b\f1\fs28\cgrid {\b0\f0\lang1024 I +\par }\pard\plain \s19\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright \fs20\cgrid {\lang1024 I/O, 57 +\par }\pard \s19\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright {\lang1024 insert, 11, 13 +\par iw1, 59 +\par iw-alt, 59 +\par }\pard\plain \s28\li140\sb240\sa120\keepn\nowidctlpar\widctlpar\adjustright \b\f1\fs28\cgrid {\b0\f0\lang1024 J +\par }\pard\plain \s19\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright \fs20\cgrid {\b\lang1024 job}{\lang1024 , 21 +\par }\pard \s19\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright {\b\lang1024 job control}{\lang1024 , 22 +\par job number, 20 +\par jobs, 33 +\par }\pard\plain \s28\li140\sb240\sa120\keepn\nowidctlpar\widctlpar\adjustright \b\f1\fs28\cgrid {\b0\f0\lang1024 K +\par }\pard\plain \s19\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright \fs20\cgrid {\b\lang1024 kern}{\lang1024 , 7 +\par }\pard \s19\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright {\lang1024 kernel, 21, 30 +\par kill, 21, 22, 33 +\par }{\b\lang1024 kill-end-of-line}{\lang1024 , 11, 29 +\par }{\b\lang1024 kill-whole-line}{\lang1024 , 11, 29 +\par Korn shell, 5 +\par }\pard\plain \s28\li140\sb240\sa120\keepn\nowidctlpar\widctlpar\adjustright \b\f1\fs28\cgrid {\b0\f0\lang1024 L +\par }\pard\plain \s19\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright \fs20\cgrid {\lang1024 LEFT-ARROW, 10 +\par }\pard \s19\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright {\b\lang1024 less}{\lang1024 , 19 +\par }{\b\lang1024 list-choices}{\lang1024 , 12, 29 +\par }{\b\lang1024 login(1)}{\lang1024 , 42 +\par long options, 15, 16 +\par }{\b\lang1024 ls}{\lang1024 , 15, 16, 18, 21, 24, 39, 59 +\par }\pard\plain \s28\li140\sb240\sa120\keepn\nowidctlpar\widctlpar\adjustright \b\f1\fs28\cgrid {\b0\f0\lang1024 M +\par }\pard\plain \s19\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright \fs20\cgrid {\b\lang1024 man}{\lang1024 , 15, 16, 19 +\par }\pard \s19\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright {\lang1024 manual pages, 15 +\par }{\b\lang1024 mkdir}{\lang1024 , 24 +\par modem, 19 +\par }{\b\lang1024 more}{\lang1024 , 15, 19, 21, 26 +\par MouseText, 39 +\par }{\i\lang1024 multitasking}{\lang1024 , 20, 21, 39 +\par }{\b\lang1024 mv}{\lang1024 , 39 +\par }\pard\plain \s28\li140\sb240\sa120\keepn\nowidctlpar\widctlpar\adjustright \b\f1\fs28\cgrid {\b0\f0\lang1024 N +\par }\pard\plain \s19\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright \fs20\cgrid {\lang1024 NEW, 34 +\par }\pard \s19\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright {\b\lang1024 newline}{\lang1024 , 10, 30 +\par }{\b\lang1024 NullProcess}{\lang1024 , 21 +\par }\pard\plain \s28\li140\sb240\sa120\keepn\nowidctlpar\widctlpar\adjustright \b\f1\fs28\cgrid {\b0\f0\lang1024 O +\par }\pard\plain \s19\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright \fs20\cgrid {\lang1024 OA, 9, 13, 30 +\par }\pard \s19\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright {\lang1024 OA-<, 11, 30 +\par OA->, 11 +\par OA-CLEAR, 30 +\par OA-D, 11 +\par OA-E, 11, 13 +\par }\pard \s19\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright {\lang1024 OA-LEFT ARROW, 11 +\par }\pard \s19\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright {\lang1024 OA-RIGHT-ARROW, 11 +\par OA-Y, 30 +\par OMF, 19 +\par Open Apple, 9 +\par option arguments, 15 +\par ORCA, 6, 7, 17, 18 +\par ORCA shell, 5, 19 +\par overstrike, 11 +\par }\pard\plain \s28\li140\sb240\sa120\keepn\nowidctlpar\widctlpar\adjustright \b\f1\fs28\cgrid {\b0\f0\lang1024 P +\par }\pard\plain \s19\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright \fs20\cgrid {\lang1024 paging, 19 +\par }\pard \s19\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright {\lang1024 parameters, 9 +\par parent process, 39 +\par PATH, 7, 27 +\par path delimiter, 7 +\par pathname separator, 7 +\par PAUSED, 34 +\par performance, 21 +\par }{\b\lang1024 pipeline}{\lang1024 , 19 +\par }{\b\lang1024 popd}{\lang1024 , 32, 41 +\par pre-emptive multitasking, 20 +\par }{\b\lang1024 prefix}{\lang1024 , 35 +\par printer, 19 +\par process, 21 +\par process ID, 20 +\par ProDOS, 15, 26 +\par prompt, 7 +\par }{\b\lang1024 ps}{\lang1024 , 20, 21, 22, 34 +\par ptse, 59 +\par }{\b\lang1024 pushd}{\lang1024 , 32, 41 +\par }{\b\lang1024 pwd}{\lang1024 , 32 +\par }\pard\plain \s28\li140\sb240\sa120\keepn\nowidctlpar\widctlpar\adjustright \b\f1\fs28\cgrid {\b0\f0\lang1024 Q +\par }\pard\plain \s19\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright \fs20\cgrid {\b\lang1024 qtime}{\lang1024 , 9 +\par }\pard \s19\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright {\lang1024 quote, 42 +\par }\pard\plain \s28\li140\sb240\sa120\keepn\nowidctlpar\widctlpar\adjustright \b\f1\fs28\cgrid {\b0\f0\lang1024 R +\par }\pard\plain \s19\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright \fs20\cgrid {\lang1024 raw-char, 30 +\par }\pard \s19\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright {\lang1024 READY, 34 +\par redirect, 18 +\par redirection, 18 +\par redirection operators, 18 +\par redisplay, 30 +\par }{\b\lang1024 redraw}{\lang1024 , 10 +\par regular expressions, 25 +\par }{\b\lang1024 rehash}{\lang1024 , 27, 36 +\par RELEASE.NOTES, 57 +\par }\pard \s19\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright {\lang1024 Remote Access, 13 +\par }\pard \s19\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright {\lang1024 RETURN, 10 +\par RIGHT-ARROW, 10 +\par }{\b\lang1024 running}{\lang1024 , 21, 34 +\par }\pard\plain \s28\li140\sb240\sa120\keepn\nowidctlpar\widctlpar\adjustright \b\f1\fs28\cgrid {\b0\f0\lang1024 S +\par }\pard\plain \s19\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright \fs20\cgrid {\lang1024 S16, 57 +\par }\pard \s19\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright {\lang1024 SAVEHIST, 12 +\par script, 13, 27, 33 +\par serial port, 19 +\par }{\b\lang1024 set}{\lang1024 , 36, 42 +\par }{\b\lang1024 setdebug}{\lang1024 , 34 +\par }{\b\lang1024 setenv}{\lang1024 , 36 +\par shell script, 39 +\par short options, 15, 16 +\par }{\b\lang1024 SIGABRT}{\lang1024 , 55 +\par }{\b\lang1024 SIGALRM}{\lang1024 , 55 +\par }{\b\lang1024 SIGBUS}{\lang1024 , 55 +\par }{\b\lang1024 SIGCHLD}{\lang1024 , 55 +\par }{\b\lang1024 SIGCONT}{\lang1024 , 55 +\par }{\b\lang1024 SIGEMT}{\lang1024 , 55 +\par }{\b\lang1024 SIGFPE}{\lang1024 , 55 +\par }{\b\lang1024 SIGHUP}{\lang1024 , 55 +\par }{\b\lang1024 SIGILL}{\lang1024 , 55 +\par }{\b\lang1024 SIGINT}{\lang1024 , 55 +\par }{\b\lang1024 SIGIO}{\lang1024 , 55 +\par }{\b\lang1024 SIGKILL}{\lang1024 , 55 +\par SIGNAL, 29, 33 +\par signals, 55 +\par }{\b\lang1024 SIGPIPE}{\lang1024 , 55 +\par }{\b\lang1024 SIGQUIT}{\lang1024 , 55 +\par }{\b\lang1024 SIGSEGV}{\lang1024 , 55 +\par }{\b\lang1024 SIGSTOP}{\lang1024 , 55 +\par }{\b\lang1024 SIGSYS}{\lang1024 , 55 +\par }{\b\lang1024 SIGTERM}{\lang1024 , 55 +\par }{\b\lang1024 SIGTRAP}{\lang1024 , 55 +\par }{\b\lang1024 SIGTSTP}{\lang1024 , 55 +\par }{\b\lang1024 SIGTTIN}{\lang1024 , 55 +\par }{\b\lang1024 SIGTTOU}{\lang1024 , 55 +\par }{\b\lang1024 SIGURG}{\lang1024 , 55 +\par }{\b\lang1024 SIGUSR1}{\lang1024 , 55 +\par }{\b\lang1024 SIGUSR2}{\lang1024 , 55 +\par }{\b\lang1024 SIGXCPU}{\lang1024 , 55 +\par }{\b\lang1024 source}{\lang1024 , 7, 33 +\par }{\i\lang1024 standard error}{\lang1024 , 18, 21 +\par }{\i\lang1024 standard input}{\lang1024 , 18, 40 +\par }\pard \s19\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright {\i\lang1024 standard output}{\lang1024 , 18, 21 +\par }\pard \s19\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright {\lang1024 stop, 21, 22 +\par }{\b\lang1024 stop}{\lang1024 , 35 +\par }{\b\lang1024 stopped}{\lang1024 , 21 +\par storage device, 19 +\par SUSPENDED, 34 +\par SYS16, 7, 9, 40 +\par }\pard\plain \s28\li140\sb240\sa120\keepn\nowidctlpar\widctlpar\adjustright \b\f1\fs28\cgrid {\b0\f0\lang1024 T +\par }\pard\plain \s19\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright \fs20\cgrid {\lang1024 TAB, 12 +\par }\pard \s19\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright {\lang1024 TERM, 39 +\par termcap, 59 +\par }{\i\lang1024 termcap}{\lang1024 , 41 +\par terminal, 19, 59 +\par terminal emulation, 41 +\par TextTools, 57 +\par tilde, 24 +\par }{\b\lang1024 toggle-cursor}{\lang1024 , 11, 30 +\par }{\b\lang1024 tset}{\lang1024 , 33, 41 +\par }{\b\lang1024 ttya}{\lang1024 , 19 +\par }\pard\plain \s28\li140\sb240\sa120\keepn\nowidctlpar\widctlpar\adjustright \b\f1\fs28\cgrid {\b0\f0\lang1024 U +\par }\pard\plain \s19\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright \fs20\cgrid {\lang1024 unalias, 18 +\par }\pard \s19\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright {\b\lang1024 unalias}{\lang1024 , 36 +\par undefined-char, 30 +\par }{\b\lang1024 unhash}{\lang1024 , 36 +\par UNIX, 7, 16, 40, 57 +\par unset, 42 +\par UP-ARROW, 12 +\par }{\b\lang1024 up-history}{\lang1024 , 12, 30 +\par }\pard\plain \s28\li140\sb240\sa120\keepn\nowidctlpar\widctlpar\adjustright \b\f1\fs28\cgrid {\b0\f0\lang1024 V +\par }\pard\plain \s19\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright \fs20\cgrid {\lang1024 variables, 5, 42 +\par }\pard \s19\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright {\b\lang1024 variables}{\lang1024 , 39 +\par }{\b\lang1024 vi}{\lang1024 , 6 +\par vt100, 59 +\par }\pard\plain \s28\li140\sb240\sa120\keepn\nowidctlpar\widctlpar\adjustright \b\f1\fs28\cgrid {\b0\f0\lang1024 W +\par }\pard\plain \s19\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright \fs20\cgrid {\lang1024 WAITING, 34 +\par }\pard \s19\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright {\lang1024 WAITSIGCH, 34 +\par }{\b\lang1024 which}{\lang1024 , 33 +\par wildcards, 25 +\par }{\i\lang1024 word}{\lang1024 , 9 +\par }\pard\plain \s28\li140\sb240\sa120\keepn\nowidctlpar\widctlpar\adjustright \b\f1\fs28\cgrid {\b0\f0\lang1024 X +\par }\pard\plain \s19\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright \fs20\cgrid {\lang1024 xerox820, 59 +\par }\pard \s19\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright {\fs24\lang1024 \sect }\sectd \sbknone\linex0\endnhere\titlepg\sectdefaultcl \pard\plain \s19\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright \fs20\cgrid }}\pard\plain \s19\fi-240\li240\nowidctlpar\widctlpar\tqr\tx4680\adjustright \fs20\cgrid {\b\f4 +\par }} \ No newline at end of file diff --git a/refs.aug96/section1234-95.doc b/refs.aug96/section1234-95.doc new file mode 100644 index 0000000..0ec1cc9 --- /dev/null +++ b/refs.aug96/section1234-95.doc @@ -0,0 +1,3270 @@ +{\rtf1\ansi\ansicpg1252\uc1 \deff0\deflang1033\deflangfe1033{\fonttbl{\f0\froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f1\fswiss\fcharset0\fprq2{\*\panose 020b0604020202020204}Arial;}{\f2\fmodern\fcharset0\fprq1{\*\panose 02070309020205020404}Courier New;}{\f3\froman\fcharset2\fprq2{\*\panose 05050102010706020507}Symbol;}{\f4\froman\fcharset0\fprq2{\*\panose 00000000000000000000}Times;}{\f5\fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}Helvetica;}{\f6\fmodern\fcharset0\fprq1{\*\panose 00000000000000000000}Courier;}{\f7\fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}Geneva;}{\f8\froman\fcharset0\fprq2{\*\panose 00000000000000000000}Tms Rmn;}{\f9\fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}Helv;}{\f10\froman\fcharset0\fprq2{\*\panose 00000000000000000000}MS Serif;}{\f11\fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}MS Sans Serif;}{\f12\froman\fcharset0\fprq2{\*\panose 00000000000000000000}New York;}{\f13\fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}System;}{\f14\fnil\fcharset2\fprq2{\*\panose 05000000000000000000}Wingdings;}{\f15\fswiss\fcharset0\fprq3{\*\panose 020b0604030504040204}Tahoma;}}{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;}{\stylesheet{\nowidctlpar\widctlpar\adjustright \fs20\cgrid \snext0 Normal;}{\*\cs10 \additive Default Paragraph Font;}{\s15\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright \fs20\cgrid \sbasedon0 \snext15 header;}{\s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright \fs20\cgrid \sbasedon0 \snext16 footer;}{\s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid \sbasedon0 \snext17 Indented;}{\*\cs18 \additive \sbasedon10 page number;}{\s19\qj\nowidctlpar\widctlpar\adjustright \b\f4\cgrid \sbasedon0 \snext19 Section Header;}{\s20\qj\li1440\nowidctlpar\widctlpar\adjustright \f4\cgrid \sbasedon0 \snext20 Indented-2;}{\s21\qj\nowidctlpar\widctlpar\adjustright \b\f4\cgrid \sbasedon0 \snext21 Heading;}{\s22\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid \sbasedon0 \snext22 Sub-body;}{\s23\fi-1260\li1980\nowidctlpar\widctlpar\adjustright \f4\cgrid \sbasedon0 \snext23 Big Bullet;}}{\*\revtbl {Unknown;}}{\info{\title NAME}{\author Lisa K Holsberg}{\operator Lisa K Holsberg}{\creatim\yr1997\mo8\dy27\hr16\min5}{\revtim\yr1997\mo8\dy27\hr16\min5}{\printim\yr1996\mo8\dy7\hr11\min3}{\version2}{\edmins1}{\nofpages41}{\nofwords22335}{\nofchars127314}{\*\company Promethean Enterprises}{\nofcharsws156350}{\vern71}}\margl1440\margr1440\margb720 \facingp\widowctrl\ftnbj\aenddoc\lytprtmet\formshade\viewkind1\viewscale83\viewzk2\pgbrdrhead\pgbrdrfoot \fet0\sectd \psz1\linex0\endnhere\sectdefaultcl {\headerl \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx9360\adjustright \fs20\cgrid {\fs24 BINPRINT(1)\tab Commands and Applications\tab BINPRINT(1)}{ +\par }}{\headerr \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx4680\tqr\tx9360\adjustright \fs20\cgrid {\fs24 INTRO(}{\fs24 1)\tab Commands and Applications\tab }{\fs24 INTRO}{\fs24 (1) +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}{\footerr \pard\plain \s16\nowidctlpar\widctlpar\brdrb\brdrs\brdrw30\brsp20 \tqc\tx4320\tqr\tx8640\adjustright \fs20\cgrid { +\par }\pard \s16\qr\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright {\field{\*\fldinst {\cs18\b PAGE }}{\fldrslt {\cs18\b\lang1024 5}}}{ +\par }}{\*\pnseclvl1\pnucrm\pnstart1\pnindent720\pnhang{\pntxta .}}{\*\pnseclvl2\pnucltr\pnstart1\pnindent720\pnhang{\pntxta .}}{\*\pnseclvl3\pndec\pnstart1\pnindent720\pnhang{\pntxta .}}{\*\pnseclvl4\pnlcltr\pnstart1\pnindent720\pnhang{\pntxta )}}{\*\pnseclvl5\pndec\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}{\*\pnseclvl6\pnlcltr\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}{\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}{\*\pnseclvl8\pnlcltr\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}{\*\pnseclvl9\pnlcrm\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\b\fs24 NAME}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 intro}{\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\f0 intro}}}{\f0 - introduction to commands and application programs +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 DESCRIPTION}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 This section describes, in alphabetical order, commands available for GNO. Certain distinctions of purpose are made in the headings. For example, BUILT-IN UTILITIES are those commands which are part of the GNO shell and not contained in stand-alone files. +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 Manual Page Command Syntax +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 Unless otherwise noted, commands described in the }{\b\f0 SYNOPSIS}{\f0 section of a manual page accept options and other arguments according to the following syntax and should be interpreted as explained below: +\par }\pard\plain \fi-720\li1440\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 name}{\fs24 [- }{\b\fs24 option }{\fs24 ...] [ }{\i\fs24 cmdarg}{\fs24 ...] +\par +\par where: +\par +\par }{\b\fs24 []}{\fs24 \tab Surround an option or cmdarg that is not required. +\par +\par }{\b\fs24 ...}{\fs24 \tab Indicates multiple occurrences of the option or cmdarg. +\par +\par }{\b\fs24 name}{\fs24 \tab The name of an executable file. +\par +\par }{\b\fs24 option}{\fs24 +\par \tab (Almost always preceded by a "-".) +\par \tab }{\b\fs24 noargletter ...}{\fs24 or, +\par \tab }{\b\fs24 argletter}{\fs24 }{\b\fs24 optarg}{\fs24 }{\b\fs24 [,...]}{\fs24 +\par +\par }{\b\fs24 noargletter}{\fs24 +\par \tab A single letter representing an option without an option-argument. Note that more than one noargletter option can be grouped after one "-". +\par +\par }{\b\fs24 argletter}{\fs24 +\par \tab A single letter representing an option requiring an option-argument. +\par +\par }{\b\fs24 optarg}{\fs24 An option-argument (character string) satisfying a preceding argletter. Note that groups of optargs following an argletter must be separated by white space and quoted. +\par +\par }{\b\fs24 cmdarg +\par }{\fs24 \tab Path name (or other command argument) not beginning with a "-", or "-" by itself indicating the standard input. +\par }\pard \nowidctlpar\widctlpar\adjustright {\fs24 +\par }{\b\fs24 SEE ALSO}{\fs24 +\par }\pard \fi720\nowidctlpar\widctlpar\adjustright {\i\fs24 GNO Shell User's Manual}{\b\fs24 \sect }\sectd \psz1\linex0\endnhere\sectdefaultcl {\headerl \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx9360\adjustright \fs20\cgrid {\fs24 BINPRINT(1)\tab Commands and Applications\tab BINPRINT(1)}{ +\par }}\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\b\fs24 NAME}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 binprint - dump binary files in ascii/hex format +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 SYNOPSIS}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 binprint}{\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\b\f0 binprint}}}{\f0 [-}{\i\f0 c}{\f0 columns] [}{\i\f0 filename}{\f0 ] +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }\pard \nowidctlpar\widctlpar\adjustright {\b\fs24 DESCRIPTION}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 binprint}{\f0 takes binary data and formats it as a sequence of ascii data and hex values that represent the binary data. The format of the output is very similar to that produced by the IIGS Monitor and the NiftyList utility. +\par +\par Two columns of output are produced. The first column is the hex representation of the data. The second column is the ascii representation of the data. If the particular byte being printed is a non-printable ASCII character, it is printed as a '.'. +\par +\par If the -c option is specified, the number following it is used to determine the number of columns (of bytes) per line. The default is 16. +\par +\par If the filename is not specified, input is taken from standard input. +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 BUGS}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 binprint}{\f0 is slow. +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 AUTHOR}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 binprint}{\f0 was written by Derek Taubert for GNO/ME. +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\sect }\sectd \psz1\linex0\endnhere\sectdefaultcl {\headerl \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx4680\tqr\tx9360\adjustright \fs20\cgrid {\fs24 CAL(1)\tab Commands and Applications\tab CAL(1) +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright {\f4 +\par }}{\headerr \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx4680\tqr\tx9360\adjustright \fs20\cgrid {\fs24 CA}{\fs24 L}{\fs24 (1)\tab Commands and Applications\tab CA}{\fs24 L}{\fs24 (1) +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx4680\tqr\tx9360\adjustright { +\par }}{\footerl \pard\plain \s16\nowidctlpar\widctlpar\brdrb\brdrs\brdrw30\brsp20 \tqc\tx4320\tqr\tx10080\adjustright \fs20\cgrid { +\par }\pard \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright {\field{\*\fldinst {\cs18\b PAGE }}{\fldrslt {\cs18\b\lang1024 4}}}{ +\par }}\pard\plain \s19\qj\nowidctlpar\widctlpar\adjustright \b\f4\cgrid {\f0 NAME +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 cal - display a calendar +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }\pard\plain \s19\qj\nowidctlpar\widctlpar\adjustright \b\f4\cgrid {\f0 SYNOPSIS +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 cal}{\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\b\f0 cal}}}{\f0 [ [ }{\i\f0 month}{\f0 ] }{\i\f0 year}{\f0 ] +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }\pard\plain \s19\qj\nowidctlpar\widctlpar\adjustright \b\f4\cgrid {\f0 DESCRIPTION +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 cal}{\f0 displays a calendar for the specified year. If a month is also specified, a calendar for that month only is displayed. If neither is specified, a calendar for the present month is printed. +\par +\par }{\i\f0 year}{\f0 can be between 1 and 9999. Be aware that `cal 78' refers to the early Christian era, not the 20th century. Also, the year is always considered to start in January, even though this is historically naive. +\par +\par month is a number between 1 and 12. +\par +\par The calendar produced is that for England and her colonies. +\par +\par Try September 1752. +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 \sect }\sectd \psz1\linex0\endnhere\sectdefaultcl {\headerl \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx4680\tqr\tx9360\adjustright \fs20\cgrid {\fs24 CA}{\fs24 T}{\fs24 (1)\tab Commands and Applications\tab CA}{\fs24 T}{\fs24 (1) +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright {\f4 +\par }}\pard\plain \s19\qj\nowidctlpar\widctlpar\adjustright \b\f4\cgrid {\f0 NAME +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 cat - concatenate and print files +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 SYNOPSIS}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 cat}{\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\b\f0 cat}}}{\f0 [ -}{\i\f0 benstuv}{\f0 ] [ file ...] +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 DESCRIPTION}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 The }{\b\f0 cat}{\f0 utility reads files sequentially, writing them to the standard output. The file operands are processed in command line order. A single dash represents standard input. +\par +\par The options are as follows: +\par +\par }\pard \s17\qj\fi-720\li1440\nowidctlpar\widctlpar\adjustright {\f0 -}{\i\f0 b}{\f0 \tab Implies the -}{\i\f0 n}{\f0 option but doesn't number blank lines. +\par }\pard \s17\qj\fi-720\li1440\nowidctlpar\widctlpar\adjustright {\f0 -}{\i\f0 e}{\f0 \tab Implies the -}{\i\f0 v}{\f0 option, and displays a dollar sign ($) at the end of each line as well. +\par -}{\i\f0 n}{\f0 \tab Number the output lines, starting at 1. +\par -}{\i\f0 s}{\f0 \tab Squeeze multiple adjacent empty lines, causing the output to be single spaced. +\par -}{\i\f0 t}{\f0 \tab Implies the -}{\i\f0 v}{\f0 option, and displays tab characters as [^I] as well. +\par -}{\i\f0 u}{\f0 \tab The -u option guarantees that the output is unbuffered. +\par -}{\i\f0 v}{\f0 \tab Displays non-printing characters so they are visible. Control characters print line [^X] for control-X; the delete character (octal 0177) prints as [^?] Non-ascii characters (with the high bit set) are printed as [M-] (for meta) followed by the character for the low 7 bits. +\par }\pard \s17\qj\li720\nowidctlpar\widctlpar\adjustright {\f0 +\par The }{\b\f0 cat}{\f0 utility exits 0 on success, and >0 if an error occurs. +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }\pard\plain \s19\qj\nowidctlpar\widctlpar\adjustright \b\f4\cgrid {\f0 BUGS +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 Because of the shell language mechanism used to perform output redirection, the command "}{\f2 cat file1 file 2 > file1}{\f0 " will cause the original data in file1 to be destroyed! Use "}{\f2 cat file2 >> file1}{\f0 " instead. +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }\pard\plain \s19\qj\nowidctlpar\widctlpar\adjustright \b\f4\cgrid {\f0 SEE ALSO +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 head}{\f0 (1), }{\b\f0 more}{\f0 (1), }{\b\f0 tail}{\f0 (1), Rob Pike "}{\i\f0 UNIX Style, or cat -v Considered Harmful}{\f0 ", "}{\i\f0 USENIX Summer Conference Proceedings}{\f0 " (1983) +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }\pard\plain \s19\qj\nowidctlpar\widctlpar\adjustright \b\f4\cgrid {\f0 HISTORY +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 A }{\b\f0 cat}{\f0 command appeared in Version 6 AT&T UNIX. +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\fs24 \sect }\sectd \psz1\linex0\endnhere\sectdefaultcl {\headerl \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx4680\tqr\tx9360\adjustright \fs20\cgrid {\fs24 CENTER(1)\tab Commands and Applications\tab CENTER(1) +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx4320\tqc\tx5220\tqr\tx8640\tqr\tx10260\adjustright { +\par }}{\headerr \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx4320\tqc\tx4680\tqr\tx9360\adjustright \fs20\cgrid {\fs24 CENTER(1)\tab Commands and Applications\tab CENTER(1) +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx4320\tqc\tx5220\tqr\tx8640\tqr\tx10260\adjustright { +\par }}{\footerl \pard\plain \s16\nowidctlpar\widctlpar\brdrb\brdrs\brdrw30\brsp20 \tqc\tx4320\tqr\tx10080\adjustright \fs20\cgrid {\ul +\par }\pard \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright {\field{\*\fldinst {\cs18\b PAGE }}{\fldrslt {\cs18\b\lang1024 4}}}{ +\par }}\pard\plain \s21\qj\nowidctlpar\widctlpar\adjustright \b\f4\cgrid {NAME +\par }\pard\plain \s17\qj\fi720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b center}{\pard\plain \s17\qj\fi720\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v }{\b center}}}{ - Center text on terminal +\par }\pard \s17\qj\nowidctlpar\widctlpar\adjustright { +\par }\pard\plain \s21\qj\nowidctlpar\widctlpar\adjustright \b\f4\cgrid {SYNOPSIS +\par }\pard\plain \s17\qj\fi720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b center}{\pard\plain \s17\qj\fi720\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v }{\b center}}}{ [columns] [file] +\par }\pard \s17\qj\nowidctlpar\widctlpar\adjustright { +\par }\pard\plain \s21\qj\nowidctlpar\widctlpar\adjustright \b\f4\cgrid {DESCRIPTION +\par }\pard\plain \s17\qj\fi720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b Center}{ is used to center lines of text either fed from stdin, or from the specified file. +\par }\pard \s17\qj\nowidctlpar\widctlpar\adjustright { +\par }\pard \s17\qj\fi720\nowidctlpar\widctlpar\adjustright {One may pipe input in to it from the command line, or launch it by itself. +\par }\pard \s17\qj\nowidctlpar\widctlpar\adjustright { +\par }\pard \s17\qj\fi720\nowidctlpar\widctlpar\adjustright {The commands are as follows: +\par }\pard \s17\qj\nowidctlpar\widctlpar\adjustright { +\par }\pard\plain \s20\qj\li1440\nowidctlpar\widctlpar\adjustright \f4\cgrid {columns\tab How many columns should be considered when centering the text.}{ +\par }\pard \s20\qj\fi720\li2160\nowidctlpar\widctlpar\adjustright {Defaults to 80 columns. +\par }\pard \s20\qj\li1440\nowidctlpar\widctlpar\adjustright { +\par file\tab }{\tab S}{pecifies the file to open for centering. Defaults to stdin. +\par }\pard\plain \s17\qj\nowidctlpar\widctlpar\adjustright \f4\cgrid { +\par }\pard\plain \s21\qj\nowidctlpar\widctlpar\adjustright \b\f4\cgrid {FILES +\par }\pard\plain \s17\qj\fi720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b center}{ +\par }\pard \s17\qj\nowidctlpar\widctlpar\adjustright { +\par }\pard\plain \s21\qj\nowidctlpar\widctlpar\adjustright \b\f4\cgrid {AUTHOR +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {Written by Marek Pawlowski. Source code in Public Domain. Contact author for redistribution rights, or inclusion in a software package. Munge at will. Credit to Marek Pawlowski must be retained in modified source code. Preview of modifications appreciated. Contact Marek Pawlowski at marekp@pnet91.cts.com, marekp@cerf.net. +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid { +\par }{\fs24 \sect }\sectd \linex0\endnhere\sectdefaultcl {\headerl \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx4680\tqr\tx9360\adjustright \fs20\cgrid {\fs24 CHMOD}{\fs24 (1)\tab Commands and Applications\tab CH}{\fs24 MOD}{\fs24 (1)}{ +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx5040\tqr\tx10080\adjustright { +\par }}{\headerr \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx4680\tqr\tx9360\adjustright \fs20\cgrid {\fs24 CHMOD(1)\tab Commands and Applications\tab CHMOD(1)}{ +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx5040\tqr\tx10080\adjustright { +\par +\par }}{\footerl \pard\plain \s16\nowidctlpar\widctlpar\brdrb\brdrs\brdrw30\brsp20 \tqc\tx4320\tqr\tx9360\adjustright \fs20\cgrid { +\par }\pard \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx9360\adjustright {\b \chpgn +\par }}{\footerr \pard\plain \s16\nowidctlpar\widctlpar\brdrb\brdrs\brdrw30\brsp20 \tqc\tx4320\tqr\tx9360\tqr\tx10080\adjustright \fs20\cgrid { +\par }\pard \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx9360\tqr\tx10080\adjustright {\tab \tab }{\b \chpgn }{ +\par }}\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\b\fs24 NAME}{\fs24 +\par }\pard\plain \s22\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 chmod - Modify file permission flags. +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 SYNOPSIS}{\fs24 +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 chmod}{\f0 }{\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\b\f0 chmod }}}{\f0 [}{\i\f0 vV}{\f0 ] [octnum]|[+-=][}{\i\f0 rwdnbi}{\f0 ] }{\i\f0 file}{\f0 ... +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 DESCRIPTION}{\fs24 +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 chmod}{\f0 is a program which modifies the permission flags of a series of files. It will modify the read, write, destroy, rename, backup, and invisible flags of the files selected. +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 OPTIONS}{\fs24 +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 -}{\i\f0 v}{\f0 \tab verbose. Provides debugging information. +\par -}{\i\f0 V}{\f0 \tab version. Prints out the version number. +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 USAGE}{\fs24 +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 -\tab remove a permission flag. +\par +\tab add a permission flag. +\par =\tab add permission flag, and clear all other flags. +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 PERMISSIONS}{\fs24 +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\i\f0 r}{\f0 \tab read permssion. +\par }{\i\f0 w}{\f0 \tab write permission. +\par }{\i\f0 d}{\f0 \tab destroy permission. +\par }{\i\f0 n}{\f0 \tab rename permission. +\par }{\i\f0 b}{\f0 \tab backup needed flag. +\par }{\i\f0 i}{\f0 \tab invisible flag. +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 EXAMPLES}{\fs24 +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 `Lock' a file: }{\f2 % chmod -wdn foo}{\f0 +\par `Unlock' a file: }{\f2 % chmod +wdn foo}{\f0 +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 BUGS}{\fs24 +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 Currently octal mode is only guarenteed to work with the ProDOS filesystem, as the chmod() call supplied with Orca/C doesn't seem to work well with other FSTs. Many of the standard Unix permission flags are not implemented, as the ProDOS filesystem does not support these permissions. Among unsupported permissions are seperate sets of flags for user, group, and world. As well, the -x flag is not supported - if you wish to create an executable shell script, use chtyp instead. +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 SEE ALSO}{\fs24 +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 ls(1), chtyp(1) +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 AUTHOR}{\fs24 +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 James Brookes +\par }\pard \s22\qj\li720\nowidctlpar\widctlpar\adjustright {\f0 bb252@cleveland.freenet.edu +\par jamesb@cscihp.ecst.csuchico.edu +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 \sect }\sectd \linex0\endnhere\sectdefaultcl {\headerr \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx4680\tqr\tx9360\adjustright \fs20\cgrid {\fs24 CHTYP}{\fs24 (1)\tab Commands and Applications\tab CH}{\fs24 TYP}{\fs24 (1)}{ +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx5040\tqr\tx10080\adjustright { +\par +\par }}\pard\plain \s19\qj\nowidctlpar\widctlpar\adjustright \b\f4\cgrid {\f0 NAME +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 chtyp - change file and aux types +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }\pard\plain \s19\qj\nowidctlpar\widctlpar\adjustright \b\f4\cgrid {\f0 SYNOPSIS +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 chtyp}{\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\b\f0 chtyp}}}{\f0 \{ [-t filetype] [-a auxtype] \} | \{ -l lang \} file... +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }\pard\plain \s19\qj\nowidctlpar\widctlpar\adjustright \b\f4\cgrid {\f0 DESCRIPTION +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 chtyp}{\f0 is used to change the file types and aux types of the specified file(s). +\par +\par type is one of: +\par }\pard\plain \s20\qj\li1440\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 a decimal number [66] +\par a hexidecimal number preceeded by a $ [$42] +\par an official Apple mnemonic [FTD] +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 and auxtype is either: +\par }\pard\plain \s20\qj\li1440\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 a decimal number [64222] +\par a hexidecimal number preceeded by a $ [$FADE] +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 lang is one of: +\par }\pard \s17\qj\li720\nowidctlpar\widctlpar\tx1440\tx3600\adjustright {\f0 \tab CC\tab ORCA/C +\par }\pard \s17\qj\li720\nowidctlpar\widctlpar\tx1440\tx3600\adjustright {\f0 \tab ASM65816\tab ORCA/M or APW Assembler +\par \tab IBASIC\tab ORCA/Integer Basic +\par \tab LINK\tab ZapLink +\par \tab APWC\tab APW C +\par \tab PASCAL\tab ORCA/Pascal +\par \tab REZ\tab Apple Resource Tool +\par \tab EXEC\tab Shell Script file +\par \tab TMLPASCAL\tab TML Pascal +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 If the -l is used, the -t and -a options cannot be used. +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }\pard\plain \s19\qj\nowidctlpar\widctlpar\adjustright \b\f4\cgrid {\f0 ERRORS +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 If }{\b\f0 chtyp}{\f0 is interrupted with a signal (SIGINT}{\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\f0 SIGINT}}}{\f0 , SIGTERM}{\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\f0 SIGTERM}}}{\f0 , etc.) the program aborts with a message telling what signal caused the termination. +\par +\par If some other error occurs, }{\b\f0 chtyp}{\f0 aborts with an error message. +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 BUGS}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 Note that when giving hexadecimal arguments to }{\b\f0 chtyp}{\f0 , you must quote any '$' characters with a \\. For example, +\par }\pard \s17\qj\li720\nowidctlpar\widctlpar\adjustright {\f2 chtyp -t \\$50 -a \\$8002 teach.file}{\f0 +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par \tab Additional language stamps can only be added by modifying the source code. +\par +\par }\pard\plain \s19\qj\nowidctlpar\widctlpar\adjustright \b\f4\cgrid {\f0 AUTHOR +\par }\pard\plain \fi720\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 Original version by Greg Thompson.}{\fs24 +\par \sect }\sectd \linex0\endnhere\sectdefaultcl {\headerl \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx9360\adjustright \fs20\cgrid {\fs24 CMP(1)\tab Commands and Applications\tab CMP(1) +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}{\headerr \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx4680\tqc\tx5220\tqr\tx9360\tqr\tx10260\adjustright \fs20\cgrid {\fs24 CMP}{\fs24 (1)\tab Commands and Applications\tab }{\fs24 CMP}{\fs24 (1)}{\f4 +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright {\f4 +\par }}{\footerl \pard\plain \s16\nowidctlpar\widctlpar\brdrb\brdrs\brdrw30\brsp20 \tqc\tx4320\tqr\tx9360\adjustright \fs20\cgrid {\ul +\par }\pard \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx9360\adjustright {\b \chpgn +\par }}{\footerr \pard\plain \s16\nowidctlpar\widctlpar\brdrb\brdrs\brdrw30\brsp20 \tqc\tx4320\tqr\tx9360\tqr\tx10080\adjustright \fs20\cgrid { +\par }\pard \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx9360\tqr\tx10080\adjustright {\tab \tab }{\b \chpgn }{ +\par }}\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\b\fs24 NAME}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 cmp - perform a byte-by-byte comparison of two files +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\b\fs24 +\par SYNOPSIS}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 cmp}{\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\b\f0 cmp}}}{\f0 [ -}{\b\f0 ls}{\f0 ] }{\i\f0 filename1}{\f0 }{\i\f0 filename2}{\f0 [ }{\i\f0 skip1}{\f0 ] [ }{\i\f0 skip2}{\f0 ] +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 DESCRIPTION}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 cmp}{\f0 compares }{\i\f0 filename1}{\f0 and }{\i\f0 filename2}{\f0 . If }{\i\f0 filename1}{\f0 is `-', the standard input is used. With no options, }{\b\f0 cmp}{\f0 makes no comment if the files are the same; if they differ, it reports the byte and line number at which the difference occurred, or, that one file is an initial subsequence of the other. +\par +\par }{\i\f0 skip1}{\f0 and }{\i\f0 skip2}{\f0 are initial byte offsets into }{\i\f0 filename1}{\f0 and }{\i\f0 filename2}{\f0 respectively, and may be either octal or decimal; a leading }{\b\f0 0}{\f0 denotes octal. +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 OPTIONS}{\fs24 +\par }\pard\plain \s17\qj\fi-720\li1440\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 -}{\b\f0 l}{\f0 \tab Print the byte number (in decimal) and the differing bytes (in octal) for all differences between the two files. +\par -}{\b\f0 s}{\f0 \tab Silent. Print nothing for differing files; set exit codes only. +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 SEE ALSO}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 diff}{\f0 (1) +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 DIAGNOSTICS}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 Exit code }{\b\f0 0}{\f0 is returned for identical files, }{\b\f0 1}{\f0 for different files, and }{\b\f0 2}{\f0 for an inaccessible or missing argument, or a system error. +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }\pard \fi720\nowidctlpar\widctlpar\adjustright {\fs24 \sect }\sectd \linex0\endnhere\sectdefaultcl {\headerl \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx4680\tqr\tx9360\adjustright \fs20\cgrid {\fs24 COMPRESS(1)\tab Commands and Applications\tab COMPRESS(1) +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright {\f4 +\par }}{\headerr \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx4320\tx4680\tqr\tx9360\adjustright \fs20\cgrid {\fs24 COMPRESS(1)\tab Commands and Applications\tab COMPRESS(1) +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\b\fs24 NAME}{\fs24 +\par }\pard \li720\nowidctlpar\widctlpar\adjustright {\fs24 compress, uncompress, zcat - compress and expand data +\par }\pard \nowidctlpar\widctlpar\adjustright {\fs24 +\par }{\b\fs24 SYNOPSIS}{\fs24 +\par }\pard \li720\nowidctlpar\widctlpar\adjustright {\b\fs24 compress}{\pard\plain \li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\fs24 }{\b\fs24 compress}}}{\fs24 [-cCdDf?hkKvV][-b maxbits][-Iinpath][-Ooutpath][filenames...] +\par }\pard \li720\nowidctlpar\widctlpar\adjustright {\b\fs24 uncompress}{\pard\plain \li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\fs24 }{\b\fs24 uncompress}}}{\fs24 [-fCcvVkK?h][-Iinpath][-Ooutpath][filenames...] +\par }{\b\fs24 zcat }{\pard\plain \li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\fs24 }{\b\fs24 zcat }}}{\fs24 [-CvV?h][-Iinpath][-Ooutpath][filenames...] +\par }\pard \li720\nowidctlpar\widctlpar\tqc\tx2880\adjustright {\fs24 +\par -}{\i\fs24 V}{\fs24 \tab \tab print Version +\par -}{\i\fs24 d}{\fs24 \tab \tab decompress input (default is compress) +\par -}{\i\fs24 v}{\fs24 \tab \tab verbose +\par -}{\i\fs24 f}{\fs24 \tab \tab force overwrite of output file (default = off) +\par }\pard \li720\nowidctlpar\widctlpar\tqc\tx2880\adjustright {\fs24 -}{\i\fs24 n}{\fs24 \tab \tab no header: useful to uncompress old files +\par }\pard \li720\nowidctlpar\widctlpar\tqc\tx2880\adjustright {\fs24 -}{\i\fs24 c}{\fs24 \tab \tab write all output to stdout (default = off) +\par -}{\i\fs24 C}{\fs24 \tab \tab generate output compatible with compress 2.0 +\par -}{\i\fs24 k}{\fs24 \tab \tab %s input file (default = keep) +\par -}{\i\fs24 K}{\fs24 \tab \tab %s output file on error (default = kill) +\par -}{\i\fs24 b maxbits}{\fs24 \tab \tab default = 16 bits +\par -}{\i\fs24 I pathname}{\fs24 \tab \tab infile path = none +\par -}{\i\fs24 O pathname}{\fs24 \tab \tab outfile path = none +\par -}{\i\fs24 ?}{\fs24 -}{\i\fs24 h}{\fs24 \tab \tab help, print full usage message +\par }\pard \nowidctlpar\widctlpar\adjustright {\fs24 +\par }{\b\fs24 DESCRIPTION}{\fs24 +\par }\pard \li720\nowidctlpar\widctlpar\adjustright {\b\fs24 Compress}{\fs24 reduces the size of the named files using adaptive Lempel-Ziv coding. Whenever possible, each file is replaced by one with the extension .Z, while keep\-ing the same ownership modes, access and modification times. If no files are spec\-ified, the standard input is compressed to the standard output.Compressed files can be restored to their original form using }{\b\fs24 uncompress}{\fs24 or }{\b\fs24 zcat}{\fs24 . +\par }\pard \li720\nowidctlpar\widctlpar\adjustright {\fs24 +\par The -f option will force compression of }{\i\fs24 name}{\fs24 . This is useful for compressing an entire directory, even if some of the files do not actually shrink. If -f is not given and compress is run in the foreground, the user is prompted as to whether an exist\-ing file should be overwritten. +\par +\par The -c option makes }{\b\fs24 compress}{\fs24 /}{\b\fs24 uncompress}{\fs24 write to the standard output; no files are changed. The nondestructive behavior of zcat is identical to that of }{\b\fs24 uncompress}{\fs24 -c. +\par +\par }{\b\fs24 Compress}{\fs24 uses the modified Lempel-Ziv algorithm popularized in "}{\i\fs24 A Technique for High Performance Data Compression}{\fs24 ", Terry A. Welch, "}{\i\fs24 IEEE Computer}{\fs24 ," vol. 17, no. 6 (June 1984), pp. 8-19. Common substrings in the file are first replaced by 9-bit codes 257 and up. When code 512 is reached, the algorithm switches to 10-bit codes and continues to use more bits until the limit specified by the -b flag is reached (default 16). Bits must be between 9 and 16. The default can be changed in the source to allow compress to be run on a smaller machine. +\par +\par After the bits limit is attained, compress periodically checks the compression ratio. If it is increasing, }{\b\fs24 compress}{\fs24 continues to use the existing code dictionary. However, if the compression ratio decreases, }{\b\fs24 compress}{\fs24 discards the table of sub\-strings and rebuilds it from scratch. This allows the algorithm to adapt to the next "block" of the file. +\par +\par Note that the -b flag is omitted for }{\b\fs24 uncompress}{\fs24 , since the bits parameter specified during compression is encoded within the output, along with a magic number to en\-sure that neither decompression of random data nor recompres\-sion of compressed data is attempted. +\par +\par The amount of compression obtained depends on the size of the input, the number of bits per code, and the distri\-bution of common substrings. Typically, text such as source code or English is reduced by 50-60%. Compression is generally much faster compressing, but the output is not as small as freeze. +\par +\par Under the -v option, a message is printed yielding the percentage of reduction for each file compressed. +\par +\par If the -V option is specified, the current version and compile options are printed on stderr. +\par +\par }\pard\plain \s19\qj\nowidctlpar\widctlpar\adjustright \b\f4\cgrid {\f0 RETURN VALUE +\par }\pard\plain \li720\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 Exit status is normally 0; if the last file is larger after (attempted) compression, the status is 2; if an error occurs, exit status is 1. +\par +\par }\pard\plain \s19\qj\nowidctlpar\widctlpar\adjustright \b\f4\cgrid {\f0 SEE ALSO +\par }\pard\plain \li720\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\b\fs24 freeze}{\fs24 (1) +\par +\par }\pard\plain \s19\qj\nowidctlpar\widctlpar\adjustright \b\f4\cgrid {\f0 DIAGNOSTICS +\par }\pard\plain \li720\ri2520\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 Usage: compress [\\-dfvcV] [\\-b maxbits] [file ...] +\par }\pard\plain \s20\qj\li1440\ri2520\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 Invalid options were specified on the command line. +\par }\pard\plain \li720\ri2520\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 Missing maxbits +\par }\pard\plain \s20\qj\li1440\ri2520\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 Maxbits must follow -b. +\par }\pard\plain \li720\ri2520\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 file : not in compressed format +\par }\pard\plain \s20\qj\li1440\ri2520\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 The file specified to uncompress has not been compressed. +\par }\pard\plain \li720\ri2520\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 file : compressed with bits, can only handle yy bits +\par }\pard\plain \s20\qj\li1440\ri2520\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 File was compressed by a program that could deal with more bits than the compress code on this machine. Recompress the file with smaller bits. +\par }\pard\plain \s17\qj\li720\ri2520\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 file : already has .Z suffix -- no change +\par }\pard\plain \s20\qj\li1440\ri2520\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 The file is assumed to be already compressed. Rename the file and try again. +\par }\pard\plain \s17\qj\li720\ri2520\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 file : filename too long to tack on .Z +\par }\pard\plain \s20\qj\li1440\ri2520\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 The file cannot be compressed because its name is longer than 12 charac\-ters. Rename and try again. This message does not occur on BSD systems. +\par }\pard\plain \s17\qj\li720\ri2520\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 file already exists; do you wish to overwrite (y or n)? +\par }\pard\plain \s20\qj\li1440\ri2520\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 Respond "y" if you want the output file to be replaced; "n" if not. +\par }\pard\plain \s17\qj\li720\ri2520\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 Compression: "xx.xx%" +\par }\pard\plain \s20\qj\li1440\ri2520\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 Percentage of the input saved by compression. (Relevant only for -v.) +\par }\pard\plain \s17\qj\li720\ri2520\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 -- not a regular file: unchanged +\par }\pard\plain \s20\qj\li1440\ri2520\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 When the input file is not a regular file,(e.g. a directory), it is left unaltered. +\par }\pard\plain \s17\qj\li720\ri2520\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 -- file unchanged +\par }\pard\plain \s20\qj\li1440\ri2520\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 No savings is achieved by compression. The input remains virgin. +\par }\pard\plain \li720\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }\pard \nowidctlpar\widctlpar\adjustright {\b\fs24 BUGS +\par }\pard \li720\nowidctlpar\widctlpar\adjustright {\fs24 Although compressed files are compatible between machines with large memory, -b 12 should be used for file transfer to architectures with a small process data space (64KB or less, as exhibited by the DEC PDP series, the Intel 80286, etc.) +\par }\pard \nowidctlpar\widctlpar\adjustright {\fs24 +\par }\pard \fi720\nowidctlpar\widctlpar\adjustright {\fs24 \sect }\sectd \linex0\endnhere\sectdefaultcl {\headerl \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx4680\tqr\tx9360\adjustright \fs20\cgrid {\fs24 CONV(1}{\fs24 )\tab Commands and Applications\tab }{\fs24 CONV}{\fs24 (1) +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}{\headerr \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx4680\tqr\tx9360\adjustright \fs20\cgrid {\fs24 DU}{\fs24 (1)\tab Commands and Applications\tab }{\fs24 DU}{\fs24 (1) +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}{\footerl \pard\plain \s16\nowidctlpar\widctlpar\brdrb\brdrs\brdrw30\brsp20 \tqc\tx4320\tqr\tx9360\adjustright \fs20\cgrid {\ul +\par }\pard \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx9360\adjustright {\field{\*\fldinst {\cs18\b PAGE }}{\fldrslt {\cs18\b\lang1024 12}}}{ +\par }}\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\b\fs24 NAME}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 conv - convert file formats +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 SYNOPSIS}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 conv}{\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\b\f0 conv}}}{\f0 -}{\i\f0 convspec}{\f0 }{\i\f0 file1}{\f0 ... +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 DESCRIPTION}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 conv}{\f0 converts files between various formats. }{\i\f0 convspec}{\f0 is a specification detailing the type of file1 and the type to convert it to. +\par +\par }{\i\f0 -crlf}{\f0 \tab convert line terminators from CR (Apple) to LF (Unix). +\par +\par }{\i\f0 -lfcr}{\f0 \tab convert line terminators from LF (Unix) to CR (Apple). +\par +\par }{\i\f0 -detab spacing}{\f0 \tab translate tabs to spaces, using tabs every }{\i\f0 spacing}{\f0 characters. A smart algorithm is used which only inserts enough spaces to move to the next tab stop. }{\i\f0 spacing}{\f0 is an integer less than 20. +\par +\par }{\i\f0 -0001}{\f0 \tab converts all 0x00 bytes to 0x01 for using Macintosh sound files on the IIgs. +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 NOTES}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 conv}{\f0 is very quick on all the conversions except -detab (speed approaches 30K/sec). }{\b\f0 conv}{\f0 works under the Orca shell also, and supports the Orca method of wildcards. Look at the code to see how nasty this makes programs. +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 SEE ALSO}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 cat}{\f0 (1), }{\b\f0 more}{\f0 (1), }{\b\f0 tr}{\f0 (1) +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 AUTHOR}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 conv}{\f0 was written by Greg Thompson for GNO/ME. +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }\pard \fi720\nowidctlpar\widctlpar\adjustright {\fs24 \sect }\sectd \linex0\endnhere\sectdefaultcl {\headerr \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx4680\tqr\tx9360\adjustright \fs20\cgrid {\fs24 DU}{\fs24 (1)\tab Commands and Applications\tab }{\fs24 DU}{\fs24 (1) +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\b NAME}{ +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {du - Display disk usage statistics +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid { +\par }{\b SYNOPSIS}{ +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b du}{\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v }{\b du}}}{ [ -}{\i aksx}{ ] }{\i pathname}{ ... +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid { +\par }{\b DESCRIPTION}{ +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {The }{\b du}{ utility displays the block usage of files in the current directory or for the entire tree of a given pathname. +\par +\par The options are as follows: +\par +\par }\pard \s17\qj\fi-720\li1440\nowidctlpar\widctlpar\adjustright {-}{\i a}{\tab Generate an entry for each file. +\par }\pard \s17\qj\fi-720\li1440\nowidctlpar\widctlpar\adjustright {-}{\i k}{\tab By default, }{\b du}{ displays the number of blocks as returned by the }{\b stat}{\pard\plain \s17\qj\fi-720\li1440\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v }{\b stat}}}{(2) system call, i.e. 512-byte blocks. If the -}{\i k}{ flag is specified, the number displayed is the number of 1024-byte blocks with partial blocks rounded up. +\par -}{\i s}{\tab Generate only the grand total. If neither -}{\i a}{ or -}{\i s}{ are specified, an entry is generated for each directory only. +\par -}{\i x}{\tab Don't traverse any mount points. +\par }\pard \s17\qj\li720\nowidctlpar\widctlpar\adjustright { +\par Files having multiple hard links are counted (and displayed) a single time per }{\b du}{ execution. +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid { +\par }{\b SEE ALSO}{ +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b df}{(1) +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid { +\par }{\b BUGS}{ +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {The Apple IIGS does not have the concept of mount points, and thus the -}{\i x}{ option is useless. +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid { +\par }{\b HISTORY}{ +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {A }{\b du}{ command appeared in Version 6 AT&T Unix. +\par }\pard\plain \fi720\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 \sect }\sectd \linex0\endnhere\sectdefaultcl {\headerl \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx5040\tqr\tx9360\adjustright \fs20\cgrid {\fs24 EPS(1)\tab Commands and Applications\tab EPS(1) +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx5040\tqr\tx10080\adjustright { +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx5040\tqr\tx10080\adjustright { +\par }}{\headerr \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx4680\tqr\tx9360\adjustright \fs20\cgrid {\fs24 EPS(1)\tab Commands and Applications\tab EPS(1)}{ +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}{\footerl \pard\plain \s16\nowidctlpar\widctlpar\brdrb\brdrs\brdrw30\brsp20 \tqc\tx4320\tqr\tx10080\adjustright \fs20\cgrid {\ul +\par }\pard \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright {\b \chpgn +\par }}\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\b\fs24 NAME}{\fs24 +\par }\pard\plain \s22\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 eps - display extended process status information. +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 SYNOPSIS}{\fs24 +\par }\pard \li720\nowidctlpar\widctlpar\adjustright {\b\fs24 eps}{\fs24 }{\pard\plain \li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\fs24 }{\b\fs24 eps }}}{\fs24 [-}{\i\fs24 anlw}{\fs24 ] [-}{\i\fs24 t tty}{\fs24 ] [-}{\i\fs24 u user}{\fs24 ] +\par }\pard \nowidctlpar\widctlpar\adjustright {\fs24 +\par }{\b\fs24 DESCRIPTION}{\fs24 +\par }\pard\plain \s22\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 eps}{\f0 is an extended }{\b\f0 ps}{\f0 command which displays more information than the }{\b\f0 gsh}{\f0 builtin }{\b\f0 ps}{\f0 . +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }\pard \nowidctlpar\widctlpar\adjustright {\b\fs24 USAGE}{\fs24 +\par }\pard \fi-900\li1620\nowidctlpar\widctlpar\adjustright {\fs24 -}{\i\fs24 a}{\fs24 \tab Show all processes; normally eps limits the processes displayed to those that are owned by the current user. +\par +\par -}{\i\fs24 n}{\fs24 \tab Show username instead of userID, which is default. +\par -}{\i\fs24 l}{\fs24 \tab Long list. This includes PPID (parent's PID), MMID (Memory Manager ID) and a longer time field. +\par -}{\i\fs24 w}{\fs24 \tab Wider list. A single }{\i\fs24 w}{\fs24 results in a 132 column wide listing, and two results in the whole command line being displayed. Normally the command line will be truncated to either 80 (default) or 132 (-w) columns. +\par -}{\i\fs24 t tty}{\fs24 \tab Display only those processes that are owned by }{\i\fs24 tty}{\fs24 . +\par -}{\i\fs24 u user}{\fs24 \tab Display only those processes that are owned by }{\i\fs24 user}{\fs24 . +\par }\pard \nowidctlpar\widctlpar\adjustright {\fs24 +\par }{\b\fs24 SEE ALSO}{\fs24 +\par }\pard\plain \s22\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\i\f0 GNO Shell Reference Manual}{\f0 , }{\b\f0 parent}{\f0 (1) +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 AUTHOR}{\fs24 +\par }\pard\plain \s22\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 James Brookes +\par bb252@cleveland.freenet.edu +\par jamesb@cscihp.ecst.csuchico.edu +\par }\pard\plain \fi720\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par \sect }\sectd \psz1\linex0\endnhere\sectdefaultcl {\headerl \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx4680\tqr\tx9360\adjustright \fs20\cgrid {\fs24 FOLD(1)\tab Commands and Applications\tab FOLD(1) +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright {\f4 +\par }}{\headerr \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx9360\adjustright \fs20\cgrid {\fs24 FOLD(1)\tab Commands and Applications\tab FOLD(1) +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}{\footerr \pard\plain \s16\nowidctlpar\widctlpar\brdrb\brdrs\brdrw30\brsp20 \tqc\tx4320\tqr\tx10080\adjustright \fs20\cgrid {\ul +\par }\pard \s16\qr\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright {\field{\*\fldinst {\cs18\b PAGE }}{\fldrslt {\cs18\b\lang1024 29}}}{ +\par }}\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\b\fs24 NAME}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 fold - fold long lines for finite width output device +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 SYNOPSIS}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 fold}{\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\b\f0 fold}}}{\f0 [ -}{\b\f0 w}{\f0 }{\i\f0 width}{\f0 ] +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 DESCRIPTION}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 Fold}{\f0 is a filter which folds the contents of the specified files, or the standard input if no files are specified, breaking the lines to have maximum of 80 characters. +\par +\par The options are as follows: +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 -}{\b\f0 w}{\f0 }{\i\f0 width}{\f0 +\par }\pard\plain \s20\qj\li1440\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 Specifies a line width to use instead of the default 80 characters.}{\i\f0 Width }{\f0 should be a multiple of 8 if tabs are present, or the tabs should be expanded using }{\b\f0 conv}{\pard\plain \s20\qj\li1440\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\b\f0 conv}}}{\f0 (1) before using }{\b\f0 fold}{\f0 . +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 SEE ALSO}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 conv}{\f0 (1) +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 BUGS}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 If underlining is present it may be messed up by folding. +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }\pard \fi720\nowidctlpar\widctlpar\adjustright {\fs24 \sect }\sectd \linex0\endnhere\sectdefaultcl {\headerl \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx4680\tqr\tx9360\adjustright \fs20\cgrid {\fs24 GETVERS(1)\tab Commands and Applications\tab GETVERS(1) +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright {\f4 +\par }}{\headerr \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx4680\tqr\tx9360\adjustright \fs20\cgrid {\fs24 GETVERS(1)\tab Commands and Applications\tab GETVERS(1) +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\b\fs24 NAME}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 getvers,setvers - manipulate rVersion resources in executable files +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 SYNOPSIS}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 getvers}{\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\b\f0 getvers}}}{\f0 }{\i\f0 filename}{\f0 +\par }\pard \s17\qj\li720\nowidctlpar\widctlpar\adjustright {\b\f0 setvers}{\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\b\f0 setvers}}}{\f0 }{\i\f0 file}{\f0 ' }{\i\f0 string1}{\f0 ~ }{\i\f0 string2}{\f0 ' [ }{\i\f0 country}{\f0 ] }{\b\f0 v}{\i\f0 majrev.minrev.bugrev}{\f0 +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 DESCRIPTION}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 getvers}{\f0 accepts as input the name of an executable file, and prints the version information stored in the rVersion resource of the file. If no rVersion resource is present it will abort with the error `This file has no rVersion resource'. +\par +\par To add information to the rVersion resource, }{\b\f0 setvers}{\f0 is used. The rVersion format allows for two stirngs of up to 255 characters, although it is suggested that for this use you keep each field shorter than 80 characters. +\par +\par }{\i\f0 string1}{\f0 is separated from }{\i\f0 string2}{\f0 by a ~ (tilde) character, and both strings should be enclosed in single quotes. }{\i\f0 string1}{\f0 is required to be the name of the program. Any `_' character in }{\i\f0 string2}{\f0 will be interpreted as a carriage return. When using GNO, make sure to quote the single quotes and the tilde with backslashes. +\par +\par The optional field }{\i\f0 country}{\f0 (no spaces allowed) allows you to set the country field of the rVersion resource. The last parameter is the current revision number of the program in the format }{\b\f0 majrev . minrev . bugrev}{\f0 , where +\par }{\b\f0 majrev}{\f0 is a single or double digit number from 00 to 99, and }{\b\f0 minrev}{\f0 and }{\b\f0 bugrev}{\f0 are single digit numbers from zero to nine. +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 COUNTRIES}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 Valid Countries/Regions (case IS sensitive) +\par }\pard \s17\qj\li1440\nowidctlpar\widctlpar\tx4320\adjustright {\f0 Arabia\tab Iceland +\par }\pard \s17\qj\li1440\nowidctlpar\widctlpar\tx4320\adjustright {\f0 Australia\tab Israel +\par Belgium/Luxembourg\tab Italy +\par Bosnia/Herzegovena\tab Japan +\par Britian\tab Korea +\par China\tab Malta +\par Cyprus\tab Netherlands +\par Denmark\tab Norway +\par Finland\tab Portugal +\par France\tab Spain +\par FrenchCanadian\tab Sweden +\par FrenchSwiss\tab Taiwan +\par GermanSwiss\tab Thailand +\par Germany\tab Turkey +\par Greece\tab UnitedStates +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\fs24 +\par }{\b\fs24 EXAMPLES}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 Set the version of program `chmod' to read: +\par +\par chmod v01.0.0 +\par James Brookes +\par jamesb@cscihp.ecst.csuchico.edu +\par Country: United States +\par +\par in Orca: +\par +\par }\pard \s17\li720\nowidctlpar\widctlpar\adjustright {\f2 # setvers chmod 'chmod~James Brookes_jamesb@cscihp.ecst.csuchico.edu' v01.0.0}{\f0 +\par }\pard \s17\qj\li720\nowidctlpar\widctlpar\adjustright {\f0 +\par }\pard \s17\qj\li720\nowidctlpar\widctlpar\adjustright {\f0 in GNO: +\par +\par }\pard \s17\li720\nowidctlpar\widctlpar\adjustright {\f2 % setvers chmod \\'chmod\\\\~James Brookes_jamesb@cscihp.ecst.csuchico.edu\\' v01.0.0 +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 CAVEATS}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 If an rVersion resource already exists, it will be overwritten and replaced with the new one. Other resources will be unaffected. +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 BUGS}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 Little crawly things, also known as insects. +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 AUTHOR}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 Ian Schmidt - Two Meg Software (irsman@iastate.edu) +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }\pard \fi720\nowidctlpar\widctlpar\adjustright {\fs24 \sect }\sectd \linex0\endnhere\sectdefaultcl {\headerl \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx4680\tqr\tx9360\adjustright \fs20\cgrid {\fs24 GREP(1)\tab Commands and Applications\tab GREP(1) +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}{\headerr \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx4680\tqr\tx9360\adjustright \fs20\cgrid {\fs24 GREP(1)\tab Commands and Applications\tab GREP(1) +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\b\fs24 NAME}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 grep, egrep, fgrep - search a file for a string or regular expression +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 SYNOPSIS}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 grep}{\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\b\f0 grep}}}{\f0 [ -}{\b\f0 bchilnsvw}{\f0 ] [ -}{\b\f0 e}{\f0 }{\i\f0 expression}{\f0 ] [ }{\i\f0 filename}{\f0 ... ] +\par }{\b\f0 egrep}{\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\b\f0 egrep}}}{\f0 [ -}{\b\f0 bchilnsv}{\f0 ] [ -}{\b\f0 e}{\f0 }{\i\f0 expression}{\f0 ] [ -}{\b\f0 f}{\f0 }{\i\f0 filename}{\f0 ] [ }{\i\f0 expression}{\f0 ] [ }{\i\f0 filename}{\f0 ... ] +\par }{\b\f0 fgrep}{\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\b\f0 fgrep}}}{\f0 [ -}{\b\f0 bchilnsvx}{\f0 ] [ -}{\b\f0 e}{\f0 }{\i\f0 string}{\f0 ] [ -}{\b\f0 f}{\f0 }{\i\f0 filename}{\f0 ] [ }{\i\f0 string}{\f0 ] [ }{\i\f0 filename}{\f0 ... ] +\par +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\b\fs24 DESCRIPTION}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 Commands of the }{\b\f0 grep}{\f0 family search the input filenames (the standard input default) for lines matching a pattern. Normally, each line found is copied to the standard output. }{\b\f0 grep}{\f0 patterns are limited regular expresions in the style of }{\b\f0 ed}{\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\b\f0 ed}}}{\f0 (1). }{\b\f0 egrep}{\f0 patterns are full regular expressions including alternation. }{\b\f0 fgrep}{\f0 patterns are fixed strings - no regular expression metacharacters are supported, and as a result }{\b\f0 fgrep}{\f0 is generally an order of magnitude faster than the other versions of }{\b\f0 grep}{\f0 . +\par +\par Take care when using the characters `$', `*', [, `^', `|', `(', `)', and `\\' in the }{\i\f0 expression}{\f0 , as these characters are also meaningful to the shell. It is safest to enclose the entire }{\i\f0 expression}{\f0 argument in single quotes `...' +\par +\par When any of the }{\b\f0 grep}{\f0 utilities is applied to more than one input file, the name of the file is displayed preceding each line which matches the pattern. The filename is not displayed when processing a single file, so if you actually want the filename to appear, use }{\b\f0 .null}{\f0 as a second file in the list. +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 OPTIONS}{\fs24 +\par }\pard\plain \s17\qj\fi-720\li1440\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 -}{\b\f0 b}{\f0 \tab Precede each line by the block number on which it was found. This is sometimes useful in locating disk block numbers by context. +\par +\par -}{\b\f0 c}{\f0 \tab Display a count of matching lines rather than displaying the lines which match. +\par +\par -}{\b\f0 h}{\f0 \tab Do not display filenames. +\par +\par -}{\b\f0 i}{\f0 \tab Ignore the case of letters in making comparisons - that is, upper and lower case are considered identical. +\par +\par -}{\b\f0 l}{\f0 \tab List only the names of files with matching lines (once) separated by NEWLINE characters. +\par +\par -}{\b\f0 n}{\f0 \tab Precede each line by its relative line number in the file. +\par +\par }\pard \s17\qj\fi-720\li1440\nowidctlpar\widctlpar\adjustright {\f0 -}{\b\f0 s}{\f0 \tab Work silently, that is, display nothing except error messages. This is useful for checking the error status. +\par }\pard \s17\qj\fi-720\li1440\nowidctlpar\widctlpar\adjustright {\f0 +\par -}{\b\f0 v}{\f0 \tab Invert the search to only display lines that do not match. +\par +\par -}{\b\f0 w}{\f0 \tab Search for the expression as a word as if surrounded by \\< and \\>. This applies to grep only. +\par +\par -}{\b\f0 x}{\f0 \tab Display only those lines which match exactly - that is, only lines which match in their entirety. This applies to fgrep only. +\par +\par -}{\b\f0 e}{\f0 }{\i\f0 expression}{\f0 +\par \tab Same as a simple }{\i\f0 expression}{\f0 argument, but useful when the }{\i\f0 expression}{\f0 begins with a `-'. +\par +\par -}{\b\f0 e}{\f0 }{\i\f0 string}{\f0 +\par \tab For }{\b\f0 fgrep}{\f0 the argument is a literal character }{\i\f0 string }{\f0 . +\par +\par -}{\b\f0 f}{\f0 }{\i\f0 filename}{\f0 +\par \tab Take the regular expression (}{\b\f0 egrep}{\f0 ) or a list of strings separated by NEWLINE (}{\b\f0 fgrep}{\f0 ) from }{\i\f0 filename}{\f0 . +\par +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\b\fs24 REGULAR EXPRESSIONS}{\fs24 +\par }\pard\plain \s17\qj\fi-720\li1440\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 The following one-character regular expressions match a single character: +\par +\par }{\b\f0 c}{\f0 \tab An ordinary character ( not one of the special characters discussed below) is a one-character regular expression that matches that character. +\par +\par }{\b\f0 \\ c}{\f0 \tab A backslash (\\) followed by any special character is a one-character regular expression that matches the special character itself. The special characters are: +\par +\par }\pard \s17\qj\fi-720\li2160\nowidctlpar\widctlpar\adjustright {\f0 \bullet \tab `.', `*', `[', and `\\' (period, asterisk, left square bracket, and backslash, respectively), which are always special, except when they appear within square brackets ([]). +\par +\par \bullet \tab `^' (caret or circumflex), which is special at the beginning of an entire regular expression, or when it immediately follows the left of a pair of square brackets ([]). +\par +\par \bullet \tab $ (currency symbol), which is special at the end of an entire regular expression. +\par }\pard \s17\qj\fi-720\li1440\nowidctlpar\widctlpar\adjustright {\f0 +\par }\pard \s17\qj\li720\nowidctlpar\widctlpar\adjustright {\f0 A backslash followed by one of `<', `>', `(', `)', `\{', or `\}', represents a special operator in the regular expression; see below. +\par }\pard \s17\qj\fi-720\li1440\nowidctlpar\widctlpar\adjustright {\f0 +\par }\pard \s17\qj\fi-720\li1440\nowidctlpar\widctlpar\adjustright {\b\f0 .}{\f0 \tab A `}{\b\f0 .}{\f0 ' (period) is a one-character regular expression that matches any character except NEWLINE. +\par +\par [ }{\i\f0 string}{\f0 ] +\par \tab A non-empty string of characters enclosed in square brackets is a one-character regular expression that matches any one character in that string. If, however, the first character of the string is a `^' (a circumflex or caret), the one-character regular expression matches any character except NEWLINE and the remaining characters in the string. The `^' has this special meaning only if it occurs first in the string. The `-' (minus) may be used to indicate a range of consecutive ASCII characters; for example, [}{\b\f0 0-9}{\f0 ] is equivalent to [}{\b\f0 0123456789}{\f0 ]. The `-' loses this special meaning if it occurs first (after an initial `^', if any) or last in the string. The `]' (right square bracket) does not terminate such a string when it is the first character within it (after an initial `^', if any); that is, []}{\b\f0 a-f}{\f0 ] matches either `]' (a right square bracket ) or one of the letters a through f inclusive. The four characters `.', `*', `[', and `\\' stand for themselves within such a string of characters. +\par +\par The following rules may be used to construct regular expressions: +\par +\par }{\b\f0 *}{\f0 \tab A one-character regular expression followed by `*' (an asterisk) is a regular expression that matches zero or more occurrences of the one-character regular expression. If there is any choice, the longest leftmost string that permits a match is chosen. +\par +\par }{\b\f0 \\(and\\)}{\f0 +\par \tab A regular expression enclosed between the character sequences \\( and \\) matches whatever the unadorned regular expression matches. This applies only to }{\b\f0 grep}{\f0 . +\par +\par }{\b\f0 \\ }{\b\i\f0 n}{\f0 \tab The expression \\ }{\i\f0 n}{\f0 matches the same string of characters as was matched by an expression enclosed between }{\b\f0 \\(}{\f0 and }{\b\f0 \\)}{\f0 earlier in the same regular expression. Here }{\i\f0 n}{\f0 is a digit; the sub-expression specified is that beginning with the n th occurrence of }{\b\f0 \\(}{\f0 counting from the left. For example, the expression }{\b\f0 ^\\(.*\\)\\1$}{\f0 matches a line consisting of two repeated appearances of the same string. +\par }\pard \s17\qj\fi-720\li1440\nowidctlpar\widctlpar\adjustright {\f0 +\par }{\b\f0 Concatenation}{\f0 +\par }\pard \s17\qj\li720\nowidctlpar\widctlpar\adjustright {\f0 The concatenation of regular expressions is a regular expression that matches the concatenation of the strings matched by each component of the regular expression. +\par }\pard \s17\qj\fi-720\li1440\nowidctlpar\widctlpar\adjustright {\f0 +\par }\pard \s17\qj\fi-720\li1440\nowidctlpar\widctlpar\adjustright {\b\f0 \\<}{\f0 \tab The sequence }{\b\f0 \\<}{\f0 in a regular expression constrains the one-character regular expression immediately following it only to match something at the beginning of a word; that is, either at the beginning of a line, or just before a letter, digit, or underline and after a character not one of these. +\par +\par }{\b\f0 \\>}{\f0 \tab The sequence }{\b\f0 \\>}{\f0 in a regular expression constrains the one-character regular expression immediately following it only to match something at the end of a word; that is, either at the end of a line, or just before a character which is neither a letter, digit, nor underline. +\par +\par }{\b\f0 \\\{ m \\\} +\par \\\{ m ,\\\} +\par \\\{ m , n \\\}}{\f0 +\par \tab A regular expression followed by }{\b\f0 \\\{ m \\\}}{\f0 , }{\b\f0 \\\{ m , \\ \}}{\f0 , or }{\b\f0 \\\{ m , n \\\}}{\f0 matches a range of occurrences of the regular expression. The values of m and n must be non-negative integers less than 256; \\\{ m \\\} matches exactly m occurrences; \\\{ m ,\\\} matches at least m occurrences; \\\{ m , n \\\} matches any number of occurrences between m and n inclusive. Whenever a choice exists, the regular expression matches as many occurrences as possible. +\par +\par }{\b\f0 ^}{\f0 \tab A circumflex or caret (^) at the beginning of an entire regular expression constrains that regular expression to match an initial segment of a line. +\par +\par }{\b\f0 $}{\f0 \tab A currency symbol ($) at the end of an entire regular expression constrains that regular expression to match a final segment of a line. +\par +\par }\pard \s17\qj\li720\nowidctlpar\widctlpar\adjustright {\f0 The construction +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }\pard\plain \s20\qj\li1440\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f2 example% ^ }{\f2 entire regular expression $}{\f0 +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 constrains the entire regular expression to match the entire line. +\par +\par egrep accepts regular expressions of the same sort grep does, except for \\(, \\), \\ n, \\<, \\>, \\\{, and \\\}, with the addition of: +\par +\par }\pard \s17\qj\fi-720\li1440\nowidctlpar\widctlpar\adjustright {\f0 *\tab A regular expression (not just a one-character regular expression) followed by `*' (an asterisk) is a regular expression that matches zero or more occurrences of the one-character regular expression. If there is any choice, the longest leftmost string that permits a match is chosen. +\par }\pard \s17\qj\fi-720\li1440\nowidctlpar\widctlpar\adjustright {\f0 +\par +\tab A regular expression followed by `+' (a plus sign) is a regular expression that matches one or more occurrences of the one-character regular expression. If there is any choice, the longest leftmost string that permits a match is chosen. +\par +\par ?\tab A regular expression followed by `?' (a question mark) is a regular expression that matches zero or one occurrences of the one-character regular expression. If there is any choice, the longest leftmost string that permits a match is chosen. +\par +\par |\tab Alternation: two regular expressions separated by `|' or NEWLINE match either a match for the first or a match for the second. +\par +\par ()\tab A regular expression enclosed in parentheses matches a match for the regular expression. +\par }\pard \s17\qj\li720\nowidctlpar\widctlpar\adjustright {\f0 +\par The order of precedence of operators at the same parenthesis level is `[ ]' (character classes), then `*' `+' `?' (}{\b\f0 closures}{\f0 ),then concatenation, then `|' (}{\b\f0 alternation}{\f0 ) and NEWLINE. +\par }{\f0 \page }{\f0 +\par }\pard\plain \s19\qj\nowidctlpar\widctlpar\adjustright \b\f4\cgrid {\f0 EXAMPLES}{\f0 +\par }{\f0 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 Search a file for a fixed string using }{\b\f0 fgrep}{\f0 : +\par +\par }{\b\f0 \tab }{\b\f2 example% fgrep intro /usr/share/man/man3/*.3* +\par }\pard \s17\qj\li720\nowidctlpar\widctlpar\adjustright {\f0 +\par }\pard \s17\qj\li720\nowidctlpar\widctlpar\adjustright {\f0 Look for character classes using }{\b\f0 grep}{\f0 : +\par +\par }{\b\f0 \tab }{\b\f2 example% grep '[1-8]([CJMSNX])' /usr/share/man/man1/*.1 +\par }{\f0 +\par Look for alternative patterns using }{\b\f0 egrep}{\f0 : +\par +\par }\pard \s17\li720\nowidctlpar\widctlpar\adjustright {\b\f0 \tab }{\b\f2 example% egrep '(Sally|Fred) (Smith|Jones|Parker)' telephone.list}{\b\f0 +\par }\pard \s17\qj\li720\nowidctlpar\widctlpar\adjustright {\f0 +\par To get the filename displayed when only processing a single file, use }{\b\f0 .null}{\f0 as the second file in the list: +\par +\par }{\b\f0 \tab }{\b\f2 example% grep 'Sally Parker' telephone.list /dev/null +\par }{\f0 +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\b\fs24 FILES}{\fs24 +\par \tab .null +\par +\par }{\b\fs24 SEE ALSO}{\fs24 +\par \tab }{\b\fs24 awk}{\fs24 (1), }{\b\fs24 gsh}{\fs24 (1), }{\b\fs24 vi}{\fs24 (1), }{\b\fs24 sed}{\fs24 (1) +\par +\par }{\b\fs24 BUGS}{\fs24 +\par \tab Lines are limited to 1024 characters by }{\b\fs24 grep}{\fs24 ; longer lines are truncated. +\par +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 The combination of -}{\b\f0 l}{\f0 and -}{\b\f0 v}{\f0 options does not produce a list of files in which a regular expression is not found. To get such a list, use the C shell construct (Note: this is NOT the same as gsh, which does not support such programming). +\par +\par }\pard \s17\li720\nowidctlpar\widctlpar\adjustright {\f0 \tab }{\f2\fs20 foreach filename (*) +\par }\pard \s17\li720\nowidctlpar\widctlpar\adjustright {\f2\fs20 \tab \tab if (`grep " re " $ filename | wc -l` == 0) echo $ filename +\par \tab end +\par }\pard \s17\qj\li720\nowidctlpar\widctlpar\adjustright {\f0 +\par Ideally there should be only one }{\b\f0 grep}{\f0 . +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 DIAGNOSTICS}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 Exit status is 0 if any matches are found, 1 if none, 2 for syntax errors or inaccessible files. +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }\pard \fi720\nowidctlpar\widctlpar\adjustright {\fs24 \sect }\sectd \linex0\endnhere\sectdefaultcl {\headerl \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright \fs20\cgrid {INTRO(1)\tab Commands and Applications\tab INTRO(1) +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}{\headerr \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx4680\tqr\tx9360\adjustright \fs20\cgrid {\fs24 HEAD}{\fs24 (1)\tab Commands and Applications\tab }{\fs24 HEAD}{\fs24 (1) +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}{\footerl \pard\plain \s16\nowidctlpar\widctlpar\brdrb\brdrs\brdrw30\brsp20 \tqc\tx4320\tqr\tx10080\adjustright \fs20\cgrid {\ul +\par }\pard \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright {\field{\*\fldinst {\cs18\b PAGE }}{\fldrslt {\cs18\b\lang1024 26}}}{ +\par }}\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\b\fs24 NAME}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 head - give first few lines +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 SYNOPSIS}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 head}{\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\b\f0 head}}}{\f0 [-}{\i\f0 count}{\f0 ] [}{\i\f0 file}{\f0 ...] +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\b\fs24 +\par DESCRIPTION}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 This filter gives the first }{\i\f0 count}{\f0 lines of each of the specified files, or of the standard input. If }{\i\f0 count}{\f0 is omitted it defaults to 10. +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 SEE ALSO}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 tail}{\f0 (1) +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 HISTORY}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 head}{\f0 appeared in 3 BSD. +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }\pard\plain \s17\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\i\f0 \sect }\sectd \psz1\linex0\endnhere\sectdefaultcl {\headerl \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx4680\tqr\tx9360\adjustright \fs20\cgrid {\fs24 LS(1)\tab Commands and Applications\tab LS(1)}{\fs24 +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx4680\tqr\tx9360\adjustright { +\par }}{\headerr \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx4680\tqr\tx9360\adjustright \fs20\cgrid {\fs24 LS(1)\tab Commands and Applications\tab LS(1) +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\b\fs24 NAME}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 ls - list contents of directory +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 SYNOPSIS}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 ls}{\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\b\f0 ls}}}{\f0 [ -}{\b\f0 acdfilqrstu1ACLFR}{\f0 ] }{\i\f0 name}{\f0 ... +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 DESCRIPTION}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 For each directory argument, }{\b\f0 ls}{\f0 lists the contents of the directory; for each file argument, }{\b\f0 ls}{\f0 repeats its name and any other information requested. By default, the output is sorted alphabetically. When no argument is given, the current directory is listed. When several arguments are given, the arguments are first sorted appropriately, but file arguments are processed before directories and their contents. +\par +\par There are a large number of options: +\par +\par }\pard \s17\qj\fi-720\li1440\nowidctlpar\widctlpar\adjustright {\f0 -}{\b\f0 l}{\f0 \tab List in long format, giving mode, number of links,owner, size in bytes, and time of last modification for each file. If the file is a special file the size field will instead contain the major and minor device numbers. If the file is a symbolic link the pathname of the linked-to file is printed preceded by ``->''. +\par }\pard \s17\qj\fi-720\li1440\nowidctlpar\widctlpar\adjustright {\f0 +\par -}{\b\f0 t}{\f0 \tab Sort by time modified (latest first) instead of by name. +\par +\par -}{\b\f0 a}{\f0 \tab List all entries; in the absence of this option, entries whose names begin with a period (.) or whose GS/OS 'invisible' flag is set are not listed. +\par +\par -}{\b\f0 A}{\f0 \tab List all entries except for the current directory (.) and the parent directory (..). +\par +\par -}{\b\f0 s}{\f0 \tab Give size in kilobytes of each file. +\par +\par -}{\b\f0 d}{\f0 \tab If argument is a directory, list only its name; often used with -}{\b\f0 l}{\f0 to get the status of a directory. +\par +\par -}{\b\f0 L}{\f0 \tab If argument is a symbolic link, list the file or directory the link references rather than the link itself. Note that if the link references a directory the link is always followed, unless the -}{\b\f0 l}{\f0 option is used. +\par +\par -}{\b\f0 r}{\f0 \tab Reverse the order of sort to get reverse alphabetic or oldest first as appropriate. +\par +\par -}{\b\f0 u}{\f0 \tab Use time of last access instead of last modification for sorting (with the -}{\b\f0 t }{\f0 option) and/or printing (with the -}{\b\f0 l}{\f0 option). +\par +\par -}{\b\f0 c}{\f0 \tab Use time of file creation for sorting or printing. +\par +\par -}{\b\f0 i}{\f0 \tab For each file, print the i-number in the first column of the report. +\par +\par -}{\b\f0 f}{\f0 \tab Force each argument to be interpreted as a directory and list the name found in each slot. This option turns off -}{\b\f0 l}{\f0 , -}{\b\f0 t}{\f0 , -}{\b\f0 s}{\f0 , and -}{\b\f0 r}{\f0 , and turns on -}{\b\f0 a}{\f0 ; the order is the order in which entries appear in the directory. +\par +\par -}{\b\f0 F}{\f0 \tab Cause directories to be marked with a trailing `/', sockets with a trailing `=', executable files with a trailing `*', and symbolic links to files with a trailing `@'. Symbolic links to directories are marked with a trailing `/', unless the -l option is also used. +\par +\par -}{\b\f0 R}{\f0 \tab recursively list subdirectories encountered. +\par }\pard \s17\qj\fi-720\li1440\nowidctlpar\widctlpar\adjustright {\f0 +\par }\pard \s17\qj\fi-720\li1440\nowidctlpar\widctlpar\adjustright {\f0 -}{\b\f0 1}{\f0 \tab force one entry per line output format; this is the default when output is not to a terminal. +\par +\par -}{\b\f0 C}{\f0 \tab force multi-column output; this is the default when output is to a terminal. +\par +\par -}{\b\f0 q}{\f0 \tab force printing of non-graphic characters in file names as the character `?'; this is the default when output is to a terminal. +\par +\par -}{\b\f0 n}{\f0 \tab Causes }{\b\f0 ls}{\f0 to not sort files; this is useful when organizing libraries in alphabetical order for ORCA languages. +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 The mode printed under the -l option contains 11 characters which are interpreted as follows: the first character is +\par +\par }\pard \s17\qj\fi-720\li1440\nowidctlpar\widctlpar\adjustright {\b\f0 e}{\f0 \tab if the entry has a resource fork, +\par }\pard \s17\qj\fi-720\li1440\nowidctlpar\widctlpar\adjustright {\b\f0 d}{\f0 \tab if the entry is a directory; +\par }{\b\f0 b}{\f0 \tab if the entry is a block-type special file; +\par }{\b\f0 c}{\f0 \tab if the entry is a character-type special file; +\par }{\b\f0 l}{\f0 \tab if the entry is a symbolic link; +\par }{\b\f0 s}{\f0 \tab if the entry is a socket, or +\par }{\b\f0 -}{\f0 \tab if the entry is a plain file. +\par }\pard \s17\qj\li720\nowidctlpar\widctlpar\adjustright {\f0 +\par The next 9 characters are interpreted as three sets of three bits each. The first set refers to owner permissions; the next refers to permissions to others in the same user-group; and the last to all others. Within each set the three characters indicate permission respectively to read, to write, or to execute the file as a program. For a directory, `execute' permission is interpreted to mean permission to search the directory. The permissions are indicated as follows: +\par +\par }{\b\f0 i}{\f0 \tab if the file is invisible +\par }\pard \s17\qj\li720\nowidctlpar\widctlpar\adjustright {\b\f0 d}{\f0 \tab if the file can be deleted +\par }{\b\f0 r}{\f0 \tab if the file is readable; +\par }{\b\f0 w}{\f0 \tab if the file is writable; +\par }{\b\f0 x}{\f0 \tab if the file is executable; +\par }{\b\f0 -}{\f0 \tab if the indicated permission is not granted. +\par +\par The group-execute permission character is given as }{\b\f0 s}{\f0 if the file has the set-group-id bit set; likewise the user-execute permission character is given as }{\b\f0 s}{\f0 if the file has the set-user-id bit set. +\par +\par When the sizes of the files in a directory are listed, a total count of blocks, including indirect blocks is printed. +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 BUGS}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 The output device is assumed to be 80 columns wide. +\par GNO and GS/OS do not currently support links, user/group permissions, the concept of 'i-numbers', or 'special' files; thus, ls options that deal with these are ignored. +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 \sect }\sectd \psz1\linex0\endnhere\sectdefaultcl {\headerl \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright \fs20\cgrid {LSEG(1)\tab Commands and Applications\tab LSEG(1) +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright {\f4 +\par }}{\headerr \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx4680\tqr\tx9360\adjustright \fs20\cgrid {\fs24 LSEG(1)\tab Commands and Applications\tab LSEG(1) +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}{\footerl \pard\plain \s16\nowidctlpar\widctlpar\brdrb\brdrs\brdrw30\brsp20 \tqc\tx4320\tqr\tx8640\adjustright \fs20\cgrid { +\par }\pard \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright {\field{\*\fldinst {\cs18\b PAGE }}{\fldrslt {\cs18\b\lang1024 30}}}{ +\par }}\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\b\fs24 NAME}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 lseg - list segments in an OMF file +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 SYNOPSIS}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 lseg}{\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\b\f0 lseg}}}{\f0 file +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }\pard \nowidctlpar\widctlpar\adjustright {\b\fs24 DESCRIPTION}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 lseg}{\f0 lists the segments of an OMF executable file. While it can list the segments in an intermediate object file, the information isn't as useful. +\par +\par }{\b\f0 lseg}{\f0 is intended for discovering the location of stack segments in existing applications (for editing to smaller sizes), as an aid in determining how to segment large C files whose segments exceed the bank size, and for deciding which segments to recombine after excessive segmentation. +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 AUTHOR}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 Jawaid Bazyar for GNO/ME. +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 BUGS}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 Doesn't detect non-OMF files, and thus can get very confused if you do "lseg *" and one of the files chosen isn't an OMF file. Usually the only way to terminate is to interrupt the program with ^C. +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 \sect }\sectd \linex0\endnhere\sectdefaultcl {\headerl \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx4680\tqr\tx9360\adjustright \fs20\cgrid {\fs24 MAKE(1)\tab Commands and Applications\tab MAKE(1) +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright {\f4 +\par }}{\headerr \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx4680\tqr\tx9360\adjustright \fs20\cgrid {\fs24 MAKE(1)\tab Commands and Applications\tab MAKE(1) +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright {\f4 +\par }}\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\b\fs24 NAME}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 make - build a program according to a program definition file +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 SYNOPSIS}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 make}{\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\b\f0 make}}}{\f0 [-d] [-p] [-s] inputFile +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 DESCRIPTION}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 make}{\f0 is a program maintenance utility that aids in creating programs from multiple source files. +\par +\par inputFile is the name of the Program Description File. If absent, make defaults to using 'makefile' as the PDF. make's options are as follows: +\par }\pard\plain \s20\qj\li1440\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 +\par -d Display the modification date and time as each file is checked. +\par -p Operate in programmer/debug mode. +\par -s Operate in silent mode. +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 The logical definition of each of the PDF parameters follows: +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }\pard\plain \s20\li1440\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f2 # Comments begin with a pound sign "#". +\par # +\par TargetFile: DependentFile1 }{\f2 \\ # +\par }\pard \s20\fi720\li1440\nowidctlpar\widctlpar\adjustright {\f2 DependentFile2 }{\f2 D}{\f2 ependentFilen +\par }\pard \s20\li1440\nowidctlpar\widctlpar\adjustright {\f2 ShellCommand1 +\par ShellCommand2 +\par \tab . +\par \tab . +\par ShellCommandn +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 MAKE PARAMETERS}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 Comments can be placed anywhere in the PDF file. If a pound sign is in column one, the entire line is treated as a comment. Anything following the pound is ignored by make. Comments may also be placed on parameter lines containing Target/Dependent file parameters. +\par +\par The TargetFile parameter must start in column one and ends with a colon ":". It can be a full path name, partial path name or file in the current directory. This file is usually an object type file created by a compiler. Dependent file parameter(s) follow the semicolon and are separated by a space, a comma or both. Dependent file parameters are usually CC, PAS, ASM or some type of included SRC file. Essentially, TargetFile is the result of compiling the dependent source files. +\par }\pard \s17\qj\li720\nowidctlpar\widctlpar\adjustright {\f0 +\par }\pard \s17\qj\li720\nowidctlpar\widctlpar\adjustright {\b\f0 make}{\f0 obtains the modfication date and time of the Target file and then compares it to each of the dependent file(s) moving left to right. If one of the dependent files has a date and time later than the Target file, the subsequent ShellCommands are executed. Target/Dependent parameters may be continued by placing a reverse slash "\\" on the line following a dependent file parameter. make will interpret the next line as dependent file parameters which may also be continued and so on. There should not be any blank lines between the continued line and next line. +\par +\par ShellCommands must contain a space in column one to differentiate them from Target/Dependent file parameters. If make determines that a Target file needs to be recreated, the ShellCommands following the Target/Dependent file parameters are passed, as is, to the shell interpreter. The commands must be valid shell commands. ShellCommands are executed until a blank line is encountered or an error occurs during the execution of the last command. If an error occurs, make terminates without reading the remaining PDF parameters. If a blank line is read, make returns to Target/Dependent search mode. +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 MAKE Example +\par +\par }\pard\plain \s20\li1440\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f2\fs20 # +\par # File: Example.Make - A MAKE example PDF # +\par +\par Menu.Root: Menu.CC # Contains menu related routines +\par compile menu.cc keep=menu +\par +\par Window.Root: Window.CC # Contains window handling routines +\par compile window.cc keep=window +\par +\par Misc.Root: Misc.CC Misc.h # Contains miscellaneous program routines +\par compile misc.cc keep=misc +\par +\par Main.Root: Main.CC Include/Main.h Include/Misc.h # Main program +\par compile main.cc keep=main +\par +\par MyProg: Menu.Root Window.Root Misc.Root \\ # re-link required? +\par \tab Main.Root\tab \tab \tab \tab # check all dependent files +\par link main misc menu window keep=myprog\tab # Shell comment +\par chtyp -t s16 myprog\tab \tab \tab # change type to S16 +\par +\par # End of PDF +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 The example PDF shows a program that is made up of 4 source files. The Main and Misc routines are also de\-pendent on include files containing information that if changed would force a re-compile of that module. +\par +\par One thing to keep in mind is the order of Target/Dependent parameters can be important. make examines the PDF from the top down. If a file is modified due to a command later in the PDF, make will not return to a previous Target/Dependent parameter in which that file was a dependent file. +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 AUTHOR}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 Original make util written by Larry Agle for ORCA; modifications made to make it look more like UNIX make, and misc. }{\f0 B}{\f0 ug fixes by Jawaid Bazyar. +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 \sect }\sectd \linex0\endnhere\sectdefaultcl {\headerl \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx4680\tqr\tx9360\adjustright \fs20\cgrid {\fs24 MAKEMAKE(1)\tab Commands and Applications\tab MAKEMAKE(1) +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}{\headerr \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx4680\tqr\tx9360\adjustright \fs20\cgrid {\fs24 MAKEMAKE(1)\tab Commands and Applications\tab MAKEMAKE(1) +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}{\footerr \pard\plain \s16\nowidctlpar\widctlpar\brdrb\brdrs\brdrw30\brsp20 \tqc\tx4320\tqr\tx10080\adjustright \fs20\cgrid {\ul +\par }\pard \s16\qr\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright {\field{\*\fldinst {\cs18\b PAGE }}{\fldrslt {\cs18\b\lang1024 31}}}{ +\par }}\pard\plain \s21\qj\nowidctlpar\widctlpar\adjustright \b\f4\cgrid {\f0 NAME +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 makemake - scan C source files for dependencies and create a makefile +\par +\par }\pard\plain \s21\qj\nowidctlpar\widctlpar\adjustright \b\f4\cgrid {\f0 SYNOPSIS +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 makemake}{\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\b\f0 makemake}}}{\f0 source.c +\par +\par }\pard\plain \s21\qj\nowidctlpar\widctlpar\adjustright \b\f4\cgrid {\f0 DESCRIPTION +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 makemake}{\f0 takes the C source file(s) as input, and scans them for dependencies (#includes). It does not count standard headers (#includes with the filename surrounded by < >). +\par +\par The dependency information for all the source files specified is then written to a file 'makefile' in the current directory. +\par +\par }{\b\f0 makemake}{\f0 does not create link scripts nor does it put an executable dependendcy into the file, as these require link information not available from the }{\b\f0 makemake}{\f0 command line. +\par +\par }\pard\plain \s21\qj\nowidctlpar\widctlpar\adjustright \b\f4\cgrid {\f0 AUTHOR +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 Jawaid Bazyar for GNO/ME's 'make' utility. He got tired of writing them by hand. +\par +\par }\pard\plain \s21\qj\nowidctlpar\widctlpar\adjustright \b\f4\cgrid {\f0 BUGS +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 makemake}{\f0 does not properly handle recursive or multiple includes of the same file. If the same file is included more than once, }{\b\f0 makemake}{\f0 will list it that many times in the output makefile. While multiple includes don't hurt anything, it can take more time to process the makefile. Recursive includes will, of course, hang }{\b\f0 makemake}{\f0 . +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 \sect }\sectd \linex0\endnhere\sectdefaultcl {\headerl \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx4680\tqr\tx9360\adjustright \fs20\cgrid {\fs24 MAN(1)\tab Commands and Applications\tab MAN(1) +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright {\f4 +\par }}{\headerr \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx4680\tqr\tx9360\adjustright \fs20\cgrid {\fs24 MAN(1)\tab Commands and Applications\tab MAN(1) +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}{\footerl \pard\plain \s16\nowidctlpar\widctlpar\brdrb\brdrs\brdrw30\brsp20 \tqc\tx4320\tqr\tx10080\adjustright \fs20\cgrid {\ul +\par }\pard \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright {\field{\*\fldinst {\cs18\b PAGE }}{\fldrslt {\cs18\b\lang1024 32}}}{ +\par }}\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\b\fs24 NAME}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 man - online manual system (Version 1.6) +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 SYNOPSIS}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 man}{\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\b\f0 man}}}{\f0 [ }{\i\f0 section}{\f0 ] }{\i\f0 manpagename}{\f0 +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 DESCRIPTION}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 man}{\f0 is the access point to the online manual system. }{\b\f0 man}{\f0 works as a shell that calls an appropriate text formatter to format a manual page. There are currently three text formatters available for the GNO/ME system. +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 nroff}{\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\b\f0 nroff}}}{\f0 \tab Unix standard typesetting package +\par }{\b\f0 aroff}{\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\b\f0 aroff}}}{\f0 \tab formats AppleWorks GS(tm) documents +\par }{\b\f0 cat}{\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\b\f0 cat}}}{\f0 \tab used to display preformatted documents +\par +\par If the option section argument is specified, }{\b\f0 man}{\f0 looks specifically in that section of the manual for the manpage. This is needed in situations where there are manpages with the same name in different sections (for example, }{\b\f0 sleep}{\f0 (1) and }{\b\f0 sleep}{\f0 (3). +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 ENVIRONMENT}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 man}{\f0 recognizes the following variables from the shell. +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }\pard\plain \s17\qj\fi-720\li1440\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 USRMAN}{\f0 +\par \tab This variable is required . It points to the manual system root directory. +\par }{\b\f0 PAGER}{\f0 +\par \tab }{\b\f0 man}{\f0 uses }{\b\f0 more}{\pard\plain \s17\qj\fi-720\li1440\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\b\f0 more}}}{\f0 as the default pager. If you wish to use a different pager, }{\b\f0 less}{\pard\plain \s17\qj\fi-720\li1440\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\b\f0 less}}}{\f0 perhaps, then you must set this variable to point to that pager. +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 Compressed Manual Pages and Links}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 If }{\b\f0 man}{\f0 finds a file in the manual that ends in a '}{\b\f0 .l}{\f0 ' suffix, it takes the contents of that file as a 'link' to the actual manpage. This is useful for manpages that describe multiple commands, and prevents having multiple copies of the manpage. +\par +\par Manual pages may be compressed with }{\b\f0 compress}{\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\b\f0 compress}}}{\f0 or }{\b\f0 freeze}{\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\b\f0 freeze}}}{\f0 , in which case the appropriate program is called to uncompress the manual file. +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 SEE ALSO +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 more}{\f0 (1), }{\b\f0 less}{\f0 (1), }{\b\f0 compress}{\f0 (1), }{\b\f0 freeze}{\f0 (1). +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 \sect }\sectd \linex0\endnhere\sectdefaultcl {\headerl \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx4680\tqr\tx9360\adjustright \fs20\cgrid {\fs24 MKDIR(1)\tab Commands and Applications\tab MKDIR(1) +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}{\headerr \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx4680\tqr\tx9360\adjustright \fs20\cgrid {\fs24 MKDIR(1)\tab Commands and Applications\tab MKDIR(1) +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}{\footerr \pard\plain \s16\nowidctlpar\widctlpar\brdrb\brdrs\brdrw30\brsp20 \tqc\tx4320\tqr\tx10080\adjustright \fs20\cgrid {\ul +\par }\pard \s16\qr\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright {\field{\*\fldinst {\cs18\b PAGE }}{\fldrslt {\cs18\b\lang1024 33}}}{ +\par }}\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\b\fs24 NAME}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 mkdir - Makes directories +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 SYNOPSIS}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 mkdir}{\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\b\f0 mkdir}}}{\f0 }{\i\f0 dirname}{\f0 ... +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 DESCRIPTION}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 The }{\b\f0 mkdir}{\f0 command creates subdirectories with the }{\i\f0 dirname}{\f0 s specified. If a file with that }{\i\f0 dirname}{\f0 exists, an error is returned. dirname may be a full pathname, or a partial pathname, in which case the directory is created as a subdirectory of the current directory. +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 mkdir}{\f0 only creates the filename portion of the specified path. If, for instance, you do +\par }\pard\plain \s20\qj\li1440\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f2 mkdir /usr/local/bbs/foo}{\b\f0 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 directory foo will only be created if all of }{\b\f0 /usr}{\f0 , }{\b\f0 local}{\f0 , and }{\b\f0 bbs}{\f0 exist. +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 AUTHOR}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 mkdir}{\f0 was written by James Brookes for GNO/ME. +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\sect }\sectd \linex0\endnhere\sectdefaultcl {\headerl \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx4680\tqr\tx9360\adjustright \fs20\cgrid {\fs24 MORE(1)\tab Commands and Applications\tab MORE(1) +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}{\headerr \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx4680\tqr\tx9360\adjustright \fs20\cgrid {\fs24 MORE(1)\tab Commands and Applications\tab MORE(1) +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}{\footerl \pard\plain \s16\nowidctlpar\widctlpar\brdrb\brdrs\brdrw30\brsp20 \tqc\tx4320\tqr\tx10080\adjustright \fs20\cgrid {\ul +\par }\pard \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright {\field{\*\fldinst {\cs18\b PAGE }}{\fldrslt {\cs18\b\lang1024 34}}}{ +\par }}\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\b\fs24 NAME}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 more - text pager +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 SYNOPSIS}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 more}{\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\b\f0 more}}}{\f0 [ }{\i\f0 file}{\f0 ...] +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 DESCRIPTION}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 more}{\f0 allows the user to view the specified }{\i\f0 file}{\f0 (s) screen by screen or line by line. If no }{\i\f0 file}{\f0 s are specified, standard input is used. +\par +\par Every time }{\b\f0 more}{\f0 has displayed a screen of text, it displays a prompt +\par }\pard\plain \s20\li1440\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f2 - filename (xx%) - +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 indicating the percentage of the file that has been viewed and its filename. If standard input is used, +\par }\pard\plain \s20\li1440\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f2 '\~-\~more\~-\~' +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 is used as the prompt instead. +\par +\par A number of key commands are available at the prompt. +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }\pard\plain \s17\qj\fi-720\li1440\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 q}{\f0 \tab quit viewing the current file, and move to the next file (if any) +\par +\par }{\b\f0 [RETURN]}{\f0 +\par \tab display the next line of the file +\par +\par }{\b\f0 [ESC]}{\f0 \tab abort }{\b\f0 more}{\f0 , including any more files that may have been specified +\par +\par }{\b\f0 [SPACE]}{\f0 +\par }\pard \s17\qj\fi-720\li1440\nowidctlpar\widctlpar\adjustright {\f0 \tab display the next page of the file +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 AUTHOR}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 This version of more was written by Jawaid Bazyar and Derek Taubert. +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 \sect }\sectd \linex0\endnhere\sectdefaultcl {\headerl \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx4680\tqr\tx9360\adjustright \fs20\cgrid {\fs24 PASSWD(1)\tab Commands and Applications\tab PASSWD(1) +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}{\headerr \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx4680\tqr\tx9360\adjustright \fs20\cgrid {\fs24 PASSWD(1)\tab Commands and Applications\tab PASSWD(1) +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright {\f4 +\par }}{\footerr \pard\plain \s16\nowidctlpar\widctlpar\brdrb\brdrs\brdrw30\brsp20 \tqc\tx4320\tqr\tx10080\adjustright \fs20\cgrid {\ul +\par }\pard \s16\qr\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright {\field{\*\fldinst {\cs18\b PAGE }}{\fldrslt {\cs18\b\lang1024 35}}}{ +\par }}\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\b\fs24 NAME}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 passwd - set a user's login password +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\b\fs24 +\par SYNOPSIS}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 passwd}{\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\b\f0 passwd}}}{\f0 [ -}{\b\f0 ?}{\f0 | -}{\b\f0 v}{\f0 ] [ }{\i\f0 username}{\f0 ] +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 DESCRIPTION}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 passwd}{\f0 changes the specified user's password. Only root is allowed to alter passwords other than his own. If the}{\i\f0 username}{\f0 is not given, the user's own login name is assumed. Users other than root must then enter the old password to verify permission to change the password. Finally, the user must type the desired new password twice to insure that no mistakes are made. +\par +\par To cancel }{\b\f0 passwd}{\f0 , type CTRL-@ when asked to enter the new password. +\par +\par The -}{\b\f0 ?}{\f0 flag causes }{\b\f0 passwd}{\f0 to display a brief usage message, and the -}{\b\f0 v}{\f0 flag causes }{\b\f0 passwd}{\f0 to display version information. +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 SEE ALSO}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 login}{\f0 (1) +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 FILES}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 /etc/passwd}{\f0 - contains the password information +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 AUTHOR}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 Eric Shepherd +\par Internet uerics@mcl.mcl.ucsb +\par AOL Sheppy +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 \sect }\sectd \linex0\endnhere\sectdefaultcl {\headerl \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx4680\tqr\tx9360\adjustright \fs20\cgrid {\fs24 PURGE(1)\tab Commands and Applications\tab PURGE(1) +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}{\headerr \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx4680\tqr\tx9360\adjustright \fs20\cgrid {\fs24 PURGE(1)\tab Commands and Applications\tab PURGE(1) +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}{\footerl \pard\plain \s16\nowidctlpar\widctlpar\brdrb\brdrs\brdrw30\brsp20 \tqc\tx4320\tqr\tx10080\adjustright \fs20\cgrid {\ul +\par }\pard \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright {\field{\*\fldinst {\cs18\b PAGE }}{\fldrslt {\cs18\b\lang1024 36}}}{ +\par }}\pard\plain \s21\qj\nowidctlpar\widctlpar\adjustright \b\f4\cgrid {\f0 NAME +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 purge - deallocate purgeable memory handles +\par +\par }\pard\plain \s21\qj\nowidctlpar\widctlpar\adjustright \b\f4\cgrid {\f0 SYNOPSIS +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 purge}{\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\b\f0 purge}}}{\f0 [-v] +\par +\par }\pard\plain \s21\qj\nowidctlpar\widctlpar\adjustright \b\f4\cgrid {\f0 DESCRIPTION +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 This program purges all memory blocks marked purgable. This is very important when using the Orca compilers and shells since certain blocks get left lying around and can (and have!) caused compiler errors. By purging memory before compiles a large percentage of strange compiler errors can be eliminated. After purging, all memory possible is then freed for usage. +\par +\par }\pard\plain \s20\qj\li1440\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 -v gives a verbose listing of each handle being purged and before and after free memory statistics. +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 +\par The problems mentioned above usually occur when a program has over-written one of the ORCA FastFile system's memory handles. Purging clears these handles and forces a reload from disk. +\par }\pard \s17\qj\li720\nowidctlpar\widctlpar\adjustright {\f0 +\par }\pard\plain \s21\qj\nowidctlpar\widctlpar\adjustright \b\f4\cgrid {\f0 BUGS +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 Purging memory when non-shell applications are running could be dangerous. +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 \sect }\sectd \linex0\endnhere\sectdefaultcl {\headerl \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx4680\tqr\tx9360\adjustright \fs20\cgrid {\fs24 RZ(1)\tab Commands and Applications\tab RZ(1) +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}{\headerr \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx4680\tqr\tx9360\adjustright \fs20\cgrid {\fs24 RZ(1)\tab Commands and Applications\tab RZ(1) +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright {\f4 +\par }}\pard\plain \s19\qj\nowidctlpar\widctlpar\adjustright \b\f4\cgrid {\f0 NAME +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 rx, rc, rb, rz - Receive Files and Commands with X/Y/ZMODEM +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 SYNOPSIS}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 rz}{\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\b\f0 rz}}}{\f0 -tv +\par }{\b\f0 rb}{\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\b\f0 rb}}}{\f0 -tv +\par }{\b\f0 rc}{\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\b\f0 rc}}}{\f0 -tv file +\par }{\b\f0 rx}{\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\b\f0 rx}}}{\f0 -tv file +\par }{\b\f0 gz}{\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\b\f0 gz}}}{\f0 file ... [-v] +\par }{\b\f0 rzCOMMAND}{\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \b\v\cgrid {\xe {\b\f0 rzCOMMAND}}}{\f0 +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }\pard\plain \s19\qj\nowidctlpar\widctlpar\adjustright \b\f4\cgrid {\f0 DESCRIPTION +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 This program uses error correcting protocols to receive files over a dial-in serial port from a variety of programs running under many operating systems. It is invoked from a shell prompt manually, or automatically as a result of an "}{\b\f0 sz}{\f0 file ..." command given to the calling program. +\par +\par This is a shareware program copyrighted by Omen Technology INC. +\par +\par }{\b\f0 Rz}{\f0 (Receive ZMODEM}{\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\f0 ZMODEM}}}{\f0 ) receives one or more files with the ZMODEM protocol. Pathnames are supplied by the sending program, and directories are made if necessary (and possible). Normally, the "}{\b\f0 rz}{\f0 " command is automatically issued by the calling ZMODEM program, but defective ZMODEM implementations may require starting }{\b\f0 rz}{\f0 manually. +\par +\par }{\b\f0 Rb}{\f0 receives file(s) with YMODEM}{\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\f0 YMODEM}}}{\f0 , accepting either standard128 byte sectors or 1024 byte sectors (sb }{\b\f0 -k}{\f0 option). The user should determine when the 1024 byte block length actually improves throughput. +\par +\par If True YMODEM™ (Omen Technology trademark) file information (file length, etc.) is received, the file length controls the number of bytes written to the output dataset, and the modify time and file mode (iff non zero) are set accordingly. +\par +\par If True YMODEM file information is not received, slashes in the pathname are changed to underscore, and any trailing period in the pathname is eliminated. This conversion is useful for files received from CP/M and other historical systems. +\par +\par }{\b\f0 Rc}{\f0 receives a single }{\f0\ul file}{\f0 with XMODEM-CRC or XMODEM-1k-CRC protocol. The user should determine when the 1024 byte block length actually improves throughput without causing problems. The user must supply the file name to both sending and receiving programs. Up to 1023 garbage characters may be added to the received file. +\par +\par }{\b\f0 Rx}{\f0 receives a single }{\f0\ul file}{\f0 with XMODEM}{\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\f0 XMODEM}}}{\f0 or XMODEM-1k protocol. The user should determine when the 1024 byte block length actually improves throughput without causing problems. The user must supply the file name to both sending and receiving programs. Up to 1023 garbage characters may be added to the received file. +\par +\par }{\b\f0 Rz}{\f0 may be invoked as }{\b\f0 rzCOMMAND}{\f0 (with an optional leading - as generated by login(1)). For each received file, }{\f0\ul rz}{\f0 will pipe the file to ``COMMAND filename'' where filename is the name of the transmitted file with the file contents as standard input. +\par +\par Each file transfer is acknowledged when COMMAND exits with 0 status. A non zero exit status terminates transfers. +\par +\par A typical use for this form is }{\f0\ul rzmail}{\f0 which calls rmail(1) to post mail to the user specified by the transmitted file name. For example, sending the file "caf" from a PC-DOS system to }{\f0\ul rzmail}{\f0 on a Unix system would result in the contents of the DOS file "caf" being mailed to user "caf". +\par +\par The meanings of the available options are: +\par +\par }\pard \s17\qj\fi-540\li1260\nowidctlpar\widctlpar\adjustright {\b\f0 tim}{\f0 \tab Change timeout to }{\f0\ul tim}{\f0 tenths of seconds. +\par }\pard \s17\qj\fi-540\li1260\nowidctlpar\widctlpar\adjustright {\b\f0 v\tab }{\f0 Verbose causes a list of file names to be appended to /tmp/rzlog . More v's generate more detailed debugging output. +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }\pard\plain \s19\qj\nowidctlpar\widctlpar\adjustright \b\f4\cgrid {\f0 DIAGNOSTICS +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 Exit status is as follows: 0 for successful transfers. 1 if unrecoverable errors are detected. 2 if syntax errors or file access problems are detected. 3 if the program was terminated by a caught interrupt. +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }\pard\plain \s19\qj\nowidctlpar\widctlpar\adjustright \b\f4\cgrid {\f0 SEE ALSO +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 sz}{\f0 (1). +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }\pard\plain \s19\qj\nowidctlpar\widctlpar\adjustright \b\f4\cgrid {\f0 NOTES +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 ZMODEM's support of XOFF/XON flow control allows proper operation in many environments that do not support XMODEM uploads. Unfortunately, not all Unix versions support input flow control. The TTY input buffering on some systems may not adequately buffer long blocks or streaming input at high speed. You should suspect this problem when you can't send data to the Unix system at high speeds using ZMODEM, YMODEM-1k or XMODEM-1k, but YMODEM with 128 byte blocks works properly. +\par +\par If a program that does not properly implement the specified file transfer protocol causes }{\b\f0 rz}{\f0 to "hang" the port after a failed transfer, either wait for }{\b\f0 rz}{\f0 to time out or keyboard a dozen Ctrl-X characters. +\par +\par Many programs claiming to support YMODEM only support XMODEM with 1k blocks, and they often don't get that quite right. +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 BUGS}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 This version of }{\b\f0 rz}{\f0 does not support some ZMODEM features. +\par The ASCII option's CR/LF to NL translation merely deletes CR's. +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 ZMODEM CAPABILITIES}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 Rz}{\f0 supports ZMODEM command execution (zcommand), incoming ZMODEM binary (-b), ASCII (-a), newer(-n), newer+longer(-N), protect (-p), Crash Recovery(-r), clobber (-y), match+clobber (-Y), compression(-Z), and append (-+) requests. Other options sent by the sender are ignored. The default is protect (-p) and binary (-b). +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 FILES}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 /tmp/rzlog stores debugging output generated with -vv option +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 \sect }\sectd \linex0\endnhere\sectdefaultcl {\headerl \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx4680\tqr\tx9360\adjustright \fs20\cgrid {\fs24 SCRIPT(1)\tab Commands and Applications\tab SCRIPT(1) +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}{\headerr \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx4680\tqr\tx9360\adjustright \fs20\cgrid {\fs24 SCRIPT(1)\tab Commands and Applications\tab SCRIPT(1) +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright {\f4 +\par }}{\footerl \pard\plain \s16\nowidctlpar\widctlpar\brdrb\brdrs\brdrw30\brsp20 \tqc\tx4320\tqr\tx10080\adjustright \fs20\cgrid {\ul +\par }\pard \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright {\field{\*\fldinst {\cs18\b PAGE }}{\fldrslt {\cs18\b\lang1024 40}}}{ +\par }}\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\b\fs24 NAME}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 script - make typescript of a terminal session +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }\pard \nowidctlpar\widctlpar\adjustright {\b\fs24 SYNOPSIS}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 script}{\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\b\f0 script}}}{\f0 [ -}{\b\f0 a}{\f0 ] [ }{\i\f0 filename}{\f0 ] +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 DESCRIPTION}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 script}{\f0 makes a typescript of everything printed on your terminal. The typescript is written to }{\i\f0 filename}{\f0 , or appended to }{\i\f0 filename}{\f0 if the -}{\b\f0 a}{\f0 option is given. It can be sent to the line printer later with }{\b\f0 lpr}{\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\b\f0 lpr}}}{\f0 (1). If no file name is given, the typescript is saved in the file typescript . +\par +\par The script ends when the forked shell exits. +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 OPTIONS}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 -}{\b\f0 a}{\f0 \tab Append the script to the specified file instead of writing over it. +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 SEE ALSO}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 lpr}{\f0 (1), }{\b\f0 pty}{\f0 (4) +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 BUGS}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 script places}{\f0 }{\i\f0 everything}{\f0 in the log file. This is not what the naive user expects. +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\sect }\sectd \linex0\endnhere\sectdefaultcl {\headerl \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx4680\tqr\tx9360\adjustright \fs20\cgrid {\fs24 SLEEP(1)\tab Commands and Applications\tab SLEEP(1) +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}{\headerr \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx4680\tqr\tx9360\adjustright \fs20\cgrid {\fs24 SLEEP(1)\tab Commands and Applications\tab SLEEP(1) +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright {\f4 +\par }}{\footerr \pard\plain \s16\nowidctlpar\widctlpar\brdrb\brdrs\brdrw30\brsp20 \tqc\tx4320\tqr\tx10080\adjustright \fs20\cgrid {\ul +\par }\pard \s16\qr\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright {\field{\*\fldinst {\cs18\b PAGE }}{\fldrslt {\cs18\b\lang1024 41}}}{ +\par }}\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\b\fs24 NAME}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 sleep - suspend execution for an interval +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 SYNOPSIS}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 sleep}{\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\b\f0 sleep}}}{\f0 }{\i\f0 time}{\f0 +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\b\fs24 +\par DESCRIPTION}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 Sleep}{\f0 suspends execution for }{\i\f0 time}{\f0 seconds. It is used to execute a command after a certain amount of time as in a script: +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }\pard\plain \s20\qj\li1440\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 sleep 105 +\par command +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 SEE ALSO}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 alarm}{\f0 (3C), }{\b\f0 sleep}{\f0 (3) +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 BUGS}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\i\f0 Time}{\f0 must be less than 2,147,483,647 seconds. +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 \sect }\sectd \linex0\endnhere\sectdefaultcl {\headerl \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx4680\tqr\tx9360\adjustright \fs20\cgrid {\f4\fs24 SPLIT(1)\tab Commands and Applications\tab SPLIT(1) +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\tqr\tx10080\adjustright {\f4 +\par }}{\headerr \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx4680\tqr\tx9360\adjustright \fs20\cgrid {\f4\fs24 SPLIT(1)\tab Commands and Applications\tab SPLIT(1) +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright {\f4 +\par }}{\footerl \pard\plain \s16\nowidctlpar\widctlpar\brdrb\brdrs\brdrw30\brsp20 \tqc\tx4500\tqr\tx10080\adjustright \fs20\cgrid {\ul +\par }\pard \s16\nowidctlpar\widctlpar\tqc\tx4500\tqr\tx10080\adjustright {\field{\*\fldinst {\cs18\b PAGE }}{\fldrslt {\cs18\b\lang1024 42}}}{\ul +\par }}\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\b\fs24 NAME}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 split - split a file into pieces +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 SYNOPSIS}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 split}{\f0 }{\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\b\f0 split }}}{\f0 [ - }{\i\f0 number}{\f0 ] [ }{\i\f0 infile}{\f0 [ }{\i\f0 outfile}{\f0 ] ] +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 DESCRIPTION}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 split}{\f0 reads }{\i\f0 infile}{\f0 and writes it in }{\i\f0 number}{\f0 -line pieces (default 1000) onto a set of output files (as many files as necessary). The name of the first output file is }{\i\f0 outfile}{\f0 with }{\b\f0 aa}{\f0 appended, the second file is }{\b\f0 outfile}{\f0 ab , and so on lexicographically. +\par +\par If no }{\i\f0 outfile}{\f0 is given, }{\b\f0 x}{\f0 is used as default (output files will be called }{\b\f0 xaa}{\f0 , }{\b\f0 xab}{\f0 , etc.). +\par +\par If no }{\i\f0 infile}{\f0 is given, or if `}{\b\f0 -}{\f0 ' is given in its stead, then the standard input file is used. +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 OPTIONS}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 - number\tab Number of lines in each piece. +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 \tab +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 \sect }\sectd \linex0\endnhere\sectdefaultcl {\headerl \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx4680\tqr\tx9360\adjustright \fs20\cgrid {\fs24 STTY(1)\tab Commands and Applications\tab STTY(1) +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}{\headerr \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx4680\tqr\tx9360\adjustright \fs20\cgrid {\fs24 STTY(1)\tab Commands and Applications\tab STTY(1) +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}{\footerr \pard\plain \s16\nowidctlpar\widctlpar\brdrb\brdrs\brdrw30\brsp20 \tqc\tx4320\tqr\tx10080\adjustright \fs20\cgrid {\ul +\par }\pard \s16\qr\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright {\field{\*\fldinst {\cs18\b PAGE }}{\fldrslt {\cs18\b\lang1024 47}}}{ +\par }}\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\b\fs24 NAME}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 stty - set and view terminal options and parameters +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 SYNOPSIS}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 stty}{\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\b\f0 stty}}}{\f0 [ }{\i\f0 option}{\f0 ... ] [ }{\i\f0 charoption c}{\b\f0 }{\f0 ... ] +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 DESCRIPTION}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 If no options are specified, }{\b\f0 stty}{\f0 prints out all the current terminal option settings. }{\i\f0 options}{\f0 represent boolean flags in the terminal parameters, and are as follows: +\par }\pard \s17\qj\li720\nowidctlpar\widctlpar\adjustright {\f0 +\par }\pard \s17\qj\li720\nowidctlpar\widctlpar\tx2160\adjustright {\b\f0 raw}{\f0 \tab turns on RAW mode (no character or line processing) +\par }\pard \s17\qj\li720\nowidctlpar\widctlpar\tx2160\adjustright {\b\f0 -raw}{\f0 \tab turns off RAW mode +\par }{\b\f0 ehco}{\f0 \tab if in CBREAK or COOKED mode, echoes input characters +\par }{\b\f0 -echo}{\f0 \tab echo mode off +\par }{\b\f0 cbreak\tab }{\f0 turns on CBREAK mode (single character processing) +\par }{\b\f0 -cbreak\tab }{\f0 turns off CBREAK mode (line-at-a-time processing) +\par }\pard \s17\qj\li720\nowidctlpar\widctlpar\adjustright {\f0 +\par }{\i\f0 Charoptions}{\f0 represent variables in the terminal interface, and are as follows: +\par +\par }\pard \s17\qj\li720\nowidctlpar\widctlpar\tx2160\adjustright {\b\f0 intr c}{\f0 \tab sets the interrupt character (normally ^C) +\par }\pard \s17\qj\li720\nowidctlpar\widctlpar\tx2160\adjustright {\b\f0 start c}{\f0 \tab sets the start character (normally ^Q) +\par }{\b\f0 stop c}{\f0 \tab sets the stop character (normally ^S) +\par }{\b\f0 eof c}{\f0 \tab sets the eof character (normally ^D) +\par }{\b\f0 susp c}{\f0 \tab sets the suspend character (normally ^Z)}{\b\f0 +\par }\pard \s17\qj\li720\nowidctlpar\widctlpar\adjustright {\f0 +\par }{\b\f0 c}{\f0 may be defined either as an octal number such as 003, or in control character format (^C). +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 SEE ALSO +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 tty}{\f0 (4) +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 \sect }\sectd \linex0\endnhere\sectdefaultcl {\headerl \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx4680\tqr\tx9360\adjustright \fs20\cgrid {\fs24 SUM(1)\tab Commands and Applications\tab SUM(1) +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}{\headerr \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx4680\tqr\tx9360\adjustright \fs20\cgrid {\fs24 SUM(1)\tab Commands and Applications\tab SUM(1) +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}{\footerl \pard\plain \s16\nowidctlpar\widctlpar\brdrb\brdrs\brdrw30\brsp20 \tqc\tx4320\tqr\tx10080\adjustright \fs20\cgrid {\ul +\par }\pard \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright {\field{\*\fldinst {\cs18\b PAGE }}{\fldrslt {\cs18\b\lang1024 48}}}{ +\par }}\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\b NAME}{ +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {sum - print checksum and block count of a file +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid { +\par }{\b SYNOPSIS}{ +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b sum}{\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \v\f4\cgrid {\xe {\v }{\b sum}}}{ [ }{\i file}{ ] +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid { +\par }{\b DESCRIPTION}{ +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b Sum}{ calculates and prints a 16-bit checksum for the named file, and also prints the number of blocks in the file. Stdin is used if no file names are given. }{\b Sum}{ is typically used to look for corrupted files, or to validate a file communicated over some transmission line. +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid { +\par }{\b DIAGNOSTICS}{ +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {``Read error'' is indistinguishable from end of file on most devices; check the block count. +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid { +\par }{\b SEE ALSO}{ +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b wc}{(1). +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid { +\par }{\b NOTE}{ +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b Sum}{ is pretty slow on large files when running on the GS. If anyone has a faster algorithm for computing the 16-bit checksum, I'd really appreciate seeing it. +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid { +\par }{\b AUTHOR}{ +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {Marek Pawlowski - marekp@pnet91.cts.com +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid { +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 \sect }\sectd \linex0\endnhere\sectdefaultcl {\headerl \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx4680\tqr\tx9360\adjustright \fs20\cgrid {\fs24 SZ(1)\tab Commands and Applications\tab SZ(1) +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright {\f4 +\par }}{\headerr \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx4680\tqr\tx9360\adjustright \fs20\cgrid {\fs24 SZ(1)\tab Commands and Applications\tab SZ(1) +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\b\fs24 NAME}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 sx, sb, sz - Send Files with ZMODEM, YMODEM, or XMODEM +\par zcommand, zcommandi - Send COmmands with ZMODEM +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 SYNOPSIS}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 sz}{\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\b\f0 sz}}}{\f0 [-+abdefkLlNnopTtuvyYZ] file ... +\par }{\b\f0 sb}{\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\b\f0 sb}}}{\f0 [-dfktuv] file ... +\par }{\b\f0 sx}{\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\b\f0 sx}}}{\f0 [-ktuv] file +\par }{\b\f0 zcommand}{\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\b\f0 zcommand}}}{\f0 [-otv] COMMAND +\par }{\b\f0 zcommandi}{\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\b\f0 zcommandi}}}{\f0 [-otv] COMMAND +\par }{\b\f0 sz}{\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\b\f0 sz}}}{\f0 -TT +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 DESCRIPTION}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 Sz}{\f0 (send ZMODEM}{\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\f0 ZMODEM}}}{\f0 ) uses the ZMODEM, YMODEM}{\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\f0 YMODEM}}}{\f0 or XMODEM}{\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\f0 XMODEM}}}{\f0 error correcting protocol to send one or more files over a dial-in serial port to a variety of programs running under PC-DOS, CP/M, Unix, VMS, and other op\-erating systems. +\par +\par This is a shareware program copyrighted by Omen Technology INC. +\par +\par }{\b\f0 Sz}{\f0 sends one or more files with ZMODEM protocol. +\par +\par ZMODEM greatly simplifies file transfers compared to XMODEM. In addition to a friendly user interface, ZMODEM provides Personal Computer and other users an efficient, accurate, and robust file transfer method. +\par +\par ZMODEM provides complete END-TO-END data integrity between application programs. ZMODEM's 32 bit CRC catches errors that sneak into even the most advanced networks. +\par +\par Advanced file management features include AutoDownload (Automatic file Download initiated without user inter\-vention), Display of individual and total file lengths and transmission time estimates, Crash Recovery, selective file transfers, and preservation of exact file date and length. +\par +\par The -y option instructs the receiver to open the file for writing unconditionally. The -a option causes the receiver to convert Unix newlines to PC-DOS carriage returns and linefeeds. +\par +\par +\par }{\b\f0 Sb}{\f0 sends one or more files with YMODEM or ZMODEM protocol. The initial ZMODEM initialization is not sent. When requested by the receiver, }{\b\f0 sb}{\f0 supports YMODEM-g with "cbreak" tty mode, XON/XOFF flow control, and interrupt character set to CAN (^X). YMODEM-g increases YMODEM throughput over error free channels (direct connection, X.PC, etc.) by disabling error recovery. +\par +\par On Unix systems, additional information about the file is transmitted. If the receiving program uses this informa\-tion, the transmitted file length controls the exact number of bytes written to the output dataset, and the modify time and file mode are set accordingly. +\par +\par +\par }{\b\f0 Sx}{\f0 sends a single file with XMODEM or XMODEM-1k protocol (sometimes incorrectly called "ymodem"). The user must supply the file name to both sending and receiving programs. +\par +\par If }{\b\f0 sz}{\f0 is invoked with $SHELL set and if that variable contains the string rsh or rksh (restricted shell), sz operates in restricted mode. Restricted mode restricts pathnames to the current directory and PUBDIR (usually /usr/spool/uucppublic) and/or subdirectories thereof. +\par +\par +\par The fourth form sends a single COMMAND to a ZMODEM receiver for execution. Zcommand exits with the COMMAND return value. If COMMAND includes spaces or characters special to the shell, it must be quoted. +\par +\par +\par The fifth form sends a single COMMAND to a ZMODEM receiver for execution. Zcommandi exits as soon as the receiver has correctly received the command, before it is executed. +\par +\par +\par }\pard \s17\qj\li720\nowidctlpar\widctlpar\adjustright {\f0 The sixth form (sz -TT) attempts to output all 256 code combinations to the terminal. If you are having difficulty sending files, this command lets you see which character codes are being eaten by the operating system. +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 The meanings of the available options are: +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }\pard \qj\fi-1260\li1980\nowidctlpar\widctlpar\adjustright {\i\fs24 +}{\fs24 \tab Instruct the receiver to append transmitted data to an existing file (ZMODEM only). +\par }{\i\fs24 a}{\fs24 \tab Instruct the ZMODEM receiver to convert text file format as appropriate for the receiving system. Valid only for ZMODEM. +\par }{\i\fs24 b}{\fs24 (Zmodem)\tab Binary override: transfer file without any translation. +\par }{\i\fs24 c}{\fs24 \tab Instruct the receiver to change the pathname if the destination file exists. +\par }{\i\fs24 d}{\fs24 \tab Change all instances of "." to "/" in the transmitted pathname. Thus, C.omenB0000 (which is unacceptable to MSDOS or CP/M) is transmitted as C/omenB0000. If the resultant filename has more than 8 characters in the stem, a "." is inserted to allow a total of eleven. +\par }{\i\fs24 e}{\fs24 \tab Escape all control characters; normally only XON, XOFF, DLE, CR-@-CR, and Ctrl-X are escaped. +\par }{\i\fs24 f}{\fs24 \tab Send Full pathname. Normally directory prefixes are stripped from the transmitted filename. +\par }{\i\fs24 k}{\fs24 (X/Ymodem)\tab Send files using 1024 byte blocks rather than the default 128 byte blocks. 1024 byte packets speed file transfers at high bit rates. (ZMODEM streams the data for the best possible throughput.) +\par }{\i\fs24 L N}{\fs24 \tab Use ZMODEM sub-packets of length N. A larger N (32 <= N <= 1024) gives slightly higher hroughput, a smaller N speeds error recovery. The default is 128 below 300 baud, 256 above 300 baud, or 1024 above 2400 baud. +\par }{\i\fs24 l N}{\fs24 \tab Wait for\tab the receiver to acknowledge correct data every N (32 <= N <= 1024) characters. This may be used to avoid network overrun when XOFF flow control is lacking. +\par }{\i\fs24 n}{\fs24 (Zmodem)\tab Send each file if destination file does not exist. Overwrite destination file if source file is newer than the destination file. +\par }{\i\fs24 N}{\fs24 (Zmodem)\tab Send each file if destination file does not exist. Overwrite destination file if source file is newer or longer than the destination file. +\par }{\i\fs24 o}{\fs24 (Zmodem)\tab Disable automatic selection of 32 bit CRC. +\par }\pard \qj\fi-1260\li1980\nowidctlpar\widctlpar\adjustright {\i\fs24 p}{\fs24 (Zmodem)\tab Protect existing destination files by skipping transfer if the destination file exists. +\par }{\i\fs24 r}{\fs24 (Zmodem)\tab Resume interrupted file transfer. If the source file is longer than the destination file, the transfer commences at the offset in the source file that equals the length of the destination file. +\par }{\i\fs24 rr }{\fs24 \tab As above, but compares the files (the portion common to sender and reciever) before resuming the transfer. +\par }{\i\fs24 t}{\fs24 tim\tab Change timeout to tim tenths of seconds. +\par }{\i\fs24 u}{\fs24 \tab Unlink the file after successful transmission. +\par }{\i\fs24 w}{\fs24 N \tab Limit the transmit window size to N bytes (ZMODEM). +\par }\pard\plain \s23\qj\fi-1260\li1980\nowidctlpar\widctlpar\adjustright \f4\cgrid {\i\f0 v}{\f0 \tab Verbose causes a list of file names to be appended to /tmp/szlog. More v's generate more output. +\par }{\i\f0 y}{\f0 \tab Instruct a ZMODEM receiving program to overwrite any existing file with the same name. +\par }{\i\f0 Y}{\f0 \tab Instruct a ZMODEM receiving program to overwrite any existing file with the same name, and to skip any source files that do have a file with the same pathname on the destination system. +\par }{\i\f0 Z}{\f0 \tab Use ZMODEM file compression to speed file transfer. +\par +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\b\fs24 DIAGNOSTICS}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 Exit status is as follows: 0 for successful transfers. 1 if unrecoverable errors are detected. 2 if syntax errors or file access problems are detected. 3 if the program was terminated by a caught interrupt. +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 EXAMPLE}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0\ul ZMODEM File Transfer (GNO to remote system) +\par }{\f2 % sz -a *.c}{\f0 +\par This single command transfers all .c files in the current directory with conversion (-a) to end of line conventions appropriate to the receiving environment. With ZMODEM AutoDownload enabled, will automatically recieve the files after performing a security check. +\par +\par }{\f2 % sz -Yan *.c *.h +\par }{\f0 Send only the .c and .h files that exist on both systems, and are newer on the sending system than the correspond\-ing version on the receiving system, converting Apple to UNIX text format. +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 SEE ALSO}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 rz(1). +\par +\par }\pard \s17\qj\li720\nowidctlpar\widctlpar\adjustright {\f0 Compile time options required for various operating systems are described in the source file. +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 FILES}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 32 bit CRC code courtesy Gary\tab S. Brown. +\par +\par sz.c, crctab.c, rbsb.c, zm.c, zmr.c, zmodem.h Unix source files +\par +\par /tmp/szlog stores debugging output (sz -vv) +\par +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\b\fs24 TESTING FEATURE}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 The command "sz -T file" exercises the Attn sequence error recovery by commanding errors with unterminated packets. The receiving program should complain five times about binary data packets being too long. Each time sz is interrupted, it should send a ZDATA header followed by another defective packet. If the receiver does not detect five long data packets, the Attn sequence is not interrupting the sender, and the Myattn string in sz.c must be modified. +\par +\par After 5 packets, sz stops the "transfer" and prints the total number of characters "sent" (Tcount). The difference between Tcount and 5120 represents the number of characters stored in various buffers when the Attn sequence is generated. +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 NOTES}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 When using buffered modems at high speed, particular attention must be paid to flow control. The modem and Unix must agree on the flow control method. Sz on USG (SYS III/V) systems uses XON/XOFF flow control. If flow control cannot be properly set up, Try a "-w 2048" option to enforce protocol level flow control. Experiment with different window sizes for best results. +\par +\par If a program that does not properly implement the specified file transfer protocol causes sb to "hang" the port after a failed transfer, either wait for sb to time out or type a dozen Ctrl-X characters. +\par +\par Many programs claiming to support YMODEM only support XMODEM with 1k blocks, and they often don't get that quite right. XMODEM transfers add up to 127 garbage bytes per file. XMODEM-1k and YMODEM-1k trans\-fers use 128 byte blocks to avoid extra padding. +\par +\par YMODEM programs use the file length transmitted at the beginning of the transfer to prune the file to the correct length; this may cause problems with source files that grow during the course of the transfer. This problem does not pertain to ZMODEM transfers, which preserve the exact file length unconditionally. +\par +\par Most ZMODEM options are merely passed to the receiving program; some programs do not implement all of these options. +\par +\par Circular buffering and a ZMODEM sliding window should be used when input is from pipes instead of acknowl\-edging frames each 1024 bytes. If no files can be opened, sz sends a ZMODEM command to echo a suitable complaint; perhaps it should check for the presence of at least one accessible file before getting hot and bothered. +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 BUGS}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 On at least one BSD system, sz would abnormally end if it got within a few kilobytes of the end of file. Using the "-w 8192" flag fixed the problem. The real cause is unknown, perhaps a bug in the kernel TTY output routines. +\par +\par The test mode leaves a zero length file on the receiving system. +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 GNO/ME}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 The usual manner of invoking sz to send files from a IIgs is as follows: +\par +\par Connect to the other computer with a term program such as TelCom GS +\par +\par Start the X/Y/Zmodem receive on the other side +\par +\par Get/Quit back to the GNO Shell +\par +\par Type: +\par }\pard \s17\li720\nowidctlpar\widctlpar\adjustright {\f2 sz -v -v -b filename1 filename2 .. <.ttya >.ttyb}{\f0 +\par }\pard \s17\qj\li720\nowidctlpar\widctlpar\adjustright {\f0 +\par }\pard \s17\qj\li720\nowidctlpar\widctlpar\adjustright {\f0 You may put this operation in the background of course. Tests have shown no data loss up to 9600 baud in back\-ground operation. +\par }\pard \s17\qj\li720\nowidctlpar\widctlpar\adjustright {\f0 +\par The -b option ensures binary mode. You must use this if you're sending a ShrinkIt archive or other binary file. For plain text files you can leave off the -b. +\par +\par }{\f0 \sect }\sectd \linex0\endnhere\sectdefaultcl {\headerl \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx4680\tqr\tx9360\adjustright \fs20\cgrid {\f4\fs24 TAR}{\f4\fs24 (1)\tab Commands and Applications\tab T}{\f4\fs24 AR}{\f4\fs24 (1) +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\tqr\tx10080\adjustright {\f4 +\par }}{\headerr \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx4680\tqr\tx9360\adjustright \fs20\cgrid {\f4\fs24 TAR}{\f4\fs24 (1)\tab Commands and Applications\tab T}{\f4\fs24 AR}{\f4\fs24 (1) +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright {\f4 +\par }}{\footerl \pard\plain \s16\nowidctlpar\widctlpar\tqc\tx4500\tqr\tx10080\adjustright \fs20\cgrid {\ul \tab \tab }{ +\par }\pard \s16\nowidctlpar\widctlpar\tqc\tx4500\tqr\tx10080\adjustright {\chpgn }{\ul +\par }}{\footerr \pard\plain \s16\nowidctlpar\widctlpar\brdrb\brdrs\brdrw30\brsp20 \tqc\tx5220\tqr\tx10080\adjustright \fs20\cgrid {\ul +\par }\pard \s16\qr\nowidctlpar\widctlpar\tqc\tx5220\tqr\tx10080\adjustright {\field{\*\fldinst {\cs18\b PAGE }}{\fldrslt {\cs18\b\lang1024 49}}}{ +\par }}\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\b\fs24 NAME}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 tar - extract and view tape archives +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 SYNOPSIS}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 tar}{\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\b\f0 tar}}}{\f0 [-]\{}{\i\f0 x}{\f0 |}{\i\f0 t}{\f0 \}f[}{\i\f0 v}{\f0 ] }{\i\f0 archive}{\f0 +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 DESCRIPTION}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 tar}{\f0 lists the contents of and extracts files from UNIX tape archives (*.tar files). +\par +\par Traditionally, }{\b\f0 tar}{\f0 does not require the normal '-' character to denote its arguments. The option flags are as follows: +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 -}{\i\f0 x}{\f0 \tab Extract files from the archive +\par -}{\i\f0 v}{\f0 \tab Verbose mode (tell what tar is doing) +\par -}{\i\f0 t}{\f0 \tab Tell mode (list files in archive) +\par -}{\i\f0 f}{\f0 \tab Use a file on disk instead of a tape +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 Since the standard IIGS filesystem is not as flexible, filename-wise, as UNIX filesystems, some pre-processing is performed on filenames created when an archive is extracted. +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }\pard \qj\li720\nowidctlpar\widctlpar\adjustright {\fs24 \bullet If a tar filename contains a double-/ (possible under UNIX if an archive was created by specifying a directory with a trailing slash), tar converts it to a single /. +\par }\pard \qj\li720\ri1800\nowidctlpar\widctlpar\adjustright {\fs24 +\par \bullet If a filename contains non-alpha numeric characters, they are converted to periods ('.'). +\par }\pard \qj\li720\nowidctlpar\widctlpar\adjustright {\fs24 +\par }{\b\fs24 tar}{\fs24 does not maintain the file protection bits from UNIX, nor does it maintain the creation and modification dates. +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\b\fs24 +\par }\pard \nowidctlpar\widctlpar\adjustright {\b\fs24 BUGS}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 Does not create .tar archives +\par Does not work with raw devices, only files +\par Does not allow user to specify which files to extract from archive +\par tar should use the GS/OS JudgeName call. +\par The -x and -t options should be exclusive, but are not. +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\f4 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 \sect }\sectd \linex0\endnhere\sectdefaultcl {\headerl \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx4680\tqr\tx9360\adjustright \fs20\cgrid {\f4\fs24 TEE(1)\tab Commands and Applications\tab TEE(1) +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\tqr\tx10080\adjustright {\f4 +\par }}{\headerr \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx4680\tqr\tx9360\adjustright \fs20\cgrid {\fs24 TEE(1)\tab Commands and Applications\tab TEE(1) +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright {\f4 +\par }}{\footerl \pard\plain \s16\nowidctlpar\widctlpar\brdrb\brdrs\brdrw30\brsp20 \tqc\tx4500\tqr\tx10080\adjustright \fs20\cgrid {\ul +\par }\pard \s16\nowidctlpar\widctlpar\tqc\tx4500\tqr\tx10080\adjustright {\field{\*\fldinst {\cs18\b PAGE }}{\fldrslt {\cs18\b\lang1024 50}}}{\ul +\par }}{\footerr \pard\plain \s16\nowidctlpar\widctlpar\tqc\tx4500\tqr\tx10080\adjustright \fs20\cgrid {\ul \tab \tab }{ +\par }\pard \s16\nowidctlpar\widctlpar\tqc\tx5220\tqr\tx10080\adjustright {\tab \tab \chpgn +\par }}\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\b\fs24 NAME}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 tee - Pipe }{\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\f0 Pipe }}}{\f0 fitting. +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 SYNOPSIS}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 tee}{\f0 }{\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\b\f0 tee }}}{\f0 [ -}{\b\f0 ai}{\f0 ] [ }{\i\f0 file}{\f0 ...] +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 DESCRIPTION}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 The }{\b\f0 tee}{\f0 utility copies standard input to standard output, making a copy in zero or more files. The output is unbuffered. +\par +\par The following options are available: +\par +\par }\pard \s17\qj\fi-720\li1440\nowidctlpar\widctlpar\adjustright {\f0 -}{\b\f0 a}{\f0 \tab Append the output to the files rather than overwriting them. +\par }\pard \s17\qj\fi-720\li1440\nowidctlpar\widctlpar\adjustright {\f0 +\par -}{\b\f0 i}{\f0 \tab Ignore the }{\b\f0 SIGINT}{\f0 signal. +\par +\par The following operands are available: +\par +\par }{\i\f0 file}{\f0 \tab A pathname of an output file . +\par }\pard \s17\qj\li720\nowidctlpar\widctlpar\adjustright {\f0 +\par The }{\b\f0 tee}{\f0 utility takes the default action for all signals, except in the event of the -}{\b\f0 i}{\f0 option. +\par +\par The }{\b\f0 tee}{\f0 utility exits 0 on success, and >0 if an error occurs. +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 STANDARDS}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 The }{\b\f0 tee}{\f0 function is expected to be POSIX p1003.2 compatible. +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 SEE ALSO +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\i\f0 GNO/Shell User's Manual }{\f0 , }{\b\f0 signal}{\f0 (2) +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 \sect }\sectd \linex0\endnhere\sectdefaultcl {\headerl \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx4680\tqr\tx9360\adjustright \fs20\cgrid {\f4\fs24 TIME(1)\tab Commands and Applications\tab TIME(1) +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\tqr\tx10080\adjustright {\f4 +\par }}{\headerr \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx4680\tqr\tx9360\adjustright \fs20\cgrid {\f4\fs24 TIME(1)\tab Commands and Applications\tab TIME(1) +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright {\f4 +\par }}{\footerl \pard\plain \s16\nowidctlpar\widctlpar\tqc\tx4500\tqr\tx10080\adjustright \fs20\cgrid {\ul \tab \tab }{ +\par }\pard \s16\nowidctlpar\widctlpar\tqc\tx4500\tqr\tx10080\adjustright {\chpgn +\par }}{\footerr \pard\plain \s16\nowidctlpar\widctlpar\brdrb\brdrs\brdrw30\brsp20 \tqc\tx5220\tqr\tx10080\adjustright \fs20\cgrid {\ul +\par }\pard \s16\qr\nowidctlpar\widctlpar\tqc\tx5220\tqr\tx10080\adjustright {\field{\*\fldinst {\cs18\b PAGE }}{\fldrslt {\cs18\b\lang1024 51}}}{ +\par }}\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\b\fs24 NAME}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 time - time a command +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 SYNOPSIS}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 time}{\f0 }{\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\b\f0 time }}}{\i\f0 command}{\f0 +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 DESCRIPTION}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 The }{\b\f0 time}{\f0 command lets the specified }{\b\f0 command}{\f0 execute and then outputs the amount of elapsed real time, the time spent in the operating system, and the time spent in execution of the command. Times are reported in seconds and are written to standard error. +\par +\par The }{\b\f0 time}{\f0 command can be used to cause a command to be timed no matter how much +\par CPU time it takes. For example: +\par +\par +\par }\pard \s17\li720\nowidctlpar\widctlpar\adjustright {\f2 % /bin/time cp /etc/rc /usr/bill/rc +\par }\pard \s17\li720\nowidctlpar\widctlpar\adjustright {\f2 0.1 real 0.0 user 0.0 sys +\par +\par % /bin/time nroff sample1 > sample1.nroff +\par }\pard \s17\li720\nowidctlpar\widctlpar\adjustright {\f2 3.6 real 2.4 user 1.2 sys}{\f0 +\par }\pard \s17\qj\li720\nowidctlpar\widctlpar\adjustright {\f0 +\par This example indicates that the }{\b\f0 cp}{\f0 command used negligible amounts of user ( }{\i\f0 user}{\f0 ) and system time ( }{\i\f0 sys}{\f0 ), and had an elapsed time ( }{\i\f0 real}{\f0 ) of 1/10 second (0.1). The }{\b\f0 nroff}{\f0 command used 2.4 seconds of user time and 1.2 seconds of system time, and required 3.6 seconds of elapsed time. +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }\pard \nowidctlpar\widctlpar\adjustright {\b\fs24 RESTRICTIONS}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 Times are measured to an accuracy of 1/60 second. Thus, the sum of the user and system times can be larger than the elapsed time, but this isn't likely. +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\sect }\sectd \linex0\endnhere\sectdefaultcl {\headerl \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx4680\tqr\tx9360\adjustright \fs20\cgrid {\fs24 TR(1)\tab Commands and Applications\tab TR(1) +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}{\headerr \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx4680\tqr\tx9360\adjustright \fs20\cgrid {\fs24 TR(1)\tab Commands and Applications\tab TR(1) +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}{\footerl \pard\plain \s16\nowidctlpar\widctlpar\brdrb\brdrs\brdrw30\brsp20 \tqc\tx4320\tqr\tx10080\adjustright \fs20\cgrid {\ul +\par }\pard \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright {\field{\*\fldinst {\cs18\b PAGE }}{\fldrslt {\cs18\b\lang1024 52}}}{ +\par }}{\footerr \pard\plain \s16\nowidctlpar\widctlpar\brdrb\brdrs\brdrw30\brsp20 \tqc\tx4320\tqr\tx10080\adjustright \fs20\cgrid {\ul +\par }\pard \s16\qr\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright {\field{\*\fldinst {\cs18\b PAGE }}{\fldrslt {\cs18\b\lang1024 53}}}{ +\par }\pard \s16\nowidctlpar\widctlpar\tqc\tx5220\tqr\tx10260\adjustright { +\par }}\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\b\fs24 NAME}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 tr - translate characters +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 SYNOPSIS}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 tr}{\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\b\f0 tr}}}{\f0 [ -}{\b\f0 cds}{\f0 ] [ }{\i\f0 string1}{\f0 [ }{\i\f0 string2}{\f0 ] ] +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 DESCRIPTION}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 tr}{\f0 copies the standard input to the standard output with substitution or deletion of selected characters. The arguments }{\i\f0 string1}{\f0 and }{\i\f0 string2}{\f0 are considered sets of characters. Any input character found in }{\i\f0 string1}{\f0 is mapped into the character in the corresponding position within }{\i\f0 string2}{\f0 . When }{\i\f0 string2}{\f0 is short, it is padded to the length of }{\i\f0 string1}{\f0 by duplicating its last character. +\par +\par In either string the notation '}{\b\f0 a - b' }{\f0 denotes a range of characters from }{\b\f0 a}{\f0 to }{\b\f0 b}{\f0 in increasing ASCII order. The character \\, followed by 1, 2 or 3 octal digits stands for the character whose ASCII code is given by those digits. As with the shell, the escape character \\, followed by any other character, escapes any special meaning for that character. +\par +\par When }{\i\f0 string2}{\f0 is short, characters in }{\i\f0 string1}{\f0 with no corresponding character in }{\i\f0 string2}{\f0 are not translated. +\par +\par In either string the following abbreviation conventions introduce ranges of characters or repeated characters into the strings. +\par +\par }\pard \s17\qj\fi-720\li1440\nowidctlpar\widctlpar\adjustright {\b\f0 [ a - z ] +\par }\pard \s17\qj\fi-720\li1440\nowidctlpar\widctlpar\adjustright {\f0 \tab Stands for the string of characters whose ASCII codes run from character }{\b\f0 a}{\f0 to character }{\b\f0 z}{\f0 , inclusive. +\par +\par }{\b\f0 [ a * n ]}{\f0 +\par \tab Stands for n repetitions of }{\b\f0 a}{\f0 . If the first digit of }{\b\f0 n}{\f0 is 0, }{\b\f0 n}{\f0 is considered octal; otherwise, }{\b\f0 n}{\f0 is taken to be decimal. A zero or missing }{\b\f0 n}{\f0 is taken to be huge; this facility is useful for padding }{\i\f0 string2}{\f0 . +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 OPTIONS}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 Any combination of the options -}{\b\f0 c}{\f0 , -}{\b\f0 d}{\f0 , or -}{\b\f0 s}{\f0 may be used: +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }\pard\plain \s17\qj\fi-720\li1440\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 -}{\b\f0 c}{\f0 \tab Complement the set of characters in }{\i\f0 string1}{\f0 with respect to the universe of characters whose ASCII codes are 01 through 0377 octal; +\par +\par -}{\b\f0 d}{\f0 \tab Delete all input characters in }{\i\f0 string1}{\f0 . +\par +\par -}{\b\f0 s}{\f0 \tab Squeeze all strings of repeated output characters that are in }{\i\f0 string2}{\f0 to single characters. +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 \page }{\fs24 +\par }{\b\fs24 EXAMPLE}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 The following example creates a list of all the words in filename one per line in filename2, where a word is taken to be a maximal string of alphabetics. The second string is quoted to protect `\\' from the shell. 012 is the ASCII code for NEWLINE. +\par +\par }{\b\f2 tr -cs A-Za-z '\\012' < filename1 > filename2}{\b\f0 +\par }{\f0 +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\b\fs24 SEE ALSO}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 conv}{\f0 (1), }{\b\f0 more}{\f0 (1) +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\b\fs24 +\par BUGS}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 Will not handle ASCII NUL in }{\i\f0 string1}{\f0 or }{\i\f0 string2}{\f0 . }{\b\f0 tr}{\f0 always deletes NUL from input. +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\sect }\sectd \linex0\endnhere\sectdefaultcl {\headerl \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx4680\tqr\tx9360\adjustright \fs20\cgrid {\fs24 UNSHAR(1)\tab Commands and Applications\tab UNSHAR(1) +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright {\f4 +\par }}{\headerr \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx4680\tqr\tx9360\adjustright \fs20\cgrid {\fs24 UNSHAR(1)\tab Commands and Applications\tab UNSHAR(1) +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright {\f4 +\par }}{\footerl \pard\plain \s16\nowidctlpar\widctlpar\brdrb\brdrs\brdrw30\brsp20 \tqc\tx4320\tqr\tx10080\adjustright \fs20\cgrid {\ul +\par }\pard \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright {\field{\*\fldinst {\cs18\b PAGE }}{\fldrslt {\cs18\b\lang1024 54}}}{ +\par }\pard \s16\nowidctlpar\widctlpar\tqc\tx4500\tqr\tx10260\adjustright { +\par }}{\footerr \pard\plain \s16\nowidctlpar\widctlpar\brdrb\brdrs\brdrw30\brsp20 \tqc\tx4320\tqr\tx10080\adjustright \fs20\cgrid {\ul +\par }\pard \s16\qr\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright {\field{\*\fldinst {\cs18\b PAGE }}{\fldrslt {\cs18\b\lang1024 55}}}{ +\par }}\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\b\fs24 NAME}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 unshar - extracts files from shar archives +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 SYNOPSIS}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 unshar}{\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\b\f0 unshar}}}{\f0 \{-overwrite\} \{-nosort\} }{\i\f0 file1}{\f0 }{\i\f0 file2}{\f0 ... +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 DESCRIPTION}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 Unshar}{\f0 is a utility which extracts files from the ubiquitous Unix shar archives. It has the following advantages over existing unshar utilities: +\par +\par }\pard\plain \s20\qj\li1440\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 - Small and fast +\par - Handles many cat and sed formats +\par - Allows extraction of subdirectories +\par - Understands ./file type filenames +\par - Understands file continuation with >> +\par - Sorts file list by Subject: line +\par - Exits cleanly with CTRL-C +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 +\par }{\b\f0 Unshar}{\f0 treats quotes and imbedded escape sequences intelligently and handles all the cat and sed formats the au\-thor ever seen, including sed commands which strip off more than one letter. There may be some formats it won't handle, but I've yet to find them. +\par +\par Invoke }{\b\f0 unshar}{\f0 with as many archive filenames as you like. All the files in each archive will be extracted into the current directory. If a file already exists, }{\b\f0 unshar}{\f0 asks you how you want to handle it. Entering `Y' will overwrite the existing file with the version in the archive, `N' will skip past the file without extracting it, and `A' will over\-write this file and any other existing files without prompting you again. Including the -o flag on the command line causes files to always be overwritten. +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 OPERATION}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 Unshar}{\f0 scans through each archive specified on the command line, looking for lines beginning with `cat' or `sed'. All other lines are ignored. In particular, `echo' lines are not echoed. This way, you don't get a load of messages which are in any case fairly meaningless, because the operations they are describing are unsupported. +\par +\par When a shar archive contains a file for which a full pathname is given (as in source/file.c for example) unshar will create whatever directories are necessary. It also strips off leading /'s and ./'s, to make filenames understandable by GS/OS. +\par +\par Occasionally, a shar file distribution will contain a file too large to fit into a single shar archive (archives are typi\-cally limited to around 60K or so for transmission over Usenet). One method some archivers use to get around this is to split the large file into several smaller parts, and use the shell `>>' redirection operator to concatenate the parts together while extracting the files. In order for this to work properly, it is important that the archive files are extracted in the correct sequence; otherwise, all the pieces will get joined together in the wrong order. +\par +\par To assist with this, }{\b\f0 unshar}{\f0 does a prescan over all the files listed on the command line, and checks each file for a "Subject:" line. If it finds such a line, it scans it looking for any hints as to where the file comes in the sequence. Most shar files you feed to unshar will be directly from a Usenet sources or binaries group, and will include a volume and issue reference on the subject line. If }{\b\f0 unshar}{\f0 can't find such an issue reference, it will look for a Part number and use that instead. +\par +\par }{\b\f0 Unshar}{\f0 then extracts the archives starting with the lowest numbered file. This helps to ensure that those extra-large files are created correctly. You can tell when such a file is being created, because }{\b\f0 unshar}{\f0 says "Extending file" rather than "Unsharing file". +\par +\par If for some reason you want the files to be unarchived in the order listed on the command line, you can specify the `-n' (nosort) switch, and no sorting will take place. +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 HISTORY}{\fs24 +\par }\pard \qj\fi-720\li1440\nowidctlpar\widctlpar\adjustright {\fs24 V1.0\tab First release. +\par }\pard \qj\fi-720\li1440\nowidctlpar\widctlpar\adjustright {\fs24 +\par }\pard \qj\fi-720\li1440\nowidctlpar\widctlpar\adjustright {\fs24 V1.1\tab Added support for some more unusual uses of sed. +\par \tab Increased speed, and reduced size slightly. +\par \tab Fixed bug that truncated lines longer than 80 chars. +\par +\par V1.2\tab Added support for sorting by Subject: line +\par \tab Added support for file appending via >> +\par \tab Fixed small bug in detection of disk write errors +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\fs24 +\par }{\b\fs24 AUTHOR}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 Eddy Carroll (EMAIL: ecarroll@vax1.tcd.ie) +\par Apple //gs port by Andy McFadden (fadden@uts.amdahl.com). +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 \sect }\sectd \linex0\endnhere\sectdefaultcl {\headerl \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx4680\tqr\tx9360\adjustright \fs20\cgrid {\fs24 WC(1)\tab Commands and Applications\tab WC(1) +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}{\headerr \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx4680\tqr\tx9360\adjustright \fs20\cgrid {\fs24 WC(1)\tab Commands and Applications\tab WC(1) +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}{\footerl \pard\plain \s16\nowidctlpar\widctlpar\brdrb\brdrs\brdrw30\brsp20 \tqc\tx4320\tqr\tx10080\adjustright \fs20\cgrid {\ul +\par }\pard \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright {\field{\*\fldinst {\cs18\b PAGE }}{\fldrslt {\cs18\b\lang1024 56}}}{ +\par }}{\footerr \pard\plain \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright \fs20\cgrid {\ul \tab \tab +\par }\pard \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright {\tab \tab \chpgn +\par }\pard \s16\nowidctlpar\widctlpar\tqc\tx5220\tqr\tx10260\adjustright { +\par }}\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\b\fs24 NAME}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 wc - display a count of lines, words and characters +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 SYNOPSIS}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 wc}{\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\b\f0 wc}}}{\f0 [ -}{\b\f0 lwc}{\f0 ] [ }{\i\f0 filename}{\f0 ... ] +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 DESCRIPTION}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 wc}{\f0 counts lines, words, and characters in }{\i\f0 filename}{\f0 s, or in the standard input if no filename appears. It also keeps a total count for all named files. A word is a string of characters delimited by SPACE, TAB, or NEWLINE characters. +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 OPTIONS}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 When }{\i\f0 filename}{\f0 s are specified on the command line, their names will be printed along with the counts. +\par +\par The default is -}{\b\f0 lwc}{\f0 (count lines, words, and characters). +\par +\par -}{\b\f0 l}{\f0 \tab Count lines. +\par -}{\b\f0 w}{\f0 \tab Count words. +\par -}{\b\f0 c}{\f0 \tab Count characters. +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 EXAMPLE}{\fs24 +\par }\pard\plain \s17\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f2 example% wc $USRMAN/csh.1 $USRMAN/sh.1 $USRMAN/telnet.1 +\par 1876 11223 65895 /usr/share/man/man1/csh.1 +\par 674 3310 20338 /usr/share/man/man1/sh.1 +\par 260 1110 6834 /usr/share/man/man1/telnet.1 +\par 2810 15643 93067 total +\par example% +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 \sect }\sectd \linex0\endnhere\sectdefaultcl {\headerl \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx4680\tqr\tx9360\adjustright \fs20\cgrid {\fs24 WHO(1)\tab Commands and Applications\tab WHO(1) +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright {\f4 +\par }}{\headerr \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx4680\tqr\tx9360\adjustright \fs20\cgrid {\fs24 WHO(1)\tab Commands and Applications\tab WHO(1) +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright {\f4 +\par }}{\footerl \pard\plain \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx9360\adjustright \fs20\cgrid {\ul \tab \tab +\par }\pard \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx9360\adjustright {\chpgn +\par }}{\footerr \pard\plain \s16\nowidctlpar\widctlpar\brdrb\brdrs\brdrw30\brsp20 \tqc\tx4320\tqr\tx10080\adjustright \fs20\cgrid {\ul +\par }\pard \s16\qr\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright {\field{\*\fldinst {\cs18\b PAGE }}{\fldrslt {\cs18\b\lang1024 57}}}{ +\par }}\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\b\fs24 NAME}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 who - who is on the system +\par }\pard \s17\qj\li720\nowidctlpar\widctlpar\adjustright {\f0 +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\b\fs24 SYNOPSIS}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 who}{\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\b\f0 who}}}{\f0 [ who-file ] [ am I ] +\par +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\b\fs24 DESCRIPTION}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 Who}{\f0 , without an argument, lists the login name, terminal name, and login time for each current UNIX user. +\par +\par Without an argument, }{\b\f0 who}{\f0 examines the }{\b\f0 /etc/utmp}{\f0 file to obtain its information. If a file is given, that file is examined. Typically the given file will be }{\b\f0 /usr/adm/wtmp}{\f0 , which contains a record of all the logins since it was created. Then }{\b\f0 who}{\f0 lists logins, logouts, and crashes since the creation of the wtmp file. Each login is listed with user name, terminal name (with `/dev/' suppressed), and date and time. When an argument is given, logouts produce a similar line without a user name. Reboots produce a line with `x' in the place of the device name, and a fossil time indicative of when the system went down. +\par +\par With two arguments, as in `who am I' (and also `who are you'), }{\b\f0 who}{\f0 tells who you are logged in as. +\par +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\b\fs24 FILES}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 /etc/utmp +\par +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\b\fs24 SEE ALSO}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 getuid(2), utmp(5) +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 \sect }\sectd \linex0\endnhere\sectdefaultcl {\headerl \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx4680\tqr\tx9360\adjustright \fs20\cgrid {\fs24 YES(1)\tab Commands and Applications\tab YES(1) +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx4320\tqc\tx5220\tqr\tx8640\adjustright {\f4 +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx4320\tqc\tx5220\tqr\tx8640\tqr\tx10260\adjustright {\f4 +\par +\par }}{\headerr \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx4680\tqr\tx9360\adjustright \fs20\cgrid {\fs24 yes(1)\tab Commands and Applications\tab yes(1) +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx4320\tqc\tx5220\tqr\tx8640\tqr\tx10260\adjustright {\f4 +\par }}{\footerl \pard\plain \s16\nowidctlpar\widctlpar\brdrb\brdrs\brdrw30\brsp20 \tqc\tx4320\tqr\tx10080\adjustright \fs20\cgrid {\ul +\par }\pard \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright {\field{\*\fldinst {\cs18\b PAGE }}{\fldrslt {\cs18\b\lang1024 58}}}{ +\par }}{\footerr \pard\plain \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx9360\adjustright \fs20\cgrid {\ul \tab \tab +\par }\pard \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx9360\adjustright {\tab \tab \chpgn +\par }}\pard\plain \s21\qj\nowidctlpar\widctlpar\adjustright \b\f4\cgrid {\f0 NAME +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 yes}{\f0 - be repetitively affirmative +\par +\par }\pard\plain \nowidctlpar\widctlpar\tqr\tx10260\adjustright \fs20\cgrid {\b\fs24 SYNOPSIS}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 yes}{\f0 [ expletive ] +\par +\par }\pard\plain \nowidctlpar\widctlpar\tqr\tx10260\adjustright \fs20\cgrid {\b\fs24 DESCRIPTION}{\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 Yes}{\f0 repeatedly outputs "y", or if }{\i\f0 expletive}{\f0 is given, that is output repeatedly. Termination is by interrupt. +\par }\pard\plain \qj\nowidctlpar\widctlpar\tqr\tx10260\adjustright \fs20\cgrid {\fs24 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 \sect }\sectd \linex0\endnhere\sectdefaultcl {\headerl \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx4680\tqr\tx9360\adjustright \fs20\cgrid {\fs24 DUP}{\fs24 (2)\tab System Calls\tab }{\fs24 DUP}{\fs24 (2) +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx4680\tqr\tx9360\adjustright { +\par }}{\headerr \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx4680\tqr\tx9360\adjustright \fs20\cgrid {\fs24 ALARM(2)\tab System Calls\tab ALARM(2) +\par }}{\footerl \pard\plain \s16\nowidctlpar\widctlpar\brdrb\brdrs\brdrw30\brsp20 \tqc\tx4320\tqr\tx10080\adjustright \fs20\cgrid {\ul +\par }\pard \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright {\field{\*\fldinst {\cs18\b PAGE }}{\fldrslt {\cs18\b\lang1024 64}}}{ +\par }}{\footerr \pard\plain \s16\qr\nowidctlpar\widctlpar\brdrb\brdrs\brdrw30\brsp20 \tqc\tx4320\tqr\tx8640\adjustright \fs20\cgrid { +\par }\pard \s16\qr\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright {\field{\*\fldinst {\cs18\b PAGE }}{\fldrslt {\cs18\b\lang1024 59}}}{ +\par }}\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\b\fs24 NAME}{\fs24 +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 alarm - set and reset alarm timer +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 SYNOPSIS}{\fs24 +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 #include +\par long int }{\b\f0 alarm}{\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\b\f0 alarm}}}{\f0 (long int }{\i\f0 seconds}{\f0 ); +\par +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\b\fs24 DESCRIPTION}{\fs24 +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 alarm sets the counter on the calling process' alarm timer to the value specified in }{\i\f0 seconds}{\f0 . If }{\i\f0 seconds}{\f0 is (long int) 0, the alarm timer is disabled. +\par +\par When an alarm timer terminates (by counting down to 0), the calling process is sent a SIGALRM }{\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\f0 SIGALRM }}}{\f0 signal. +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 RETURN VALUE}{\fs24 +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 The amount of time previously remaining in the timer is returned. No errors are possible. +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 SEE ALSO}{\fs24 +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 signal}{\f0 (2), }{\b\f0 sigpause}{\f0 (2) +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 \sect }\sectd \psz1\linex0\endnhere\sectdefaultcl {\headerr \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx4680\tqr\tx9360\adjustright \fs20\cgrid {DUP(2)\tab System Calls\tab DUP(2) +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}{\footerr \pard\plain \s16\qr\nowidctlpar\widctlpar\brdrb\brdrs\brdrw30\brsp20 \tqc\tx4320\tqr\tx9360\adjustright \fs20\cgrid { +\par }\pard \s16\qr\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright {\field{\*\fldinst {\cs18\b PAGE }}{\fldrslt {\cs18\b\lang1024 65}}}{ +\par }}\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\b\fs24 NAME}{\fs24 +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 dup,dup2 - duplicate open file descriptors +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 SYNOPSIS}{\fs24 +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 #include +\par +\par int }{\b\f0 dup}{\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\b\f0 dup}}}{\f0 (int }{\i\f0 filedes}{\f0 ); +\par int }{\b\f0 dup2}{\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\b\f0 dup2}}}{\f0 (int }{\i\f0 filedes}{\f0 , int }{\i\f0 filedes2}{\f0 ); +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 DESCRIPTION}{\fs24 +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 Given the file descriptor of a valid open file, }{\b\f0 dup}{\f0 creates a new file descriptor that is synonymous with }{\i\f0 filedes}{\f0 . The new file descriptor is returned. The second form of the call forces an existing file descriptor }{\i\f0 filedes2}{\f0 to refer to the same file as }{\i\f0 filedes}{\f0 . If }{\i\f0 filedes2}{\f0 already refers to an open file, it is closed first. +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 RETURN VALUE}{\fs24 +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 dup}{\f0 returns the new file descriptor, and }{\b\f0 dup2}{\f0 returns 0 if the calls are successful. In the event of an error, -1 is returned and }{\b\f0 errno}{\f0 is set as follows: +\par +\par [EBADF]\tab filedes refers to an invalid file descriptor (not an open file) +\par [EMFILE]\tab no more files can be opened; process is at current limit (32). +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 SEE ALSO}{\fs24 +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 fork}{\f0 (2), }{\b\f0 open}{\f0 (2) +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par \sect }\sectd \linex0\endnhere\sectdefaultcl {\headerl \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx4680\tqr\tx9360\adjustright \fs20\cgrid {\fs24 EXECVE}{\fs24 (2)\tab System Calls\tab }{\fs24 EXECVE}{\fs24 (2) +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx4680\tqr\tx9360\adjustright { +\par }}{\headerr \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx4680\tqr\tx9360\adjustright \fs20\cgrid {\fs24 EXECVE(2)\tab System Calls\tab EXECVE(2) +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\b\fs24 NAME}{\fs24 +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 execve - replace current process with an executable image from a file +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 SYNOPSIS}{\fs24 +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 #include +\par int }{\b\f0 execve}{\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\b\f0 execve}}}{\f0 (char *}{\i\f0 pathname}{\f0 , char *}{\i\f0 cmdline}{\f0 ); +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 DESCRIPTION}{\fs24 +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 execve}{\f0 is the preferred method for loading program files to be executed under the GNO system. A new userID is allocated for the process, and the GS/OS System Loader is used to bring the executable file specified by pathname into memory. }{\i\f0 pathname}{\f0 can be a partial or complete path. The executable loaded replaces the executable associated with the current process. +\par +\par If the executable file does not contain an OMF Stack Segment (SEGKIND = $12), a default stack of 4096 bytes is allocated to the process. The direct-page pointer is set to the bottom of the stack memory (for C programs this is irrelevant). +\par +\par The parameter }{\i\f0 cmdline}{\f0 is the list of arguments to be passed to the new process (a copy is actually passed). C programs parse cmdline automatically, and the individual pieces can be accessed through the argc/argv arguments to main(). }{\i\f0 cmdline}{\f0 can be accessed from assembly langugage through the X (high-order word of }{\i\f0 cmdline}{\f0 ) and Y (low-order word) registers. However, if the executable file is of file type S16 ($B3), the }{\i\f0 cmdline}{\f0 argument is ignored and the X&Y registers are set to null (i.e. the command line is only passed to an EXE executable). The 8 characters "BYTEWRKS" are prepended to }{\i\f0 cmdline}{\f0 before being passed to the process (this is the same identifier used by the ORCA shell). This Shell Identifier distinguishes the GNO and ORCA environments from others that don't support the full range of shell calls, and can be accessed from C with the library function }{\b\f0 shellid}{\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\b\f0 shellid}}}{\f0 (). The A register is set to the userID allocated for the process. +\par +\par GS/OS prefixes 1 and 9 are set to the pathname of the directory containing the executable file; if the length of the path exceeds 64 characters prefix 1 is set to the null prefix (length 0). +\par The following information is inherited by the new executable: current machine state, controlling TTY, process group ID, and prefixes 0 and 8. +\par +\par }\pard \s22\qj\li720\nowidctlpar\widctlpar\adjustright {\f0 Caught signals are reset to the default action. Ignored signals remain ignored across the }{\b\f0 execve}{\f0 . Any signals in the parent's queue are not passed to the child, and the child is started with no signals blocked. The child inherits all the open files of its parent. +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 RETURN VALUE}{\fs24 +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 A successful }{\b\f0 execve}{\f0 does not return, as the current executable is replaced with the one specified in the call. If for some reason the call fails, execve returns SYSERR (-1), and }{\b\f0 errno}{\f0 is set to one of the following: +\par }\pard \s22\qj\li1440\nowidctlpar\widctlpar\adjustright {\f0 [ENOENT]\tab the }{\i\f0 pathname}{\f0 specified does not exist +\par [EIO]\tab \tab some general I/O error occurred trying to load the executable +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 BUGS}{\fs24 +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 ORCA/C 1.3 and previous ignore any stack }{\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\f0 stack }}}{\f0 space allocated for it by the GS/OS Loader (which execve calls) or by default in execve. Stack space in ORCA/C programs is determined by code in the .root object file, and can be set with the #pragma stacksize directive. Read the chapter on GNO Compliance in the }{\i\f0 GNO Kernel Reference Manual}{\f0 for more information on this topic. ORCA/C 2.0 and newer use the system-provided stack space. +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 SEE ALSO}{\fs24 +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 exec}{\f0 (2), }{\b\f0 fork}{\f0 (2), }{\b\f0 wait}{\f0 (2), }{\b\f0 ioctl}{\f0 (2), }{\b\f0 tty}{\f0 (4), }{\i\f0 GNO Kernel Reference Manual}{\f0 +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }\pard \nowidctlpar\widctlpar\adjustright {\fs24 \sect }\sectd \linex0\endnhere\sectdefaultcl {\headerl \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx4680\tqr\tx9360\adjustright \fs20\cgrid {\fs24 FORK}{\fs24 (2)\tab System Calls\tab }{\fs24 FORK}{\fs24 (2) +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx4680\tqr\tx9360\adjustright { +\par }}{\headerr \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx4680\tqr\tx9360\adjustright \fs20\cgrid {\fs24 FORK(2)\tab System Calls\tab FORK(2) +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\b\fs24 NAME}{\fs24 +\par }\pard\plain \s22\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 fork - start a new process from inside the current application space +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 SYNOPSIS}{\fs24 +\par }\pard\plain \s22\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 #include +\par +\par int }{\b\f0 fork}{\pard\plain \s22\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\b\f0 fork}}}{\f0 (void *}{\i\f0 addr}{\f0 ); +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 DESCRIPTION}{\fs24 +\par }\pard\plain \s22\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 fork}{\f0 's argument }{\i\f0 addr}{\f0 is typically the address of a C function, although it can be any valid address inside the IIGS RAM space. }{\b\f0 fork}{\f0 creates a new entry in the process table, and sets up default settings for the new process. The process is allocated 1K (1024 bytes) of stack space, and the direct page is set to the beginning of this memory. The process is executed in 16-bit full native mode, and the registers upon entry to the routine are set as follows: +\par +\par \tab A\tab the userID assigned to the process +\par \tab X\tab 0 +\par \tab Y\tab 0 +\par +\par The child inherits the memory shadowing and machine state parameters of the parent, as well as signal blocking information and the ID of the controlling TTY. In addition, the child inherits all the open files of its parent. +\par +\par A forked process may share code with other children or the parent. However, this is only allowed in a forward manner; any forked process that exits by function return will be terminated. Note that any shared global variables will need to be moderated with some type of mutual exclusion, either the kernel semaphore(2) routines or custom routines. This includes C stdio routines. +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 RETURN VALUE}{\fs24 +\par }\pard\plain \s22\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 fork}{\f0 returns the process ID of the child, or -1 (SYSERR) if an error occurs, in which case }{\b\f0 errno}{\f0 is set as follows: +\par \tab [ENOMEM]\tab not enough memory to create the new process +\par \tab [EAGAIN]\tab all process slots full; no more can be created +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 NOTES}{\fs24 +\par }\pard\plain \s22\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 There is no way to pass parameters directly to a child with }{\b\f0 fork}{\f0 (). Use }{\b\f0 fork2}{\f0 () instead. +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 CAVEATS}{\fs24 +\par }\pard\plain \s22\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 Most UNIX }{\b\f0 fork}{\f0 s take no parameters; they copy the entire address space of the calling process and return with a different value in the parent and child. Due to hardware limitations, this sort of manipulation isn't possible on the IIgs. UNIX programs utilizing }{\b\f0 fork}{\f0 will have to be modified slightly to work under GNO. +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }\pard \nowidctlpar\widctlpar\adjustright {\fs24 +\par }{\b\fs24 SEE ALSO}{\fs24 +\par }\pard\plain \s22\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 fork2}{\f0 (2), }{\b\f0 exec}{\f0 (2), }{\b\f0 execve}{\f0 (2), }{\b\f0 wait}{\f0 (2), }{\b\f0 screate}{\f0 (2) +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 \sect }\sectd \linex0\endnhere\sectdefaultcl {\headerr \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx4680\tqr\tx9360\adjustright \fs20\cgrid {\fs24 GETPID(2)\tab System Calls\tab GETPID(2) +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}{\footerl \pard\plain \s16\nowidctlpar\widctlpar\brdrb\brdrs\brdrw30\brsp20 \tqc\tx4320\tqr\tx10080\adjustright \fs20\cgrid {\ul +\par }\pard \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright {\field{\*\fldinst {\cs18\b PAGE }}{\fldrslt {\cs18\b\lang1024 66}}}{ +\par }}\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\b\fs24 NAME}{\fs24 +\par }\pard\plain \s22\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 getpid, getpgrp, getppid - return information about processes +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 SYNOPSIS}{\fs24 +\par }\pard\plain \s22\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 #include +\par +\par int }{\b\f0 getpid}{\pard\plain \s22\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\b\f0 getpid}}}{\f0 (void); +\par int }{\b\f0 getpgrp}{\pard\plain \s22\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\b\f0 getpgrp}}}{\f0 (int }{\i\f0 pid}{\f0 ); +\par int }{\b\f0 getppid}{\pard\plain \s22\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\b\f0 getppid}}}{\f0 (void); +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 DESCRIPTION}{\fs24 +\par }\pard\plain \s22\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 The process ID is a unique value associated with a process, and is needed for many system calls. pid's can range from 0 (Kernel Null Process) to 32767. Some programs use }{\b\f0 getpid}{\f0 to seed random number generators. A much better approach on the IIGS is to use the horizontal and vertical positions of the electron gun, which can be obtained by reading the word value at absolute memory location $E0C02E. +\par +\par }{\b\f0 getpgrp}{\f0 returns the process group ID of the specified process, }{\i\f0 pid}{\f0 . This function is usually used when you wish to send a signal to all members of a process group using }{\b\f0 kill}{\pard\plain \s22\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\b\f0 kill}}}{\f0 (2). +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 RETURN VALUE}{\fs24 +\par }\pard\plain \s22\fi-1080\li1800\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 getpid}{\f0 :\tab The process ID of the caller is returned. No errors are possible. +\par }{\b\f0 getppid}{\f0 :\tab The process ID of the caller's parent is returned. No errors are possible. +\par }{\b\f0 getpgrp}{\f0 :\tab The process group ID of the specified process is returned. In the event of an error, getpgrp returns -1 and sets }{\b\f0 errno}{\f0 to the appropriate error code: +\par }\pard \s22\li1800\nowidctlpar\widctlpar\adjustright {\f0 [ESRCH]\tab pid is not a valid process ID +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 NOTES}{\fs24 +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 getpgrp}{\f0 () is provided solely for compatibility with previous versions of the UNIX operating system. The new Job Control interface should be used exclusively in new software. +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par +\par }{\b\fs24 SEE ALSO}{\fs24 +\par }\pard\plain \s22\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 fork}{\f0 (2), }{\b\f0 job control}{\f0 (2), }{\b\f0 ioctl}{\f0 (2), }{\i\f0 GNO Kernel Reference Manual}{\f0 +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 \sect }\sectd \linex0\endnhere\sectdefaultcl {\headerl \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright \fs20\cgrid {\fs24 GETUID(2)\tab System Calls\tab GETUID(2) +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}{\headerr \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx4680\tqr\tx9360\adjustright \fs20\cgrid {GETUID(2)\tab System Calls\tab GETUID(2) +\par }}{\footerr \pard\plain \s16\nowidctlpar\widctlpar\brdrb\brdrs\brdrw30\brsp20 \tqc\tx4320\tqr\tx10080\adjustright \fs20\cgrid {\ul +\par }\pard \s16\qr\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright {\field{\*\fldinst {\cs18\b PAGE }}{\fldrslt {\cs18\b\lang1024 67}}}{ +\par }}\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\b\fs24 NAME}{\fs24 +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 getuid, geteuid, getgid, getegid - get user and group identity +\par getpgrp - get process group +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\b\fs24 SYNOPSIS}{\fs24 +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 #include +\par uid_t = }{\b\f0 getuid}{\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\b\f0 getuid}}}{\f0 (void) +\par uid_t = }{\b\f0 geteuid}{\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\b\f0 geteuid}}}{\f0 (void) +\par gid_t = }{\b\f0 getgid}{\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\b\f0 getgid}}}{\f0 (void) +\par }\pard \s22\qj\li720\nowidctlpar\widctlpar\adjustright {\f0 gid_t = }{\b\f0 getegid}{\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\b\f0 getegid}}}{\f0 (void) +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 DESCRIPTION}{\fs24 +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 Getuid}{\f0 returns the real user ID of the current process, }{\b\f0 geteuid}{\f0 the effective user ID. The real user ID identifies the person who is logged in. The effective user ID gives the process additional permissions during execution of "set-user-ID" mode processes, which use getuid to determine the real-user-id of the process that invoked them. +\par +\par }{\b\f0 Getgid}{\f0 returns the real group ID of the current process, }{\b\f0 getegid}{\f0 the effective group ID. The real group ID is specified at login time. The effective group ID is more transient, and determines additional access permission during execution of a ``set-group-ID'' process, and it is for such processes that getgid is most useful. +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 NOTES}{\fs24 +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 The }{\b\f0 setr}{\f0 *() functions are not currently implemented in GNO/ME, because set-uid and set-group-ID behavior is specific to the UNIX filesystem. +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 SEE ALSO}{\fs24 +\par }\pard\plain \s22\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 setreuid}{\f0 (2), }{\b\f0 setregid}{\f0 (2), }{\b\f0 setgid}{\f0 (3), }{\b\f0 tty}{\f0 (4) +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 \sect }\sectd \linex0\endnhere\sectdefaultcl {\headerr \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx4680\tqr\tx9360\adjustright \fs20\cgrid {\fs24 INTRO(2)\tab System Calls\tab INTRO(2) +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}{\footerl \pard\plain \s16\nowidctlpar\widctlpar\brdrb\brdrs\brdrw30\brsp20 \tqc\tx4320\tqr\tx10080\adjustright \fs20\cgrid {\ul +\par }\pard \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright {\field{\*\fldinst {\cs18\b PAGE }}{\fldrslt {\cs18\b\lang1024 68}}}{ +\par }}\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\b\fs24 NAME}{\fs24 +\par }\pard\plain \s22\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 intro }{\pard\plain \s22\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\f0 intro }}}{\f0 - introduction to GNO system calls +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 DESCRIPTION}{\fs24 +\par }\pard\plain \s22\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 This section describes, in alphabetical order, the system calls and kernel interfaces available for GNO. Certain distinctions of purpose are made in the headings. +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 Manual Page Command Syntax}{\fs24 +\par }\pard\plain \s22\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 Unless otherwise noted, calls described in the }{\b\f0 SYNOPSIS}{\f0 section of a manual page accept parameters and require the +\par +\par name [- option ...] [ cmdarg ...] +\par +\par where: +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }\pard \fi-1080\li1800\nowidctlpar\widctlpar\adjustright {\fs24 []\tab Surround an option or cmdarg that is not required. +\par }\pard \fi-1080\li1800\nowidctlpar\widctlpar\adjustright {\fs24 +\par ...\tab Indicates multiple occurrences of the option or cmdarg. +\par +\par name \tab The name of an executable file. +\par +\par option \tab (Almost always preceded by a "-".) +\par \tab noargletter ... or, +\par \tab argletter optarg [,...] +\par +\par noargletter \tab A single letter representing an option without an option-argument. Note that more than one noargletter option can be grouped after one "-". +\par +\par argletter \tab A single letter representing an option requiring an option-argument. +\par +\par optarg \tab An option-argument (character string) satisfying a preceding argletter. Note that groups of optargs following an argletter must be separated by white space and quoted. +\par +\par cmdarg \tab Path name (or other command argument) not beginning with a "-", or "-" by itself indicating the standard input. +\par }\pard \nowidctlpar\widctlpar\adjustright {\fs24 +\par }\pard \nowidctlpar\widctlpar\adjustright {\b\fs24 SEE ALSO +\par }\pard\plain \s22\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\i\f0 GNO/ME Kernel Reference Manual}{\f0 +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 \sect }\sectd \linex0\endnhere\sectdefaultcl {\headerl \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx5040\tqr\tx10080\adjustright \fs20\cgrid {\fs24 IOCTL(2)\tab System Calls\tab IOCTL(2) +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}{\headerr \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx4680\tqr\tx9360\adjustright \fs20\cgrid {IOCTL(2)\tab System Calls\tab IOCTL(2) +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}{\footerr \pard\plain \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright \fs20\cgrid {\ul \tab \tab +\par }\pard \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright {\tab \tab \chpgn +\par }\pard \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\b\fs24 NAME}{\fs24 +\par }\pard\plain \s22\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 ioctl - control device +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 SYNOPSIS}{\fs24 +\par }\pard\plain \s22\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 #include +\par +\par int }{\b\f0 ioctl}{\pard\plain \s22\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\b\f0 ioctl}}}{\f0 (int }{\i\f0 fd}{\f0 , unsigned long }{\i\f0 request}{\f0 , void *}{\i\f0 argp}{\f0 ) +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 DESCRIPTION}{\fs24 +\par }\pard\plain \s22\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 Ioctl}{\f0 performs a variety of functions on open file descriptors. In particular, many operating characteristics of character special files (e.g. terminals) may be controlled with }{\b\f0 ioctl}{\f0 requests. The writeups of various devices in section 4 discuss how }{\b\f0 ioctl}{\f0 applies to them. +\par +\par An }{\b\f0 ioctl}{\f0 }{\i\f0 request}{\f0 has encoded in it whether the argument is an "in" parameter or "out" parameter, and the size of the argument argp in bytes. Macros and defines used in specifying an }{\b\f0 ioctl}{\f0 request are located in the file . +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 RETURN VALUE}{\fs24 +\par }\pard\plain \s22\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 If an error has occurred, a value of -1 is returned and }{\b\f0 errno}{\f0 is set to indicate the error. +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 ERRORS}{\fs24 +\par }\pard \fi-1440\li2160\nowidctlpar\widctlpar\adjustright {\b\fs24 Ioctl}{\fs24 will fail if one or more of the following are true: +\par }\pard \fi-1440\li2160\nowidctlpar\widctlpar\adjustright {\fs24 +\par }{\f2\fs24 [EBADF]}{\fs24 \tab }{\i\fs24 Fd}{\fs24 is not a valid descriptor. +\par +\par }{\f2\fs24 [ENOTTY]}{\fs24 \tab }{\i\fs24 Fd}{\fs24 is not associated with a character special device. +\par +\par }{\f2\fs24 [ENOTTY]}{\fs24 \tab The specified request does not apply to the kind of object that the descriptor fd references. +\par +\par }{\f2\fs24 [EINVAL]}{\fs24 \tab }{\i\fs24 Request}{\fs24 or }{\i\fs24 argp}{\fs24 is not valid. +\par }\pard \nowidctlpar\widctlpar\adjustright {\fs24 +\par }{\b\fs24 SEE ALSO}{\fs24 +\par }\pard\plain \s22\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 execve}{\f0 (2), }{\b\f0 tty}{\f0 (4) +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\fs24 \sect }\sectd \linex0\endnhere\sectdefaultcl {\headerl \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx5040\tqr\tx10080\adjustright \fs20\cgrid {\fs24 JOBCONTROL(2)\tab System Calls\tab JOBCONTROL(2) +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}{\headerr \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx4680\tqr\tx9360\adjustright \fs20\cgrid {\fs24 JOBCONTROL(2)\tab System Calls\tab JOBCONTROL(2) +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}{\footerl \pard\plain \s16\nowidctlpar\widctlpar\brdrb\brdrs\brdrw30\brsp20 \tqc\tx4320\tqr\tx10080\adjustright \fs20\cgrid {\ul +\par }\pard \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright {\field{\*\fldinst {\cs18\b PAGE }}{\fldrslt {\cs18\b\lang1024 70}}}{ +\par }}{\footerr \pard\plain \s16\nowidctlpar\widctlpar\brdrb\brdrs\brdrw30\brsp20 \tqc\tx4320\tqr\tx10080\adjustright \fs20\cgrid {\ul +\par }\pard \s16\qr\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright {\field{\*\fldinst {\cs18\b PAGE }}{\fldrslt {\cs18\b\lang1024 69}}}{ +\par }}\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\b\fs24 NAME}{\fs24 +\par }\pard\plain \s22\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 tcnewpgrp, settpgrp, tctpgrp - interface for the new job control model +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 SYNOPSIS}{\fs24 +\par }\pard\plain \s22\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 #include +\par +\par int }{\b\f0 tcnewpgrp}{\pard\plain \s22\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\b\f0 tcnewpgrp}}}{\f0 (int }{\i\f0 fdtty}{\f0 ); +\par int }{\b\f0 settpgrp}{\pard\plain \s22\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\b\f0 settpgrp}}}{\f0 (int }{\i\f0 fdtty}{\f0 ); +\par int }{\b\f0 tctpgrp}{\pard\plain \s22\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\b\f0 tctpgrp}}}{\f0 (int }{\i\f0 fdtty}{\f0 , int }{\i\f0 pid}{\f0 ); +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }\pard \nowidctlpar\widctlpar\adjustright {\b\fs24 DESCRIPTION}{\fs24 +\par }\pard\plain \s22\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 The job control interface is used to control what processes are ``in the foreground'' on a particular terminal. Every tty has a process group. Each process is a member of a process group. A process is a foreground process on a tty if and only if that process and the terminal belong to the same process group. Certain characters typed on a tty with a nonzero process group produce signals sent to every process which is a member of the group (e.g. ^C). +\par +\par A process is suspended (stopped) if it performs a sufficiently invasive operation on a tty with a different process group. This includes these job control calls, reads from a terminal, and writes to a terminal if configured to do so with }{\b\f0 ioctl}{\pard\plain \s22\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\b\f0 ioctl}}}{\f0 (2). When a tty file is first opened, it is assigned process group 0; init has process group 0. As init launches login processes on various ttys, it assigns process groups to those ttys and processes. +\par +\par }{\b\f0 tcnewpgrp}{\f0 (fdtty): Allocates a new process group and assigns it to the terminal referred to by fdtty. If the calling process is not in the foreground, it is sent SIGTTOU}{\pard\plain \s22\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\f0 SIGTTOU}}}{\f0 . +\par +\par }{\b\f0 settpgrp}{\f0 (fdtty): Sets the current process to have the same process group as fdtty. +\par +\par }{\b\f0 tctpgrp}{\f0 (fdtty,pid): Sets the tty to the same process group as pid, where pid is the current process or a descendant of it. +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 RETURN VALUE}{\fs24 +\par }\pard\plain \s22\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 The calls will return 0 if no error occurs; otherwise, they'll return -1 and set }{\b\f0 errno}{\f0 to one of the following: +\par }{\f2 [EBADF]}{\f0 \tab }{\i\f0 fdtty}{\f0 is not a valid file descriptor +\par }{\f2 [ENOTTY]}{\f0 \tab }{\i\f0 fdtty}{\f0 does not refer to a terminal file +\par }{\f2 [ESRCH]}{\f0 \tab }{\i\f0 pid}{\f0 is not a valid process identifier +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 NOTES}{\fs24 +\par }\pard\plain \s22\fi-720\li1440\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 Following are some example uses of the job control interface. +\par +\par \bullet \tab Forking a pipeline in a job-control shell: The shell starts with }{\b\f0 tcnewpgrp}{\f0 (fdtty), so that the tty is in the new process group before there are even any children. It then forks each process in the pipeline. Each process does }{\b\f0 settpgrp}{\f0 (fdtty), thus joining the new process group. +\par +\par \bullet \tab Handling a stopped child process: When the shell sees that a pipeline has stopped or exited, it does }{\b\f0 tctpgrp}{\f0 (fdtty,getpid()) to set the tty to its own process group. To resume the pipeline it does }{\b\f0 tctpgrp}{\f0 (fdtty,pid) where pid is one of the child processes, then sends SIGCONT. +\par +\par \bullet \tab Starting a process under a new tty: When, for instance, telnetd wants to grab a pseudo-tty, it opens the pty and forks a child process. The child does }{\b\f0 tcnewpgrp}{\f0 (fdtty) to give the tty a real process group, then }{\b\f0 settpgrp}{\f0 (fdtty) to place itself into the foreground. +\par +\par }\pard \s22\li720\nowidctlpar\widctlpar\adjustright {\f0 Security under this scheme is trivial. There is no way a process can join a process group except by settpgrp(), and that requires a descriptor open to a tty with that pgrp. To make a tty have that pgrp requires either }{\b\f0 tcnewpgrp}{\f0 (), in which case nobody else is using the pgrp, or }{\b\f0 tctpgrp}{\f0 (), which reduces to the first problem of having a process in the process group. End of security proof. (Wasn't that easy?) Note that `using' must be defined as use both by ttys and by processes; the system keeps a table of pgrps, each with a total tty + process reference count. When the reference count reaches zero, the pgrp is automatically deallocated. +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 SEE ALSO}{\fs24 +\par }\pard\plain \s22\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 ioctl}{\f0 (2), }{\b\f0 tty}{\f0 (4), }{\b\f0 signal}{\f0 (2), }{\b\f0 kill}{\f0 (2), }{\i\f0 GNO Shell Reference Manual}{\f0 +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 CREDITS}{\fs24 +\par }\pard\plain \s22\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 This job control interface was designed by Dan Bernstein (brnstnd@kramden.acf.nyu.edu). He was inspired by Chris Torek, and dedicated the system to Mark Teitelbaum. The text of this manpage is derived from his original specifications. +\par The GNO/ME implementation was written strictly from specs. +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 \sect }\sectd \linex0\endnhere\sectdefaultcl {\headerl \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx5040\tqr\tx10080\adjustright \fs20\cgrid {KILL(2)\tab System Calls\tab KILL(2) +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}{\headerr \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx4680\tqr\tx9360\adjustright \fs20\cgrid {\fs24 KILL(2)\tab System Calls\tab KILL(2) +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}{\footerl \pard\plain \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright \fs20\cgrid {\ul \tab \tab +\par }\pard \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright {\chpgn +\par }\pard \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}{\footerr \pard\plain \s16\nowidctlpar\widctlpar\brdrb\brdrs\brdrw30\brsp20 \tqc\tx4320\tqr\tx10080\adjustright \fs20\cgrid {\ul +\par }\pard \s16\qr\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright {\field{\*\fldinst {\cs18\b PAGE }}{\fldrslt {\cs18\b\lang1024 71}}}{ +\par }}\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\b\fs24 NAME}{\fs24 +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 kill - send a signal to a process +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 SYNOPSIS}{\fs24 +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 #include +\par +\par int }{\b\f0 kill}{\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\b\f0 kill}}}{\f0 (int }{\i\f0 pid}{\f0 , int }{\i\f0 sig}{\f0 ) +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\b\fs24 DESCRIPTION}{\fs24 +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 kill}{\f0 is used to send a signal to a process or group of processes. Signals are software interrupts; they act just like hardware interrupts and can also be used for basic IPC (Inter-process communication). The various signals are described in }{\b\f0 signal}{\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\b\f0 signal}}}{\f0 (2). +\par +\par }{\i\f0 sig}{\f0 can be a signal number, or it can be 0, in which case no signal is sent, but error checking is done (this can be used to verify a process ID). If }{\i\f0 sig}{\f0 has been blocked (}{\b\f0 sigblock}{\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\b\f0 sigblock}}}{\f0 (2)), the signal is deferred until it is unblocked, and }{\b\f0 kill}{\f0 returns immediately. Any previously pending signals of the same }{\i\f0 sig}{\f0 are lost (i.e. signals are not stacked). +\par +\par If }{\i\f0 pid}{\f0 is 0, the signal is sent to all processes with the same process group ID as the caller, except for system processes. +\par +\par Processes may signal themselves, in which case the signal handler is invoked immediately (if one is installed). +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\b\fs24 RETURN VALUE}{\fs24 +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 Normally }{\b\f0 kill}{\f0 returns SYSOK (0). The following conditions can cause }{\b\f0 kill}{\f0 to return SYSERR (-1): +\par }{\f2 [ESHRC]}{\f0 \tab }{\i\f0 pid}{\f0 does not correspond to an existing process +\par }{\f2 [EINVAL]}{\f0 \tab }{\i\f0 sig}{\f0 specifies an invalid signal number +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 SEE ALSO}{\fs24 +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 sigblock}{\f0 (2), }{\b\f0 signal}{\f0 (2), }{\b\f0 wait}{\f0 (2) +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 BUGS}{\fs24 +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 Do not attempt to send signals from inside a CDA (Classic Desk Accessory) or interrupt handler. +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 \sect }\sectd \linex0\endnhere\sectdefaultcl {\headerl \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx5040\tqr\tx10080\adjustright \fs20\cgrid {\fs24 PIPE(2)\tab System Calls\tab PIPE(2) +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}{\headerr \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx4680\tqr\tx9360\adjustright \fs20\cgrid {PIPE(2)\tab System Calls\tab PIPE(2) +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}{\footerl \pard\plain \s16\nowidctlpar\widctlpar\brdrb\brdrs\brdrw30\brsp20 \tqc\tx4320\tqr\tx10080\adjustright \fs20\cgrid {\ul +\par }\pard \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright {\field{\*\fldinst {\cs18\b PAGE }}{\fldrslt {\cs18\b\lang1024 72}}}{ +\par }\pard \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}{\footerr \pard\plain \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright \fs20\cgrid {\ul \tab \tab +\par }\pard \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright {\tab \tab \chpgn +\par }\pard \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\b\fs24 NAME}{\fs24 +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 pipe - create an interprocess communication channel +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 SYNOPSIS}{\fs24 +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 #include +\par int }{\b\f0 pipe}{\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\b\f0 pipe}}}{\f0 (int }{\i\f0 filedes[2]}{\f0 ); +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\b\fs24 +\par DESCRIPTION}{\fs24 +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 The }{\b\f0 pipe}{\f0 system call creates an I/O mechanism called a pipe. The file descriptors returned can be used in read and write operations. When the pipe is written using the descriptor }{\i\f0 filedes[1]}{\f0 up to 4096 bytes of data are buffered before the writing process is suspended. A read using the descriptor }{\i\f0 filedes[0]}{\f0 will pick up the data. +\par +\par It is assumed that after the pipe has been set up, two (or more) cooperating processes (created by subsequent fork calls) will pass data through the pipe with Read and Write calls. +\par +\par The shell has a syntax to set up a linear array of processes connected by pipes. +\par +\par }{\b\f0 Read}{\f0 calls on an empty pipe (no buffered data) with only one end (all write file descriptors closed) returns an end-of-file. +\par +\par A signal (SIGPIPE}{\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\f0 SIGPIPE}}}{\f0 ) is generated if a write on a pipe with only one end is attempted. +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 RETURN VALUE}{\fs24 +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 The function value zero is returned if the pipe was created; -1 if an error occurred. +\par +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\b\fs24 ERRORS}{\fs24 +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 The pipe call will fail if: +\par }\pard \s22\qj\li720\nowidctlpar\widctlpar\adjustright {\f2 [EMFILE]}{\f0 \tab Too many descriptors are active. +\par }\pard \s22\qj\li720\nowidctlpar\widctlpar\adjustright {\f2 [ENFILE]}{\f0 \tab The system file table is full. +\par }{\f2 [EFAULT]}{\f0 \tab The fildes buffer is in an invalid area of the process's address space. +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 SEE ALSO}{\fs24 +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\i\f0 GNO Shell Users Manual}{\f0 , }{\b\f0 read}{\f0 (2), }{\b\f0 write}{\f0 (2), }{\b\f0 fork}{\f0 (2) +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 BUGS}{\fs24 +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 Should more than 4096 bytes be necessary in any pipe among a loop of processes, deadlock will occur. +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 NOTES}{\fs24 +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 In the above text, mention is made to UNIX read and write calls. On the Apple IIgs, these refer to any system calls that do I/O, namely GS/OS ReadGS, WriteGS; TextTools calls; and C library I/O calls such as read, fread, etc. +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\f4 \sect }\sectd \linex0\endnhere\sectdefaultcl {\headerl \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx5040\tqr\tx10080\adjustright \fs20\cgrid {SCREATE(2)\tab System Calls\tab SCREATE(2) +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}{\headerr \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx4680\tqr\tx9360\adjustright \fs20\cgrid {\fs24 SCREATE(2)\tab System Calls\tab SCREATE(2) +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}{\footerl \pard\plain \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright \fs20\cgrid {\ul \tab \tab +\par }\pard \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright {\chpgn +\par }\pard \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}{\footerr \pard\plain \s16\nowidctlpar\widctlpar\brdrb\brdrs\brdrw30\brsp20 \tqc\tx4320\tqr\tx10080\adjustright \fs20\cgrid {\ul +\par }\pard \s16\qr\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright {\field{\*\fldinst {\cs18\b PAGE }}{\fldrslt {\cs18\b\lang1024 73}}}{ +\par }}\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\b\fs24 NAME}{\fs24 +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 screate, sdelete, swait, ssignal - semaphore }{\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\f0 semaphore }}}{\f0 operations +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 SYNOPSIS}{\fs24 +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 #include +\par +\par int }{\b\f0 swait}{\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\b\f0 swait}}}{\f0 (int }{\i\f0 sem}{\f0 ); +\par int }{\b\f0 ssignal}{\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\b\f0 ssignal}}}{\f0 (int }{\i\f0 sem}{\f0 ); +\par int }{\b\f0 screate}{\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\b\f0 screate}}}{\f0 (int }{\i\f0 count}{\f0 ); +\par int }{\b\f0 sdelete}{\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\b\f0 sdelete}}}{\f0 (int }{\i\f0 sem}{\f0 ); +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 DESCRIPTION}{\fs24 +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 screate}{\f0 is used to allocate a semaphore from the kernel semaphore manager. Semaphores are the most basic form of interprocess communication, and these routines provide the power necessary to solve a large number of synchronization and communication problems. (See an Operating Systems text). +\par +\par The initial }{\i\f0 count}{\f0 determines how many times }{\b\f0 swait}{\f0 can be called before processes are blocked. }{\i\f0 count}{\f0 must be >= 0, and is usually set to 1. }{\b\f0 screate}{\f0 returns a semaphore ID number as an integer. This ID must be used in all the other semaphore calls. +\par +\par }{\b\f0 sdelete}{\f0 releases the specified semaphore, and returns all processes that were blocked to a ready state. +\par +\par }{\b\f0 swait}{\f0 decrements the value of the semaphore (initially specified by }{\i\f0 count}{\f0 ) by 1. If the semaphore count is less than zero, the process is blocked and queued for release by }{\b\f0 ssignal}{\f0 . +\par +\par }{\b\f0 ssignal}{\f0 increments the semaphore count by one. If the semaphore count is less than zero, }{\b\f0 ssignal}{\f0 releases arbitrarily a process that had been blocked; FIFO operation is not guaranteed. +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 RETURN VALUE}{\fs24 +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 All the functions return SYSERR}{\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\f0 SYSERR}}}{\f0 (-1) if an error occurs, and an OK}{\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\f0 OK}}}{\f0 (0) if no error occurs. +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 BUGS}{\fs24 +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 There is currently no mechanism for deallocating semaphores that are orphaned by abnormal process termination. +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 HISTORY}{\fs24 +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 These semaphore routines were designed for XINU, written by Douglas Comer. +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }\pard \nowidctlpar\widctlpar\adjustright {\fs24 \sect }\sectd \linex0\endnhere\sectdefaultcl {\headerl \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx5040\tqr\tx10080\adjustright \fs20\cgrid {\fs24 SETDEBUG(2)\tab System Calls\tab SETDEBUG(2) +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}{\headerr \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx4680\tqr\tx9360\adjustright \fs20\cgrid {\fs24 SETDEBUG(2)\tab System Calls\tab SETDEBUG(2) +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}{\footerl \pard\plain \s16\nowidctlpar\widctlpar\brdrb\brdrs\brdrw30\brsp20 \tqc\tx4320\tqr\tx10080\adjustright \fs20\cgrid {\ul +\par }\pard \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright {\field{\*\fldinst {\cs18\b PAGE }}{\fldrslt {\cs18\b\lang1024 74}}}{ +\par }}{\footerr \pard\plain \s16\nowidctlpar\widctlpar\brdrb\brdrs\brdrw30\brsp20 \tqc\tx4320\tqr\tx10080\adjustright \fs20\cgrid {\ul +\par }\pard \s16\qr\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright {\field{\*\fldinst {\cs18\b PAGE }}{\fldrslt {\cs18\b\lang1024 75}}}{ +\par }}\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\b\fs24 NAME}{\fs24 +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 setdebug - set debugging output options +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 SYNOPSIS}{\fs24 +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 #include +\par +\par int }{\b\f0 setdebug}{\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\b\f0 setdebug}}}{\f0 (int }{\i\f0 options}{\f0 ); +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 DESCRIPTION}{\fs24 +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 setdebug}{\f0 enables and disables various debugging }{\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\f0 debugging }}}{\f0 routines built into the kernel. The routines display useful debugging information to stderr (except for dbgSIG, see BUGS). Debug output is enabled by setting the corresponding bit in options, according to the following table. To turn off all debugging output, options should be set to 0. The various debug options are #defined in . +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }\pard \qj\fi-1440\li2160\nowidctlpar\widctlpar\adjustright {\f2\fs24 dbgGSOS}{\pard\plain \qj\fi-1440\li2160\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\fs24 }{\fs24 dbgGSOS}}}{\fs24 \tab prints out the call numbers of any GS/OS or ORCA/shell calls that are made. The number is printed in hexadecimal format and is prefixed with a '$' character. For this and the other GS/OS call debug options, the entire call sequence is enclosed in parenthesis '()' to ease tracing multiple levels of calls. +\par +\par }{\f2\fs24 dbgPATH}{\pard\plain \qj\fi-1440\li2160\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\fs24 }{\fs24 dbgPATH}}}{\fs24 \tab If this flag is set, every time a filename argument to a GS/OS or shell call is fully expanded the expanded version is displayed as follows: "}{\f2\fs24 EP:\~}{\fs24 ". +\par +\par }{\f2\fs24 dbgERROR}{\pard\plain \qj\fi-1440\li2160\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\fs24 }{\fs24 dbgERROR}}}{\fs24 \tab For every GS/OS call that is made, if an error occurs the error code is printed in inverse lettering in hexidecimal format. The code is prefixed with a '#' to distinguish the error code from a call code on terminals that do not support inverse mode. If no error occurs on the call, no code is printed. This option has no effect unless }{\f2\fs24 dbgGSOS}{\fs24 is also enabled. +\par +\par }{\f2\fs24 dbgSIG}{\pard\plain \qj\fi-1440\li2160\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\fs24 }{\fs24 dbgSIG}}}{\fs24 \tab This flag enables signal tracing. Each time a signal is sent, whether by kill(2), job control or keyboard, the signal number and target process is displayed. The format is: "}{\f2\fs24 kill (-signum): pid: tpid}{\fs24 ". +\par +\par }{\f2\fs24 dbgSYSCALL}{\pard\plain \qj\fi-1440\li2160\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\fs24 }{\fs24 dbgSYSCALL}}}{\fs24 \tab The parameter lists to common system calls are displayed by this option flag. The actual format of the output varies from call to call. The calls that currently support this flag are }{\b\fs24 execve}{\pard\plain \qj\fi-1440\li2160\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\fs24 }{\b\fs24 execve}}}{\fs24 (2), }{\b\fs24 fork}{\pard\plain \qj\fi-1440\li2160\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\fs24 }{\b\fs24 fork}}}{\fs24 (2), and the job control routines. +\par +\par }{\f2\fs24 dbgPBLOCK}{\pard\plain \qj\fi-1440\li2160\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\fs24 }{\fs24 dbgPBLOCK}}}{\fs24 \tab The memory address of GS/OS and Shell parameter blocks is printed for each call. As with }{\f2\fs24 dbgERROR}{\fs24 , this option has no effect unless }{\f2\fs24 dbgGSOS}{\fs24 is also enabled. +\par +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\b\fs24 RETURN VALUE}{\fs24 +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 setdebug}{\f0 returns the previous value of the debug options word. +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 SEE ALSO}{\fs24 +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 fork}{\f0 (2),}{\b\f0 execve}{\f0 (2),}{\b\f0 ioctl}{\f0 (2),}{\b\f0 kill}{\f0 (2) +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 BUGS}{\fs24 +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 Due to problems associated with signals that are sent during process termination, }{\f2 dbgSIG}{\f0 prints its information to standard output instead of standard error. +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 \sect }\sectd \linex0\endnhere\sectdefaultcl {\headerl \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx5040\tqr\tx10080\adjustright \fs20\cgrid {\fs24 SIGBLOCK(2)\tab System Calls\tab SIGBLOCK(2) +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}{\headerr \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx4680\tqr\tx9360\adjustright \fs20\cgrid {SIGBLOCK(2)\tab System Calls\tab SIGBLOCK(2) +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}{\footerl \pard\plain \s16\nowidctlpar\widctlpar\brdrb\brdrs\brdrw30\brsp20 \tqc\tx4320\tqr\tx10080\adjustright \fs20\cgrid {\ul +\par }\pard \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright {\field{\*\fldinst {\cs18\b PAGE }}{\fldrslt {\cs18\b\lang1024 76}}}{ +\par }}{\footerr \pard\plain \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright \fs20\cgrid {\ul \tab \tab +\par }\pard \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright {\tab \tab \chpgn +\par }\pard \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\b\fs24 NAME}{\fs24 +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 sigblock,sigmask - temporarily block signals +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 SYNOPSIS}{\fs24 +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 #include +\par +\par long }{\b\f0 sigblock}{\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\b\f0 sigblock}}}{\f0 (long }{\i\f0 mask}{\f0 ); +\par #define }{\b\f0 sigmask}{\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\b\f0 sigmask}}}{\f0 (}{\i\f0 signum}{\f0 ) +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 DESCRIPTION}{\fs24 +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 sigblock}{\f0 is used to temporarily block the reception of signals. The input parameter }{\i\f0 mask}{\f0 is a bit vector that specifies which signals are to be blocked; a 1 in a bit n will block signal n+1. The mask is bitwise-ored with the current signal mask to create the new signal mask. +\par }\pard \s22\qj\li720\nowidctlpar\widctlpar\adjustright {\f0 +\par }{\b\f0 sigmask}{\f0 is a macro that can be used to calculate signal }{\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\f0 signal }}}{\f0 masks for }{\b\f0 sigblock}{\f0 . It takes a signal number (}{\i\f0 signum}{\f0 ) as an argument and returns a mask that can then be passed to }{\b\f0 sigblock}{\f0 . +\par +\par If a signal is sent to a process but is blocked, the event is recorded for later release by }{\b\f0 sigsetmask}{\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\b\f0 sigsetmask}}}{\f0 (2). Blocked signals are not stacked; further occurrences of a blocked signal will overwrite any previous pending signal of the same }{\i\f0 signum}{\f0 . +\par +\par It is not possible to block SIGKILL}{\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\f0 SIGKILL}}}{\f0 , SIGCONT}{\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\f0 SIGCONT}}}{\f0 , or SIGSTOP}{\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\f0 SIGSTOP}}}{\f0 . This restriction is silently enforced by the system. +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 RETURN VALUE}{\fs24 +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 The previous value of the signal mask is returned. +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 SEE ALSO}{\fs24 +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 kill}{\f0 (2), }{\b\f0 sigsetmask}{\f0 (2), }{\b\f0 signal}{\f0 (2) +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 \sect }\sectd \linex0\endnhere\sectdefaultcl {\headerl \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx5040\tqr\tx10080\adjustright \fs20\cgrid {\fs24 SIGNAL(2)\tab System Calls\tab SIGNAL(2) +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}{\headerr \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx4680\tqr\tx9360\adjustright \fs20\cgrid {\fs24 SIGNAL(2)\tab System Calls\tab SIGNAL(2) +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}{\footerl \pard\plain \s16\nowidctlpar\widctlpar\brdrb\brdrs\brdrw30\brsp20 \tqc\tx4320\tqr\tx10080\adjustright \fs20\cgrid {\ul +\par }\pard \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright {\field{\*\fldinst {\cs18\b PAGE }}{\fldrslt {\cs18\b\lang1024 78}}}{ +\par }}{\footerr \pard\plain \s16\nowidctlpar\widctlpar\brdrb\brdrs\brdrw30\brsp20 \tqc\tx4320\tqr\tx10080\adjustright \fs20\cgrid {\ul +\par }\pard \s16\qr\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright {\field{\*\fldinst {\cs18\b PAGE }}{\fldrslt {\cs18\b\lang1024 77}}}{ +\par }}\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\b\fs24 NAME}{\fs24 +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 signal - a simplified software signal interface +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 SYNOPSIS}{\fs24 +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 #include +\par +\par void (*}{\b\f0 signal}{\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\b\f0 signal}}}{\f0 (int }{\i\f0 sig}{\f0 ; void (*}{\i\f0 func}{\f0 (void))(void) +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 DESCRIPTION}{\fs24 +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 Signals are a basic form of IPC (inter-process communication), and are generally used to notify a process of some atypical event (although there is little restriction on actual use). For example, signals are sent in each of the following situations: user typing certain chars at a terminal (^C, ^Z, etc.); execution of an invalid instruction; by request of another process (}{\b\f0 kill}{\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\b\f0 kill}}}{\f0 ); stack overflow; a process making an input request while running in the background; an attempt to write to a pipe with no reader. +\par +\par Most signals cause termination, unless a handler is installed, or the signal is set to be ignored. Certain signals cannot have their default action modified; the system silently enforces this restriction. The following is a list of signals and default actions (taken from signal.h). +\par +\par }\pard \s22\qj\li720\nowidctlpar\widctlpar\tx1440\tx2880\tx3600\adjustright {\f0 \tab SIGHUP}{\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\tx1440\tx2880\tx3600\adjustright \v\cgrid {\xe {\v\f0 }{\f0 SIGHUP}}}{\f0 \tab 1\tab hangup +\par }\pard \s22\qj\li720\nowidctlpar\widctlpar\tx1440\tx2880\tx3600\adjustright {\f0 \tab SIGINT}{\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\tx1440\tx2880\tx3600\adjustright \v\cgrid {\xe {\v\f0 }{\f0 SIGINT}}}{\f0 \tab 2\tab interrupt +\par \tab SIGQUIT}{\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\tx1440\tx2880\tx3600\adjustright \v\cgrid {\xe {\v\f0 }{\f0 SIGQUIT}}}{\f0 \tab 3\tab quit +\par \tab SIGILL}{\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\tx1440\tx2880\tx3600\adjustright \v\cgrid {\xe {\v\f0 }{\f0 SIGILL}}}{\f0 \tab 4\tab illegal instruction +\par \tab SIGTRAP}{\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\tx1440\tx2880\tx3600\adjustright \v\cgrid {\xe {\v\f0 }{\f0 SIGTRAP}}}{\f0 \tab 5\tab trace trap +\par \tab SIGABRT}{\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\tx1440\tx2880\tx3600\adjustright \v\cgrid {\xe {\v\f0 }{\f0 SIGABRT}}}{\f0 \tab 6\tab abort (generated by abort(3) routine) +\par \tab SIGEMT}{\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\tx1440\tx2880\tx3600\adjustright \v\cgrid {\xe {\v\f0 }{\f0 SIGEMT}}}{\f0 \tab 7\tab emulator trap +\par \tab SIGFPE}{\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\tx1440\tx2880\tx3600\adjustright \v\cgrid {\xe {\v\f0 }{\f0 SIGFPE}}}{\f0 \tab 8\tab arithmetic exception +\par \tab SIGKILL}{\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\tx1440\tx2880\tx3600\adjustright \v\cgrid {\xe {\v\f0 }{\f0 SIGKILL}}}{\f0 \tab 9\tab kill (cannot be caught, blocked, or ignored) +\par \tab SIGBUS}{\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\tx1440\tx2880\tx3600\adjustright \v\cgrid {\xe {\v\f0 }{\f0 SIGBUS}}}{\f0 \tab 10\tab bus error +\par \tab SIGSEGV}{\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\tx1440\tx2880\tx3600\adjustright \v\cgrid {\xe {\v\f0 }{\f0 SIGSEGV}}}{\f0 \tab 11\tab segmentation violation +\par \tab SIGSYS}{\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\tx1440\tx2880\tx3600\adjustright \v\cgrid {\xe {\v\f0 }{\f0 SIGSYS}}}{\f0 \tab 12\tab bad argument to system call +\par \tab SIGPIPE}{\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\tx1440\tx2880\tx3600\adjustright \v\cgrid {\xe {\v\f0 }{\f0 SIGPIPE}}}{\f0 \tab 13\tab write on a pipe or other socket with no one to read it +\par \tab SIGALRM}{\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\tx1440\tx2880\tx3600\adjustright \v\cgrid {\xe {\v\f0 }{\f0 SIGALRM}}}{\f0 \tab 14\tab alarm clock +\par \tab SIGTERM}{\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\tx1440\tx2880\tx3600\adjustright \v\cgrid {\xe {\v\f0 }{\f0 SIGTERM}}}{\f0 \tab 15\tab software termination signal +\par }\pard \s22\qj\li720\nowidctlpar\widctlpar\tx1440\tx2880\tx3600\adjustright {\f0 \tab SIGURG}{\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\tx1440\tx2880\tx3600\adjustright \v\cgrid {\xe {\v\f0 }{\f0 SIGURG}}}{\f0 \tab 16@\tab urgent condition present on socket +\par }\pard \s22\qj\li720\nowidctlpar\widctlpar\tx1440\tx2880\tx3600\adjustright {\f0 \tab SIGSTOP}{\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\tx1440\tx2880\tx3600\adjustright \v\cgrid {\xe {\v\f0 }{\f0 SIGSTOP}}}{\f0 \tab 17 | +\tab stop (cannot be caught, blocked, or ignored) +\par \tab SIGTSTP}{\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\tx1440\tx2880\tx3600\adjustright \v\cgrid {\xe {\v\f0 }{\f0 SIGTSTP}}}{\f0 \tab 18 | +\tab stop signal generated from keyboard +\par \tab SIGCONT}{\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\tx1440\tx2880\tx3600\adjustright \v\cgrid {\xe {\v\f0 }{\f0 SIGCONT}}}{\f0 \tab 19@\tab continue after stop (cannot be blocked) +\par \tab SIGCHLD}{\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\tx1440\tx2880\tx3600\adjustright \v\cgrid {\xe {\v\f0 }{\f0 SIGCHLD}}}{\f0 \tab 20@\tab child status has changed +\par \tab SIGCLD}{\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\tx1440\tx2880\tx3600\adjustright \v\cgrid {\xe {\v\f0 }{\f0 SIGCLD}}}{\f0 \tab 20\tab System V name for SIGCHLD +\par \tab SIGTTIN}{\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\tx1440\tx2880\tx3600\adjustright \v\cgrid {\xe {\v\f0 }{\f0 SIGTTIN}}}{\f0 \tab 21 | +\tab background read attempted from control terminal +\par \tab SIGTTOU}{\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\tx1440\tx2880\tx3600\adjustright \v\cgrid {\xe {\v\f0 }{\f0 SIGTTOU}}}{\f0 \tab 22 | +\tab background write attempted to control terminal +\par \tab SIGIO}{\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\tx1440\tx2880\tx3600\adjustright \v\cgrid {\xe {\v\f0 }{\f0 SIGIO}}}{\f0 \tab 23@\tab input/output possible on a file descriptor +\par \tab SIGPOLL}{\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\tx1440\tx2880\tx3600\adjustright \v\cgrid {\xe {\v\f0 }{\f0 SIGPOLL}}}{\f0 \tab SIGIO\tab System V name for SIGIO +\par \tab SIGXCPU}{\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\tx1440\tx2880\tx3600\adjustright \v\cgrid {\xe {\v\f0 }{\f0 SIGXCPU}}}{\f0 \tab 24\tab exceeded CPU time limit +\par \tab SIGUSR1}{\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\tx1440\tx2880\tx3600\adjustright \v\cgrid {\xe {\v\f0 }{\f0 SIGUSR1}}}{\f0 \tab 30\tab user defined signal 1 +\par \tab SIGUSR2}{\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\tx1440\tx2880\tx3600\adjustright \v\cgrid {\xe {\v\f0 }{\f0 SIGUSR2}}}{\f0 \tab 31\tab user defined signal 2 +\par }\pard \s22\qj\li720\nowidctlpar\widctlpar\adjustright {\f0 +\par If }{\i\f0 func}{\f0 is SIG_DFL}{\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\f0 SIG_DFL}}}{\f0 , the defult action for the signal is reinstalled. This is normally termination if the signal isn't ignored or caught. Signals marked with an @ are discarded, and signals marked with | + cause the process to stop. If }{\i\f0 func}{\f0 is SIG_IGN}{\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\f0 SIG_IGN}}}{\f0 , any future occurences of the signal are discarded, as well as any pending instances. Any other value is treated as the address of a handler routine. The system will block further occurences of the signal before the handler is called, and will unblock the signal automatically upon return from the handler. The handler remains installed after return, unlike earlier UNIX signal facilities. +\par +\par If a signal occurs during certain system calls (}{\b\f0 wait}{\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\b\f0 wait}}}{\f0 (), and input from a TTY), the call is automatically restarted upon return from the handler. +\par +\par A forked child inherits all signal information, including pending signals and blocking and handler information. }{\b\f0 exec}{\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\b\f0 exec}}}{\f0 () and }{\b\f0 execve}{\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\b\f0 execve}}}{\f0 () restore all signal information to defaults and purge pending signals. +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 NOTES}{\fs24 +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 The signal handler should be defined as follows: +\par +\par void }{\b\f0 handler}{\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\b\f0 handler}}}{\f0 (int }{\i\f0 sig}{\f0 , int }{\i\f0 code}{\f0 ) +\par +\par }{\i\f0 sig}{\f0 is the signal that invoked the handler, and }{\i\f0 code}{\f0 is additional information about the interrupt condition. Currently, }{\i\f0 code}{\f0 is always 0. The handler should probably also be compiled using the #pragma databank 1 directive, in the event the signal handler is not in the same bank as the C global data segment (the handler is called with the data bank equal to the program bank). +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 RETURN VALUE}{\fs24 +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 The previous action is returned on a successful call. Otherwise, -1 is returned. }{\f2 [EINVAL]}{\f0 will occur on any of the following conditions: +\par sig specifies an invalid signal number. +\par An attempt is made to ignore or supply a handler for SIGKILL}{\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\f0 SIGKILL}}}{\f0 or SIGSTOP}{\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\f0 SIGSTOP}}}{\f0 . +\par An attempt is made to ignore SIGCONT}{\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\f0 SIGCONT}}}{\f0 (by default SIGCONT}{\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\f0 SIGCONT}}}{\f0 is ignored). +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 CAVEATS}{\fs24 +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 ORCA/C already provides a signal() function, but it doesn't do a whole lot. GNO's signal.h file replaces the one that comes with ORCA. +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 SEE ALSO}{\fs24 +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 execve}{\f0 (2), }{\b\f0 fork}{\f0 (2), }{\b\f0 kill}{\f0 (2), }{\b\f0 sigblock}{\f0 (2), }{\b\f0 sigsetmask}{\f0 (2), }{\b\f0 wait}{\f0 (2), }{\b\f0 tty}{\f0 (4) +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }\pard \nowidctlpar\widctlpar\adjustright {\fs24 \sect }\sectd \linex0\endnhere\sectdefaultcl {\headerl \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx5040\tqr\tx10080\adjustright \fs20\cgrid {SIGPAUSE(2)\tab System Calls\tab SIGPAUSE(2) +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}{\headerr \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx4680\tqr\tx9360\adjustright \fs20\cgrid {\fs24 SIGPAUSE(2)\tab System Calls\tab SIGPAUSE(2) +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}{\footerl \pard\plain \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright \fs20\cgrid {\ul \tab \tab +\par }\pard \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright {\chpgn +\par }\pard \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}{\footerr \pard\plain \s16\nowidctlpar\widctlpar\brdrb\brdrs\brdrw30\brsp20 \tqc\tx4320\tqr\tx10080\adjustright \fs20\cgrid {\ul +\par }\pard \s16\qr\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright {\field{\*\fldinst {\cs18\b PAGE }}{\fldrslt {\cs18\b\lang1024 79}}}{ +\par }}\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\b\fs24 NAME}{\fs24 +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 sigpause - suspend process until a signal arrives +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\b\fs24 SYNOPSIS}{\fs24 +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 #include +\par int }{\b\f0 sigpause}{\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\b\f0 sigpause}}}{\f0 (long int }{\i\f0 mask}{\f0 ); +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 DESCRIPTION}{\fs24 +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 sigpause}{\f0 suspends execution of the calling process until a signal arrives. The }{\i\f0 mask}{\f0 parameter is assigned to the set of blocked signals (}{\b\f0 sigsetmask}{\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\b\f0 sigsetmask}}}{\f0 ), and then the process is paused. When a signal arrives, the regular signal handler (if any) is executed, and then the original signal mask is restored before returning to the caller. Usually }{\i\f0 mask}{\f0 is 0 (zero) to pause until any signal arrives. +\par +\par }{\b\f0 sigpause}{\f0 is normally used in situations where one must protect a critical section. A typical use begins with sigblock to block a signal (and enable mutual exclusion); variables modified on the occurrence of that signal are then manipulated, code is executed, etc. To end the critical section and wait for more work, sigpuase is called. +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 RETURN VALUE}{\fs24 +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 sigpause}{\f0 always returns an error (-1) and sets }{\b\f0 errno}{\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\b\f0 errno}}}{\f0 to EINTR. +\par +\par }\pard\plain \nowidctlpar\widctlpar\adjustright \fs20\cgrid {\b\fs24 SEE ALSO}{\fs24 +\par }\pard\plain \s22\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 signal}{\f0 (2), }{\b\f0 sigblock}{\f0 (2), }{\b\f0 sigsetmask}{\f0 (2) +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }\pard \nowidctlpar\widctlpar\adjustright {\fs24 \sect }\sectd \linex0\endnhere\sectdefaultcl {\headerl \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx5040\tqr\tx10080\adjustright \fs20\cgrid {\fs24 SIGSETMASK(2)\tab System Calls\tab SIGSETMASK(2) +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}{\headerr \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx4680\tqr\tx9360\adjustright \fs20\cgrid {SIGSETMASK(2)\tab System Calls\tab SIGSETMASK(2) +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}{\footerl \pard\plain \s16\nowidctlpar\widctlpar\brdrb\brdrs\brdrw30\brsp20 \tqc\tx4320\tqr\tx10080\adjustright \fs20\cgrid {\ul +\par }\pard \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright {\field{\*\fldinst {\cs18\b PAGE }}{\fldrslt {\cs18\b\lang1024 80}}}{ +\par }}{\footerr \pard\plain \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright \fs20\cgrid {\ul \tab \tab +\par }\pard \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright {\tab \tab \chpgn +\par }\pard \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\b\fs24 NAME}{\fs24 +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 sigsetmask - set signal mask +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 SYNOPSIS}{\fs24 +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 #include +\par +\par long }{\b\f0 sigsetmask}{\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\b\f0 sigsetmask}}}{\f0 (long }{\i\f0 mask}{\f0 ); +\par #define }{\b\f0 sigmask}{\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\b\f0 sigmask}}}{\f0 (}{\i\f0 signum}{\f0 ) +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 DESCRIPTION}{\fs24 +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 sigsetmask}{\f0 is usually used to restore signal masks after modification by }{\b\f0 sigblock}{\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\b\f0 sigblock}}}{\f0 . The parameter mask is the absolute value the process signal mask will be set to (compare to sigblock, which adds the argument to the set of blocked signals). +\par +\par If there are pending instances of signals which become unblocked by the }{\b\f0 sigsetmask}{\f0 call, they are 'released' into the system signal queue and their 'pending' status is cleared. The system signal queue is maintained by the kernel null process, and is used in situations where signals could not normally be sent (such as interrupt handlers). +\par +\par }{\b\f0 sigmask}{\f0 is a macro that can be used to calculate signal masks for }{\b\f0 sigsetmask}{\f0 . It takes a signal number, as listed in }{\b\f0 signal}{\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\b\f0 signal}}}{\f0 (2), as an argument and returns a mask corresponding to that signal. +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 RETURN VALUE}{\fs24 +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 The previous value of the signal mask is returned. +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 CAVEATS}{\fs24 +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 If somehow the process re-blocks a signal released by }{\b\f0 sigsetmask}{\f0 before the system signal queue processes it, it will be blocked and marked as pending. This can happen if a signal handler makes a }{\b\f0 sigblock}{\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\b\f0 sigblock}}}{\f0 call. +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 SEE ALSO}{\fs24 +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 kill}{\f0 (2), }{\b\f0 sigblock}{\f0 (2), }{\b\f0 signal}{\f0 (2) +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }\pard \nowidctlpar\widctlpar\adjustright {\fs24 \sect }\sectd \linex0\endnhere\sectdefaultcl {\headerl \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx5040\tqr\tx10080\adjustright \fs20\cgrid {\fs24 STAT(2)\tab System Calls\tab STAT(2) +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}{\headerr \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx4680\tqr\tx9360\adjustright \fs20\cgrid {\fs24 STAT(2)\tab System Calls\tab STAT(2) +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}{\footerl \pard\plain \s16\nowidctlpar\widctlpar\brdrb\brdrs\brdrw30\brsp20 \tqc\tx4320\tqr\tx10080\adjustright \fs20\cgrid {\ul +\par }\pard \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright {\field{\*\fldinst {\cs18\b PAGE }}{\fldrslt {\cs18\b\lang1024 82}}}{ +\par }}{\footerr \pard\plain \s16\nowidctlpar\widctlpar\brdrb\brdrs\brdrw30\brsp20 \tqc\tx4320\tqr\tx10080\adjustright \fs20\cgrid {\ul +\par }\pard \s16\qr\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright {\field{\*\fldinst {\cs18\b PAGE }}{\fldrslt {\cs18\b\lang1024 83}}}{ +\par }}\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\b\fs24 NAME}{\fs24 +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 stat, fstat, lstat - return status information on indicated files +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 SYNOPSIS}{\fs24 +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 #include +\par +\par int }{\b\f0 stat}{\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\b\f0 stat}}}{\f0 (const char *}{\i\f0 filename}{\f0 , struct stat *}{\i\f0 s_buf}{\f0 ); +\par int }{\b\f0 fstat}{\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\b\f0 fstat}}}{\f0 (int }{\i\f0 filedes}{\f0 , struct stat *}{\i\f0 s_buf}{\f0 ); +\par int }{\b\f0 lstat}{\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\b\f0 lstat}}}{\f0 (const char *}{\i\f0 filename}{\f0 , struct stat *}{\i\f0 s_buf}{\f0 ); +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 DESCRIPTION}{\fs24 +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 These calls are used to retreive status information about files. They do much the same thing as the GS/OS call GetFileInfo, except that they return the information in a format compatible with UNIX's stat calls, and also provide information about pipes and GNO Character Devices. +\par +\par }{\b\f0 stat}{\f0 takes arguments }{\i\f0 filename}{\f0 , a NUL-terminated string naming the file to get information on, and }{\i\f0 s_buf}{\f0 , a pointer to a }{\f2 stat}{\f0 structure, defined in . }{\i\f0 filename}{\f0 can be a partial or a complete path. The miscellaneous types in }{\f2 struct stat}{\f0 , below, are defined in , automatically included by stat.h. +\par +\par }\pard \s22\li720\ri-900\nowidctlpar\widctlpar\tx900\tx1890\tx3600\adjustright {\f2\fs20 struct stat}{\pard\plain \s22\li720\ri-900\nowidctlpar\widctlpar\tx900\tx1890\tx3600\adjustright \v\f2\fs20\cgrid {\xe {\v\f2\fs20 }{\f2\fs20 struct stat}}}{\f2\fs20 \{ +\par dev_t\tab st_dev;\tab /* ID number of device file resides on */ +\par ino_t\tab st_ino;\tab /* inode number of file */ +\par unsigned short st_mode;\tab /* type of file and mode */ +\par short\tab st_nlink;\tab /* number of links to file = 0 */ +\par uid_t\tab st_uid;\tab /* user id = 0 */ +\par gid_t\tab st_gid;\tab /* group id = 0 */ +\par dev_t\tab st_rdev;\tab /* device type ID */ +\par off_t\tab st_size;\tab /* length of file in bytes */ +\par time_t}{\f2\fs20 \tab st_atime;\tab /* last access time }{\f2\fs20 (same as mod time on Apple IIGS)}{\f2\fs20 }{\f2\fs20 */ +\par int\tab st_spare1;\tab /* reserved */ +\par time_t\tab st_mtime;\tab /* last modification time */ +\par int\tab st_spare2;\tab /* reserved */ +\par time_t\tab st_ctime;\tab /* file creation time */ +\par int\tab st_spare3;\tab /* reserved */ +\par long\tab st_blksize;\tab /* size in bytes of blocks on filesystem */ +\par long\tab st_blocks;\tab /* number of blocks file uses */ +\par long\tab st_spare4[2];\tab /* reserved */ +\par \}; +\par }\pard \s22\qj\li720\nowidctlpar\widctlpar\adjustright {\f0 +\par The items marked 'reserved' are not currently used but are reserved for future expansion; do not use these fields for any reason. }{\f2 st_dev}{\f0 is the device number the file resides on. This number is the same as the GS/OS device ID number. }{\f2 st_rdev}{\f0 is not currently used, but may in the future designate a device type code. +\par }\pard \s22\qj\li720\nowidctlpar\widctlpar\adjustright {\f0 +\par }{\f2 st_mode}{\f0 is a bit field representing access mode and type of the file. The flags in }{\f2 st_mode}{\f0 are as follows: +\par +\par #define S_IFDIR}{\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\f0 S_IFDIR}}}{\f0 \tab 0040000\tab /* directory */ +\par #define S_IFCHR}{\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\f0 S_IFCHR}}}{\f0 \tab 0020000\tab /* character special */ +\par #define S_IFBLK}{\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\f0 S_IFBLK}}}{\f0 \tab 0060000\tab /* block special */ +\par #define S_IFREG}{\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\f0 S_IFREG}}}{\f0 \tab 0100000\tab /* regular */ +\par #define S_IFLNK}{\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\f0 S_IFLNK}}}{\f0 \tab 0120000\tab /* symbolic link */ +\par }\pard \s22\qj\li720\nowidctlpar\widctlpar\adjustright {\f0 #define S_IFSOCK}{\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\f0 S_IFSOCK}}}{\f0 \tab 0140000\tab /* socket or pipe */ +\par }\pard \s22\qj\li720\nowidctlpar\widctlpar\adjustright {\f0 #define S_IREAD}{\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\f0 S_IREAD}}}{\f0 \tab 0000400\tab /* read permission, owner */ +\par #define S_IWRITE}{\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\f0 S_IWRITE}}}{\f0 \tab 0000200\tab /* write permission, owner */ +\par #define S_IEXEC}{\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\f0 S_IEXEC}}}{\f0 \tab 0000100\tab /* file is an executable, owner */ +\par +\par }{\b\f0 fstat}{\f0 }{\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\b\f0 fstat }}}{\f0 is similar to }{\b\f0 stat}{\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\b\f0 stat}}}{\f0 except the argument is an open file descriptor }{\i\f0 filedes}{\f0 . If }{\i\f0 filedes}{\f0 refers to a character device or pipe, the entire }{\f2 s_buf}{\f0 is set to 0 and only }{\f2 st_mode}{\f0 and }{\f2 st_dev}{\f0 are set. +\par +\par }{\b\f0 lstat}{\f0 }{\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\b\f0 lstat }}}{\f0 is similar to }{\b\f0 stat}{\f0 , but if the }{\i\f0 filename}{\f0 is a link then information is returned about the link file instead of the file linked to. +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 RETURN VALUE}{\fs24 +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 If the call completes without mishap, stat returns a 0. If an error occurs, }{\b\f0 stat}{\f0 returns -1 and sets errno to one of the following: +\par +\par }{\f2 [ENOENT]}{\f0 \tab }{\i\f0 filename}{\f0 does not specify an existing file or directory +\par }{\f2 [ENOTDIR]}{\f0 \tab an element of }{\i\f0 filename}{\f0 is not an expected subdirectory +\par +\par }{\b\f0 fstat}{\f0 can additionally return +\par }{\f2 [EBADF]}{\f0 \tab }{\i\f0 filedes}{\f0 does not refer to an open file descriptor +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 BUGS}{\fs24 +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 GNO does not yet support hard or symbolic file links on the IIGS. Therefore, }{\b\f0 lstat}{\f0 operates exactly like stat. But if there's a case where }{\b\f0 lstat}{\f0 might be appropriate at a time when links are supported, then use lstat instead and be ready for the future. +\par +\par }{\b\f0 fstat}{\f0 doesn't do anything clever with all the unused fields in }{\f2 struct stat}{\f0 when its argument is a pipe or terminal. +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\f4 \sect }\sectd \linex0\endnhere\sectdefaultcl {\headerl \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx4680\tqr\tx9360\adjustright \fs20\cgrid {\fs24 STATFS(2)\tab System Calls\tab STATFS(2) +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}{\headerr \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx4680\tqr\tx9360\adjustright \fs20\cgrid {\fs24 STAT}{\fs24 FS}{\fs24 (2)\tab System Calls\tab STAT}{\fs24 FS}{\fs24 (2) +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}{\footerl \pard\plain \s16\nowidctlpar\widctlpar\brdrb\brdrs\brdrw30\brsp20 \tqc\tx4320\tqr\tx10080\adjustright \fs20\cgrid {\ul +\par }\pard \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright {\field{\*\fldinst {\cs18\b PAGE }}{\fldrslt {\cs18\b\lang1024 84}}}{ +\par }}\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\b\fs24 NAME}{\fs24 +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 statfs - get file system}{\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\f0 file system}}}{\f0 statistics +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 SYNOPSIS}{\fs24 +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 #include +\par +\par int }{\b\f0 statfs}{\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\b\f0 statfs}}}{\f0 (char *}{\i\f0 path}{\f0 , struct statfs *}{\i\f0 buf}{\f0 ) +\par int }{\b\f0 fstatfs}{\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\b\f0 fstatfs}}}{\f0 (int }{\i\f0 fd}{\f0 , struct statfs *}{\i\f0 buf}{\f0 ) +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 DESCRIPTION}{\fs24 +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 statfs}{\f0 returns information about a mounted file system. }{\i\f0 path}{\f0 is the path name of any file within the mounted filesystem. }{\i\f0 Buf}{\f0 is a pointer to a statfs structure defined as follows: +\par +\par }{\f2\fs20 typedef struct \{ +\par \tab long\tab val[2]; +\par \} fsid_t; +\par +\par struct statfs}{\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \v\f2\fs20\cgrid {\xe {\v\f2\fs20 }{\f2\fs20 struct statfs}}}{\f2\fs20 \{ +\par \tab long\tab f_type; \tab /* type of info, zero for now */ +\par \tab long\tab f_bsize;\tab /* fundamental file system block size */ +\par \tab long\tab f_blocks;\tab /* total blocks in file system */ +\par \tab long\tab f_bfree;\tab /* free blocks */ +\par }\pard \s22\qj\li720\nowidctlpar\widctlpar\adjustright {\f2\fs20 \tab long\tab f_bavail;\tab /* free blocks available to non-superuser */ +\par }\pard \s22\qj\li720\nowidctlpar\widctlpar\adjustright {\f2\fs20 \tab long\tab f_files;\tab /* total file nodes in file system */ +\par \tab long\tab f_ffree;\tab /* free file nodes in fs */ +\par \tab fsid_t f_fsid; \tab /* file system id */ +\par \tab long\tab f_spare[7];\tab /* spare for later */ +\par \}; +\par }{\f0 +\par Fields that are undefined for a particular file system are set to -1. }{\b\f0 fstatfs}{\f0 returns the same information about an open file referenced by descriptor }{\i\f0 fd}{\f0 . +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 RETURN VALUE}{\fs24 +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 Upon successful completion, a value of 0 is returned. Otherwise, -1 is returned and the global variable }{\b\f0 errno}{\f0 is set to indicate the error. +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 ERRORS}{\fs24 +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 statfs}{\f0 fails if one or more of the following are true: +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }\pard \qj\fi-1440\li2160\nowidctlpar\widctlpar\adjustright {\f2\fs24 ENOTDIR}{\fs24 \tab A component of the path prefix of }{\i\fs24 path}{\fs24 is not a directory. +\par }{\f2\fs24 EINVAL}{\fs24 \tab }{\i\fs24 path}{\fs24 contains a character with the high-order bit set. +\par }{\f2\fs24 ENAMETOOLONG}{\fs24 \tab The length of a component of }{\i\fs24 path}{\fs24 exceeds 255 characters, or the length of path exceeds 1023 characters. +\par }{\f2\fs24 ENOENT}{\fs24 \tab The file referred to by }{\i\fs24 path}{\fs24 does not exist. +\par }{\f2\fs24 EACCES}{\fs24 \tab Search permission is denied for a component of the path prefix of path. +\par }{\f2\fs24 EIO}{\fs24 \tab An I/O error occurred while reading from or writing to the file system. +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\fs24 +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 fstatfs}{\f0 fails if one or both of the following are true: +\par +\par }\pard \s22\qj\fi-1440\li2160\nowidctlpar\widctlpar\adjustright {\f2 EBADF}{\f0 \tab }{\i\f0 fd}{\f0 is not a valid open file descriptor. +\par }{\f2 EIO}{\f0 \tab An I/O error occurred while reading from or writing to the file system.}{\sect }\sectd \linex0\endnhere\sectdefaultcl {\headerl \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx4680\tqr\tx9360\adjustright \fs20\cgrid {\fs24 TRUNCATE(2)\tab System Calls\tab TRUNCATE(2) +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}{\headerr \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx4680\tqr\tx9360\adjustright \fs20\cgrid {\fs24 TRUNCATE(2)\tab System Calls\tab TRUNCATE(2) +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}{\footerl \pard\plain \s16\nowidctlpar\widctlpar\brdrb\brdrs\brdrw30\brsp20 \tqc\tx4320\tqr\tx10080\adjustright \fs20\cgrid {\ul +\par }\pard \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright {\field{\*\fldinst {\cs18\b PAGE }}{\fldrslt {\cs18\b\lang1024 86}}}{ +\par }}{\footerr \pard\plain \s16\nowidctlpar\widctlpar\brdrb\brdrs\brdrw30\brsp20 \tqc\tx4320\tqr\tx9360\adjustright \fs20\cgrid {\ul +\par }\pard \s16\qr\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx9360\adjustright {\field{\*\fldinst {\cs18\b PAGE }}{\fldrslt {\cs18\b\lang1024 85}}}{ +\par }}\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\b\fs24 NAME}{\fs24 +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 truncate, ftruncate - set a file to a specified length +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 SYNOPSIS}{\fs24 +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 #include +\par +\par int }{\b\f0 truncate}{\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\b\f0 truncate}}}{\f0 (char *}{\i\f0 path}{\f0 , off_t }{\i\f0 length}{\f0 ) +\par int }{\b\f0 ftruncate}{\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\b\f0 ftruncate}}}{\f0 (int }{\i\f0 fd}{\f0 , off_t }{\i\f0 length}{\f0 ) +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 DESCRIPTION}{\fs24 +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 truncate}{\f0 () causes the file referred to by }{\i\f0 path}{\f0 (or for }{\b\f0 ftruncate}{\f0 () the object referred to by }{\i\f0 fd}{\f0 ) to have a size equal to length bytes. If the file was previously longer than length , the extra bytes are removed from the file. If it was shorter, bytes between the old and new lengths are read as zeroes. With }{\b\f0 ftruncate}{\f0 (), the file must be open for writing. +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 RETURN VALUES}{\fs24 +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 truncate}{\f0 () returns: +\par 0\tab on success. +\par -1\tab on failure and sets }{\b\f0 errno}{\f0 to indicate the error. +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\b\fs24 ERRORS}{\fs24 +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 truncate}{\f0 () may set }{\b\f0 errno}{\f0 to: +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }\pard \qj\fi-1440\li2160\nowidctlpar\widctlpar\adjustright {\f2\fs24 EACCES}{\fs24 \tab Search permission is denied for a component of the path prefix of }{\i\fs24 path}{\fs24 . +\par \tab Write permission is denied for the file referred to by }{\i\fs24 path}{\fs24 . +\par +\par }{\f2\fs24 EIO}{\fs24 \tab An I/O error occurred while reading from or writing to the file system. +\par +\par }{\f2\fs24 EISDIR}{\fs24 \tab The file referred to by }{\i\fs24 path}{\fs24 is a directory. +\par +\par }{\f2\fs24 ENAMETOOLONG}{\fs24 \tab The length of the }{\i\fs24 path}{\fs24 argument exceeds \{}{\f2\fs24 PATH_MAX}{\fs24 \}. +\par \tab A pathname component is longer than \{}{\f2\fs24 NAME_MAX}{\fs24 \} (see }{\b\fs24 sysconf}{\pard\plain \qj\fi-1440\li2160\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\fs24 }{\b\fs24 sysconf}}}{\fs24 (2V)) while \{}{\f2\fs24 _POSIX_NO_TRUNC}{\fs24 \} is in effect (see pathconf (2V)). +\par +\par }{\f2\fs24 ENOENT}{\fs24 \tab The file referred to by }{\i\fs24 path}{\fs24 does not exist. +\par +\par }{\f2\fs24 ENOTDIR}{\fs24 \tab A component of the path prefix of }{\i\fs24 path}{\fs24 is not a directory. +\par +\par }{\f2\fs24 EROFS}{\fs24 \tab The file referred to by }{\i\fs24 path}{\fs24 resides on a read-only file system. +\par +\par }{\b\fs24 ftruncate}{\fs24 () may set }{\b\fs24 errno}{\fs24 to: +\par +\par }{\f2\fs24 EINVAL}{\fs24 \tab }{\i\fs24 fd}{\fs24 is not a valid descriptor of a file open for writing. +\par \tab }{\i\fs24 fd}{\fs24 refers to a socket, not to a file. +\par +\par }{\f2\fs24 EIO}{\fs24 \tab An I/O error occurred while reading from or writing to the file system. +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\fs24 +\par }{\b\fs24 SEE ALSO}{\fs24 +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 open}{\f0 (2) +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 BUGS}{\fs24 +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 These calls should be generalized to allow ranges of bytes in a file to be discarded. +\par }\pard \s22\qj\fi-1440\li2160\nowidctlpar\widctlpar\adjustright {\f0 \sect }\sectd \marglsxn1080\margrsxn1800\linex0\endnhere\sectdefaultcl {\headerl \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx4680\tqr\tx9360\adjustright \fs20\cgrid {\fs24 WAIT(2)\tab System Calls\tab WAIT(2)}{\fs24 +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}{\headerr \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx4680\tqr\tx9360\adjustright \fs20\cgrid {\fs24 WAIT(2)\tab System Calls\tab WAIT(2) +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}{\footerl \pard\plain \s16\nowidctlpar\widctlpar\brdrb\brdrs\brdrw30\brsp20 \tqc\tx4320\tqr\tx10080\adjustright \fs20\cgrid {\ul +\par }\pard \s16\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright {\field{\*\fldinst {\cs18\b PAGE }}{\fldrslt {\cs18\b\lang1024 102}}}{ +\par }}{\footerr \pard\plain \s16\nowidctlpar\widctlpar\brdrb\brdrs\brdrw30\brsp20 \tqc\tx4320\tqr\tx10080\adjustright \fs20\cgrid {\ul +\par }\pard \s16\qr\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx10080\adjustright {\field{\*\fldinst {\cs18\b PAGE }}{\fldrslt {\cs18\b\lang1024 101}}}{ +\par }}\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\b\fs24 NAME}{\fs24 +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 wait, WIFSTOPPED, WIFSIGNALED, WIFEXITED - wait for process to terminate or stop +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 SYNOPSIS}{\fs24 +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 #include +\par +\par int }{\b\f0 wait}{\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\b\f0 wait}}}{\f0 (union wait *}{\i\f0 statusp}{\f0 ); +\par }{\b\f0 WIFSTOPPED}{\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\b\f0 WIFSTOPPED}}}{\f0 (union wait }{\i\f0 status}{\f0 ); +\par }{\b\f0 WIFSIGNALED}{\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\b\f0 WIFSIGNALED}}}{\f0 (union wait }{\i\f0 status}{\f0 ); +\par }\pard \s22\qj\li720\nowidctlpar\widctlpar\adjustright {\b\f0 WIFEXITED}{\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\b\f0 WIFEXITED}}}{\f0 (union wait }{\i\f0 status}{\f0 ); +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 DESCRIPTION}{\fs24 +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 wait}{\f0 blocks the caller until a signal is received or one of its child processes terminates. If any child has died and this has not been reported using wait, return is immediate, returning the process ID and exit status of one of those children. If that child had died, it is discarded. If there are no children, return is immediate with the value -1 returned. If there are processes that have not been reported by wait, the caller is blocked. +\par +\par If }{\i\f0 status}{\f0 is not a NULL pointer, then on return from a successful }{\b\f0 wait}{\f0 call the status of the child process whose process ID is the return value of wait is stored in the }{\f2 wait union}{\f0 pointed to by status. The wstatus member of that union is an int; it indicates the cause of termination and other information about the terminated process in the following manner: +\par +\par }\pard \s22\qj\fi-720\li1440\nowidctlpar\widctlpar\adjustright {\f0 \bullet \tab If the low-order 8 bits of }{\i\f0 wstatus}{\f0 are equal to 0177 (hex 0xFF), the child process has stopped; the high-order 8 bits of }{\i\f0 wstatus}{\f0 contain the number of the signal that caused the process to stop. See }{\b\f0 signal}{\pard\plain \s22\qj\fi-720\li1440\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\b\f0 signal}}}{\f0 (2). +\par +\par \bullet \tab If the low-order 8 bits of }{\i\f0 wstatus}{\f0 are non-zero and are not equal to 0177, the child process terminated due to a signal; the low-order 7 bits of }{\i\f0 wstatus}{\f0 contain the number of the signal that terminated the process. +\par +\par \bullet \tab Otherwise, the child process terminated due to an }{\b\f0 exit}{\pard\plain \s22\qj\fi-720\li1440\nowidctlpar\widctlpar\adjustright \v\cgrid {\xe {\v\f0 }{\b\f0 exit}}}{\f0 () call; the high-order 8 bits of wstatus contain the low-order 8 bits of the argument that the child process passed to }{\b\f0 exit}{\f0 or GS/OS Quit. +\par }\pard \s22\qj\li720\nowidctlpar\widctlpar\adjustright {\f0 +\par Other members of the }{\f2 wait union}{\f0 can be used to extract this information more conveniently: +\par +\par }\pard \s22\qj\fi-720\li1440\nowidctlpar\widctlpar\adjustright {\f0 \bullet \tab If the }{\f2 wstopval}{\f0 member has the value }{\f2 WSTOPPED}{\f0 , the child process has stopped; the value of the }{\f2 wstopsig}{\f0 member is the signal that stopped the process. +\par +\par \bullet \tab If the }{\f2 wtermsig}{\f0 member is non-zero, the child process terminated due to a signal; the value of the }{\f2 wtermsig}{\f0 member is the number of the signal that terminated the process. +\par +\par \bullet \tab Otherwise, the child process terminated due to an }{\b\f0 exit}{\f0 () call; the value of the }{\f2 wretcode}{\f0 member is the low-order 8 bits of the argument that the child process passed to }{\b\f0 exit}{\f0 (). +\par }\pard \s22\qj\li720\nowidctlpar\widctlpar\adjustright {\f0 +\par The other members of the }{\f2 wait union}{\f0 merely provide an alternate way of analyzing the status. The value stored in the }{\f2 wstatus}{\f0 field is compatible with the values stored by versions of the UNIX system, and an argument of type}{\f2 int *}{\f0 may be provided instead of an argument of type }{\f2 union wait *}{\f0 for compatibility with those versions. +\par }\pard \s22\qj\li720\nowidctlpar\widctlpar\adjustright {\f0 +\par }{\b\f0 WIFSTOPPED}{\f0 , }{\b\f0 WIFSIGNALED}{\f0 , }{\b\f0 WIFEXITED}{\f0 , are macros that take an argument }{\i\f0 status}{\f0 , of type `}{\f2 union wait}{\f0 ', as returned by }{\b\f0 wait}{\f0 (). }{\b\f0 WIFSTOPPED}{\f0 evaluates to true (1) when the process for which the }{\b\f0 wait}{\f0 call was made is stopped, or to false (0) otherwise. }{\b\f0 WIFSIGNALED}{\f0 evaluates to true when the process was terminated with a signal. }{\b\f0 WIFEXITED}{\f0 evaluates to true when the process exited by using an }{\b\f0 exit}{\f0 (2) call. +\par +\par If }{\b\f0 wait}{\f0 returns due to a stopped or terminated child process, the process ID of the child is returned to the calling process. Otherwise, a value of -1 is returned and }{\b\f0 errno}{\f0 is set to indicate the error. +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 ERRORS}{\fs24 +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 wait will fail and return immediately if one or more of the following are true: +\par +\par }{\f2 [ECHILD]}{\f0 \tab The calling process has no existing unwaited-for child processes. +\par }{\f2 [EFAULT]}{\f0 \tab The status or rusage arguments point to an illegal address. +\par }{\f2 [EINTR]}{\f0 \tab The wait call was interrupted by a caught signal. +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 SEE ALSO}{\fs24 +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f0 signal}{\f0 (2), }{\b\f0 exit}{\f0 (3), }{\b\f0 rexit}{\f0 (3), }{\b\f0 execve}{\f0 (2) +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }{\b\fs24 NOTES}{\fs24 +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 If a parent process terminates without waiting on its children, the Kernel Null Process (process ID = 0) inherits the children. +\par +\par }{\b\f0 wait}{\f0 is automatically restarted when a process receives a signal while awaiting termination of a child process, if the signal is not caught; i.e. }{\b\f0 signal}{\f0 () handler value is SIG_DFL or SIG_IGN. +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\fs24 +\par }\pard\plain \s22\qj\fi-1440\li2160\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 \sect }\sectd \marglsxn1080\margrsxn1800\linex0\endnhere\sectdefaultcl {\headerl \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx4680\tqr\tx9360\adjustright \fs20\cgrid {\fs24 LIBC(3)\tab Device Drivers\tab LIBC(3)}{\fs24 +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}{\headerr \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx4680\tqr\tx9360\adjustright \fs20\cgrid {\fs24 LIBC(3)\tab Device Drivers\tab LIBC(3)}{\fs24 +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\f6 GSString255Ptr }{\b\f6 __C2GSMALLOC}{\f6 (char *}{\i\f6 s}{\f6 ) +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4\fs24 Converts a C-style string to a Class 1 GS/OS string, allocating space for the GS/OS string from C's malloc() routine. You must specifically deallocate the string with free() when you're through with it. +\par }{\f4 +\par }{\f6 char *}{\b\f6 __GS2CMALLOC}{\f6 (GSString255Ptr }{\i\f6 g}{\f6 ) +\par }{\f4\fs24 Converts a Class 1 GS/OS string to a C-style string, allocating space for the C string from C's malloc() routine. You must specifically deallocate the string with free() when you're through with it. +\par +\par }{\f6 char *}{\b\f6 __GS2C}{\f6 (char *}{\i\f6 s}{\f6 , GSString255Ptr }{\i\f6 g}{\f6 ) +\par }{\f4\fs24 Converts a Class 1 GS/OS string to a C string; the buffer space for the C string must be allocated beforehand by the caller. The return value is the address of the C string passed as argument s. +\par +\par }{\f6 int }{\b\f6 _mapErr}{\f6 (int }{\i\f6 err}{\f6 )}{\f6\fs24 +\par }{\f4\fs24 Tries to map a GS/OS error code (err) to a UNIX errno code (return value). If there is no direct mapping, EIO is returned. +\par +\par }{\b\f4\fs24 access}{\f4\fs24 +\par +\par }{\f6 #include +\par int }{\b\f6 access}{\f6 (char *}{\i\f6 name}{\f6 , int }{\i\f6 mode}{\f6 ) +\par }{\f4\fs24 +\par Returns TRUE (1) if the file specified by }{\i\f4\fs24 name}{\f4\fs24 can be acessed according to }{\i\f4\fs24 mode}{\f4\fs24 by the calling process. Values of mode are declared in and are as follows: +\par }\pard \qj\li720\nowidctlpar\widctlpar\adjustright {\f4\fs24 F_OK - returns true if the file exists +\par X_OK - returns true if the process has execution permissions for the file +\par W_OK - returns true if the process has write permissions for the file +\par R_OK - returns true if the process has read permissions for the file +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4\fs24 +\par }{\b\f4\fs24 bcopy bzero}{\f4\fs24 +\par +\par }{\f6 #include +\par void }{\b\f6 bcopy}{\f6 (char *}{\i\f6 b1}{\f6 , char *}{\i\f6 b2}{\f6 , size_t }{\i\f6 n}{\f6 ) +\par void }{\b\f6 bzero}{\f6 (char *}{\i\f6 buf}{\f6 , size_t }{\i\f6 n}{\f6 ) +\par }{\f4\fs24 +\par }{\b\f4\fs24 bcopy}{\f4\fs24 () copies }{\i\f4\fs24 n}{\f4\fs24 bytes from memory address }{\i\f4\fs24 b1}{\f4\fs24 to memory address }{\i\f4\fs24 b2}{\f4\fs24 . }{\b\f4\fs24 bcopy}{\f4\fs24 () is functionally similar to }{\b\f4\fs24 memcpy}{\f4\fs24 (), except that bcopy copies from the first argument to the second argument, whereas }{\b\f4\fs24 memcpy}{\f4\fs24 () copies from the second argument to the first argument. If the memory areas overlap, the results are unpredictable. }{\b\f4\fs24 bcopy}{\f4\fs24 () is provided for compatibility with BSD source code. +\par +\par }{\b\f4\fs24 bzero}{\f4\fs24 () clears n bytes of memory starting at }{\i\f4\fs24 buf}{\f4\fs24 to 0 (zero). This call is functionally equivalent to }{\b\f4\fs24 memset}{\f4\fs24 (buf,0,n) and is included for BSD source code compatibilty. +\par See Also: }{\b\f4\fs24 memcpy}{\f4\fs24 , }{\b\f4\fs24 memset}{\f4\fs24 , }{\i\f4\fs24 ORCA/C 2.0 Manual}{\f4\fs24 +\par }{\f4\fs24 +\par +\par +\par }{\f4\fs24 +\par }{\b\f4\fs24 chdir}{\f4\fs24 +\par +\par }{\f6 #include +\par int }{\b\f6 chdir}{\f6 (const char *}{\i\f6 pathname}{\f6 )}{\f4 +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4\fs24 Changes the current working directory (GS/OS prefix 0) to the pathname specified by }{\i\f4\fs24 pathname}{\f4\fs24 . If an error occurs changing the prefix, -1 is returned and the error code is placed in }{\b\f4\fs24 errno}{\f4\fs24 . +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4\fs24 +\par }{\b\f4\fs24 crypt}{\f4\fs24 +\par +\par }{\f6 char *}{\b\f6 crypt}{\f6 (char *}{\i\f6 pw}{\f6 ,char *}{\i\f6 salt}{\f6 ) +\par }{\f4\fs24 +\par }{\b\f4\fs24 crypt}{\f4\fs24 is used to encrypt passwords for storage in the /etc/passwd file, and also to validate passwords entered in the login and passwd programs. }{\i\f4\fs24 pw}{\f4\fs24 is the password to encrypt, a NUL- terminated string. }{\i\f4\fs24 salt}{\f4\fs24 is a two- character encryption key that should be randomly generated by the caller in the case of encrypting a new password, or should be taken as the first two characters of the /etc/passwd password entry in the case of validating a password. +\par +\par }{\b\f4\fs24 crypt}{\f4\fs24 returns a pointer to the encrypted password, which is formatted as printable ASCII characters and is NUL terminated. A static buffer is used to hold the result, so to be sure the encrypted password is not overwritten by a subsequent call to }{\b\f4\fs24 crypt}{\f4\fs24 copy it before use. +\par See also: }{\b\f4\fs24 getpass}{\f4\fs24 , }{\b\f4\fs24 getpwent}{\f4\fs24 +\par +\par }{\b\f4\fs24 errno strerror perror}{\f4\fs24 +\par +\par }{\f6 char *}{\b\f6 strerror}{\f6 (int }{\i\f6 errnum}{\f6 ) +\par void }{\b\f6 perror}{\f6 (char *}{\i\f6 s}{\f6 ) +\par extern int }{\b\f6 errno}{\f6 ; +\par }{\f4\fs24 +\par These routines are as documented in the ORCA/C manual, except that they support the full range of GNO's errno codes. }{\b\f4\fs24 errno}{\f4\fs24 is the variable that most library and kernel calls place their return status in. The codes are defined symbolically in and are listed here: +\par \tab EDOM\tab domain error +\par \tab ERANGE\tab number too large, too small, or illegal +\par \tab ENOMEM\tab Not enough memory +\par \tab ENOENT\tab No such file or directory +\par \tab EIO\tab \tab I/O error +\par \tab EINVAL\tab Invalid argument +\par \tab EBADF\tab bad file descriptor +\par \tab EMFILE\tab too many files are open +\par \tab EACCESS\tab access bits prevent the operation +\par \tab EEXIST\tab the file exists +\par \tab ENOSPC\tab the file is too large +\par \tab EPERM\tab Not owner +\par \tab ESRCH\tab No such process +\par \tab EINTR\tab Interrupted system call +\par \tab E2BIG\tab Arg list too long +\par \tab ENOEXEC\tab Exec format error +\par \tab ECHILD\tab No children +\par \tab EAGAIN\tab No more processes +\par \tab ENOTDIR\tab Not a directory +\par \tab ENOTTY\tab Not a terminal +\par \tab EPIPE\tab Broken pipe +\par \tab ESPIPE\tab Illegal seek +\par \tab ENOTBLK\tab not a block device +\par \tab EISDIR\tab not a plain file +\par +\par }{\b\f4\fs24 fsync}{\f4\fs24 +\par +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f6 int }{\b\f6 fsync}{\f6 (int }{\i\f6 fd}{\f6 )}{\f6\fs24 +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4\fs24 +\par Causes the operating system to flush any I/O buffers associated with the file referenced by file descriptor fd to disk. This ensures that all information is up to date, in the event of a system crash. This call is only needed in special circumstances, as when several daemon processes are all modifying the same file simultaneously (currently impossible with existing IIGS filesystems). This call is basically a }{\b\f4\fs24 FlushGS}{\f4\fs24 . +\par +\par }{\b\f4\fs24 ftruncate}{\f4\fs24 +\par +\par }{\f6 int }{\b\f6 ftruncate}{\f6 (int }{\i\f6 fd}{\f6 , off_t }{\i\f6 length}{\f6 )}{\f6\fs24 +\par }{\f4\fs24 +\par Causes the EOF marker for the file specified by file descriptor }{\i\f4\fs24 fd}{\f4\fs24 to be set to length. In the event of an error, ftruncate returns -1 and sets errno. +\par +\par }{\b\f4\fs24 getgrnam getgrgid getgrent setgrent setgroupent endgrent}{\f4\fs24 +\par +\par }{\f6 #include +\par #include +\par struct group *}{\b\f6 getgrnam}{\f6 (const char *}{\i\f6 name}{\f6 ); +\par struct group *}{\b\f6 getgrgid}{\f6 (gid_t }{\i\f6 gid}{\f6 ); +\par struct group *}{\b\f6 getgrent}{\f6 (void); +\par int }{\b\f6 setgrent}{\f6 (void); +\par int }{\b\f6 setgroupent}{\f6 (int }{\i\f6 stayopen}{\f6 ); +\par void }{\b\f6 endgrent}{\f6 (void); +\par }{\f4\fs24 (POSIX) +\par +\par This family of functions should be used to access the groups database; applications should never read /etc/groups directly, as the implementation of the groups database is subject to change. +\par +\par }{\b\f4\fs24 getgrnam}{\f4\fs24 () reads the group database based on group name. It looks up the supplied group name and returns a pointer to a struct group (see below), or NULL on an error. +\par +\par }{\b\f4\fs24 getgrgid}{\f4\fs24 () is similar to }{\b\f4\fs24 getgrnam}{\f4\fs24 (), except that instead of looking up group information based on group name, a group ID is passed. +\par +\par To scan the groups database linearly, start the scan with either }{\b\f4\fs24 setgrent}{\f4\fs24 () or }{\b\f4\fs24 setgroupent}{\f4\fs24 (). The two functions are identical for pure scanning operations, but have different behavior when mixing scan calls with }{\b\f4\fs24 getgrnam}{\f4\fs24 () or }{\b\f4\fs24 getgrgid}{\f4\fs24 (). +\par +\par After calling }{\b\f4\fs24 setgrent}{\f4\fs24 or }{\b\f4\fs24 setgroupent}{\f4\fs24 , the scan is set to the first entry in the database. }{\b\f4\fs24 getgrent}{\f4\fs24 returns a pointer to the current entry and moves the scan to the next entry. In the event of an error, }{\b\f4\fs24 getgrent}{\f4\fs24 returns NULL. When the program is done with the database, }{\b\f4\fs24 endgrent}{\f4\fs24 should be called.}{\f4\fs24 +\par }{\f4\fs24 +\par If }{\b\f4\fs24 getgrnam}{\f4\fs24 or }{\b\f4\fs24 getgrgid}{\f4\fs24 is called while scanning the group database, the database will be closed unless it was opened by calling setgroupent with an argument of 1. This indicates "keep open" mode, and allows fast random access of the database with the }{\b\f4\fs24 getgrnam}{\f4\fs24 and getgrgid functions (which would otherwise open and close the database for every call). +\par +\par }{\b\f4\fs24 getopt getopt_restart}{\f4\fs24 +\par +\par }{\f6 #include +\par int }{\b\f6 getopt}{\f6 (int }{\i\f6 argc}{\f6 , char * const *}{\i\f6 argv}{\f6 , const char *}{\i\f6 optstring}{\f6 ) +\par int }{\b\f6 getopt_restart}{\f6 (void) +\par extern char *}{\b\f6 optarg}{\f6 ; +\par extern int }{\b\f6 optind}{\f6 ; +\par }{\f4\fs24 +\par }{\b\f4\fs24 Getopt}{\f4\fs24 helps parse command line options as are often used by UNIX utilities. It handles simple flags (such as "ls -l") and also flags with arguments ("cc -o prog prog.c"). +\par +\par }{\b\f4\fs24 Getopt}{\f4\fs24 returns the next option letter in argv that matches a letter in optstring. }{\i\f4\fs24 Optstring}{\f4\fs24 is a string of recognized option letters; if a letter is followed by a colon, the option is expected to have an argument that may or may not be separated from it by white space. }{\b\f4\fs24 Optarg}{\f4\fs24 is set to point to the start of the option argument on return from getopt. +\par +\par }{\b\f4\fs24 Getopt}{\f4\fs24 places in }{\b\f4\fs24 optind}{\f4\fs24 the argv index of the next argument to be processed. Because }{\b\f4\fs24 optind}{\f4\fs24 is external, it is normally initialized to zero automatically before the first call to }{\b\f4\fs24 getopt}{\f4\fs24 . +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4\fs24 +\par When all options have been processed (i.e., up to the first non-option argument), getopt returns EOF. The special option -- may be used to delimit the end of the options; EOF will be returned, and -- will be skipped. +\par +\par }{\b\f4\fs24 Getopt}{\f4\fs24 prints an error message on stderr and returns a question mark (?) when it encounters an option letter not included in }{\i\f4\fs24 optstring}{\f4\fs24 . +\par +\par The following code fragment shows how one might process the arguments for a command that can take the mutually exclusive options a and b, and the options f and o, both of which require arguments: +\par +\par }{\f6\fs24 \tab }{\f6 main(int argc, char **argv) +\par \tab \{ +\par \tab int c; +\par \tab extern int optind; +\par \tab extern char *optarg; +\par +\par \tab while ((c = getopt(argc, argv, "abf:o:")) != EOF) +\par \tab \tab switch (c) \{ +\par \tab \tab case `a': +\par \tab \tab \tab if (bflg) +\par \tab \tab \tab errflg++; +\par \tab \tab \tab else +\par \tab \tab \tab aflg++; +\par \tab \tab \tab break; +\par \tab \tab case `b': +\par \tab \tab \tab if (aflg) +\par \tab \tab \tab errflg++; +\par \tab \tab \tab else +\par \tab \tab \tab bproc(); +\par \tab \tab \tab break; +\par \tab \tab case `f': +\par \tab \tab \tab ifile = optarg; +\par \tab \tab \tab break; +\par \tab \tab case `o': +\par \tab \tab \tab ofile = optarg; +\par \tab \tab \tab break; +\par \tab \tab case `?': +\par \tab \tab default: +\par \tab \tab \tab errflg++; +\par \tab \tab \tab break; +\par \tab \tab \} +\par \tab if (errflg) \{ +\par \tab \tab fprintf(stderr, "Usage: ..."); +\par \tab \tab exit(2); +\par \tab \} +\par \tab for (; optind < argc; optind++) \{ +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f6 \tab \tab . +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f6 \} +\par \tab . +\par \tab \} +\par }{\f4\fs24 +\par It is not obvious how `-' standing alone should be treated; this version treats it as a non-option argument, which is not always right. Option arguments are allowed to begin with `-'; this is reasonable but reduces the amount of error checking possible. +\par +\par }{\b\f4\fs24 getopt_restart}{\f4\fs24 should be used in restartable programs, before the first call to }{\b\f4\fs24 getopt}{\f4\fs24 , to reinitialize the }{\b\f4\fs24 optind}{\f4\fs24 and }{\b\f4\fs24 optarg}{\f4\fs24 variables. +\par +\par }{\b\f4\fs24 getpass}{\f4\fs24 +\par +\par }{\f6 char *}{\b\f6 getpass}{\f6 (const char *}{\i\f6 prompt}{\f6 ) +\par }{\f4\fs24 BSD +\par +\par Prompts the user for a password, and returns a pointer to a NUL-terminated string which contains the password the user typed. A password may be up to 8 characters long, and if the string the user +\par types is longer than that the returned string is truncated to 8 characters. Argument }{\i\f4\fs24 prompt}{\f4\fs24 is the string to print before requesting input. Input characters are obscured - that is, not echoed - as the user types them. The backspace and delete keys may be used to edit input, although in practice this is difficult to use because the user cannot see what he types. +\par +\par A static buffer is used to to hold the password, so to be sure the password is not overwritten by a subsequent call to getpass, copy it before use. +\par See also: }{\b\f4\fs24 crypt}{\f4\fs24 , }{\b\f4\fs24 getpwent}{\f4\fs24 +\par +\par }{\b\f4\fs24 getpwnam getpwuid endpwent setpwent}{\f4\fs24 +\par +\par }{\f6 #include +\par struct passwd *}{\b\f6 getpwnam}{\f6 (const char *}{\i\f6 name}{\f6 ); +\par struct passwd *}{\b\f6 getpwuid}{\f6 (uid_t }{\i\f6 uid}{\f6 ); +\par void }{\b\f6 endpwent}{\f6 (void); +\par struct passwd *}{\b\f6 getpwent}{\f6 (void); +\par int }{\b\f6 setpwent}{\f6 (void); +\par }{\f4\fs24 +\par The family of functions defined in are used for accessing the /etc/passwd user database. Programs should never access this database directly, as the file format or other implementation details may change in the future. +\par +\par }{\b\f4\fs24 getpwnam}{\f4\fs24 () reads the user database based on user name. The argument }{\i\f4\fs24 name}{\f4\fs24 is a pointer to the user name to lookup. }{\b\f4\fs24 getpwnam}{\f4\fs24 () returns a pointer to a passwd structure or NULL on an error. +\par +\par }{\b\f4\fs24 getpwuid}{\f4\fs24 () reads the user database based on a user ID code. Argument }{\i\f4\fs24 uid}{\f4\fs24 is the user ID to return information on. }{\b\f4\fs24 getpwuid}{\f4\fs24 () returns a pointer to a passwd structure or NULL on an error. +\par +\par The remaining three functions are used for scanning the user database. The database is initialized by using the }{\b\f4\fs24 setpwent}{\f4\fs24 () function; an internal access marker is set to the first entry in the database. +\par +\par }{\b\f4\fs24 getpwent}{\f4\fs24 () is used to retrieve the current entry, returning a pointer to a passwd structure, and moving the marker to the next entry. If there are no more entries to scan, }{\b\f4\fs24 getpwent}{\f4\fs24 () returns a NULL pointer. If the database should be scanned again, }{\b\f4\fs24 setpwent}{\f4\fs24 () may be called again to reset the marker to the first entry. In the event of an error accessing the database, NULL is returned. +\par +\par When the application is through with the database, it should call endpwent(). +\par +\par }{\f6 struct\tab passwd \{ /* see getpwent(3) */ +\par \tab char\tab *pw_name;\tab \tab /* pointer to user name */ +\par \tab char\tab *pw_passwd;\tab \tab /* pointer to encrypted password */ +\par \tab int\tab pw_uid;\tab \tab /* user ID */ +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f6 \tab int\tab pw_gid;\tab \tab /* group ID */ +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f6 \tab int\tab pw_quota;\tab \tab /* 'quota' field - not used */ +\par \tab char\tab *pw_comment;\tab /* pointer Comment field */ +\par \tab char\tab *pw_gecos;\tab \tab /* not used */ +\par \tab char\tab *pw_dir;\tab \tab /* pointer to user's '$home' directory name */ +\par \tab char\tab *pw_shell;\tab \tab /* pointer to path of user's login shell */ +\par \}; +\par }{\f4\fs24 +\par Not all of the string entries in struct passwd are used in GNO/ME, but those that are are all NUL- terminated strings. +\par +\par }{\b\f4\fs24 getwd}{\f4\fs24 +\par +\par }{\f6 #include +\par char *}{\b\f6 getwd}{\f6 (char *}{\i\f6 pathname}{\f6 ) +\par }{\f4\fs24 +\par Gets the current working directory (GS/OS prefix 0) and copies it to the string space pointed to by }{\i\f4\fs24 pathname}{\f4\fs24 . }{\i\f4\fs24 pathname}{\f4\fs24 must point to a buffer large enough to hold the largest conceivable pathname. In practice, a 256 byte buffer works well, but with the plethora of GS/OS file systems now available 256 may be much too small. Due to this problem, we recommend you use }{\b\f4\fs24 getwd}{\f4\fs24 carefully, and with a future GNO release switch to getcwd (not yet available). +\par If an error occurs during the operation, }{\b\f4\fs24 getwd}{\f4\fs24 returns NULL and places the error code in }{\b\f4\fs24 errno}{\f4\fs24 . Otherwise, }{\b\f4\fs24 getwd}{\f4\fs24 returns the prefix in }{\i\f4\fs24 pathname}{\f4\fs24 . +\par +\par }{\b\f4\fs24 gtty stty}{\f4\fs24 +\par +\par }{\f6 #include +\par int }{\b\f6 gtty}{\f6 (int }{\i\f6 filedes}{\f6 , struct sgttyb *}{\i\f6 argp}{\f6 ) +\par int }{\b\f6 stty}{\f6 (int }{\i\f6 filedes}{\f6 , struct sgttyb *}{\i\f6 argp}{\f6 ) +\par }{\f4\fs24 +\par Set and get TTY status information in the sgttyb structures pointed to by the argument argp. See }{\b\f4\fs24 ioctl}{\f4\fs24 (2) and }{\b\f4\fs24 tty}{\f4\fs24 (4) for more details. These routines are basically short-cuts to +\par ioctl(filedes, TIOCSETP, &structure) and ioctl(filedes, TIOCGETP, &structure). +\par +\par }{\b\f4\fs24 index rindex}{\f4\fs24 +\par +\par }{\f6 char *}{\b\f6 index}{\f6 (char *}{\i\f6 a}{\f6 , int }{\i\f6 b}{\f6 ) +\par char *}{\b\f6 rindex}{\f6 (char *}{\i\f6 a}{\f6 , int }{\i\f6 b}{\f6 ) +\par }{\f4\fs24 (BSD) +\par +\par These functions are identical to }{\b\f4\fs24 strchr}{\f4\fs24 () and }{\b\f4\fs24 strrchr}{\f4\fs24 (), respectively. See your C compiler manual for more information. These functions are provided only for compatibility with BSD source code. +\par }{\b\f4\fs24 +\par isatty}{\f4\fs24 +\par +\par }{\f6 #include +\par int }{\b\f6 isatty}{\f6 (int }{\i\f6 filedes}{\f6 )}{\f6\fs24 +\par }{\f4\fs24 +\par This function returns true (1) if the file descriptor refers to a TTY (this includes PTYs) file. For all other types of descriptors, false (0) is returned. +\par +\par }{\b\f4\fs24 login}{\f4\fs24 +\par +\par }{\f6 #include +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f6 void }{\b\f6 login}{\f6 (struct utmp *}{\i\f6 ut}{\f6 ) +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4\fs24 +\par Writes the /etc/utmp structure pointed to by ut to the utmp file. The slot in /etc/utmp actually written to depends on the return value of the }{\b\f4\fs24 ttyslot}{\f4\fs24 () function, which maps each tty device to a unique slot number, based on the contents of /etc/ttys. +\par +\par This function should not generally be used by application code. +\par +\par }{\b\f4\fs24 mkdir}{\f4\fs24 +\par +\par }{\f6 int }{\b\f6 mkdir}{\f6 (char *}{\i\f6 dirname}{\f6 ) +\par }{\f4\fs24 +\par Creates a subdirectory (folder) with the name specified by dirname. Similar to the shell }{\b\f4\fs24 'mkdir'}{\f4\fs24 command. +\par +\par }{\b\f4\fs24 mktemp mkstemp}{\f4\fs24 +\par +\par }{\f6 char *}{\b\f6 mktemp}{\f6 (char *}{\i\f6 path}{\f6 ) +\par int }{\b\f6 mkstemp}{\f6 (char *}{\i\f6 path}{\f6 ) +\par }{\f4\fs24 +\par Creates a filename based on the string path that is guaranteed to be unique. The string path must have the following format: +\par +\par "/volume/dir1/.../dirX/fileXXXXXX" (Colons are also accepted as delimiters) +\par +\par The 'XXXXX' at the end of path is filler space that will be replaced with a string that will make path a unique filename. +\par +\par The unique string is generated by using the current process ID and a single character ASCII value; this may change in the future, and as such this behavior should not be relied upon. +\par +\par }{\b\f4\fs24 mktemp}{\f4\fs24 () does not actually create any files, as compared with }{\b\f4\fs24 tmpfile}{\f4\fs24 () in the C library. +\par +\par }{\b\f4\fs24 mkstemp}{\f4\fs24 () does create a file by calling }{\b\f4\fs24 open}{\f4\fs24 () on a unique pathname generated with }{\b\f4\fs24 mktemp}{\f4\fs24 (). +\par +\par }{\b\f4\fs24 mktemp}{\f4\fs24 () returns a pointer to the new pathname (}{\i\f4\fs24 path}{\f4\fs24 ), and }{\b\f4\fs24 mkstemp}{\f4\fs24 () returns a file descriptor to the new file, as would be returned by }{\b\f4\fs24 open}{\f4\fs24 (). +\par +\par }{\b\f4\fs24 open creat close read write lseek}{\f4\fs24 +\par +\par }{\f6 #include +\par int }{\b\f6 creat}{\f6 (const char *}{\i\f6 path}{\f6 , int }{\i\f6 mode}{\f6 ) +\par int }{\b\f6 open}{\f6 (const char *}{\i\f6 path}{\f6 , int }{\i\f6 oflag}{\f6 , ...) +\par int }{\b\f6 close}{\f6 (int }{\i\f6 filds}{\f6 ) +\par int }{\b\f6 read}{\f6 (int }{\i\f6 filds}{\f6 , void *}{\i\f6 buf}{\f6 , size_t }{\i\f6 count}{\f6 ) +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f6 int }{\b\f6 write}{\f6 (int }{\i\f6 filds}{\f6 , void *}{\i\f6 buf}{\f6 , size_t }{\i\f6 count}{\f6 ) +\par long }{\b\f6 lseek}{\f6 (int }{\i\f6 filds}{\f6 , long }{\i\f6 offset}{\f6 , int }{\i\f6 whence}{\f6 ) +\par }{\f4\fs24 +\par These are similar to the low-level I/O routines provided by ORCA/C. However, the GNO versions of these routines deal with actual GS/OS refNums for filds. (ORCA/C's versions use a special library-maintained definition of file descriptor in order to fake the UNIX }{\b\f4\fs24 dup}{\f4\fs24 () system call. Here they revert to standard UNIX usage because GNO provides a real }{\b\f4\fs24 dup}{\f4\fs24 (2) handled within the kernel). +\par +\par }{\b\f4\fs24 open}{\f4\fs24 () uses vararg (variable argument) parameters. The third parameter is only expected (and is required) if O_CREAT is one of the flags specified in '}{\i\f4\fs24 mode}{\f4\fs24 ', and specifies the access permissions to be given the new file. +\par +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4\fs24 IMPORTANT NOTE: GNO's }{\b\f4\fs24 read}{\f4\fs24 ()/}{\b\f4\fs24 write}{\f4\fs24 () functions take a size_t count, whereas ORCA's only take unsigned count. When recompiling code with the new GNO libraries, make very certain that any programs that use }{\b\f4\fs24 read}{\f4\fs24 ()/}{\b\f4\fs24 write}{\f4\fs24 () do a #include , or it is likely that your programs will crash. +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4\fs24 +\par }{\b\f4\fs24 opendir readdir rewinddir closedir}{\b\f4\fs24 +\par }{\f4\fs24 +\par }{\f6 #include +\par DIR *}{\b\f6 opendir}{\f6 (char *}{\i\f6 filename}{\f6 ) +\par struct }{\b\f6 dirent}{\f6 *readdir(DIR *}{\i\f6 dirp}{\f6 ) +\par void }{\b\f6 rewinddir}{\f6 (DIR *}{\i\f6 dirp}{\f6 ) +\par }{\b\f6 closedir}{\f6 (DIR *}{\i\f6 dirp}{\f6 )}{\f6\fs24 +\par }{\f4\fs24 (POSIX 1) +\par +\par This family of functions provides a machine-independent way to read a list of files (and information about them) from directories. +\par +\par }{\b\f4\fs24 opendir}{\f4\fs24 () opens the directory specified by filename and prepares it for the scan operation. }{\b\f4\fs24 opendir}{\f4\fs24 () returns a pointer to a structure which is used in the other dirent calls. +\par +\par }{\b\f4\fs24 readdir}{\f4\fs24 () takes a DIR * as argument and returns information about the next file in the directory. The return value is a pointer to a dirent structure (described below). +\par +\par If you wish to scan the directory again without closing and then reopening the directory, use }{\b\f4\fs24 rewinddir}{\f4\fs24 (). It resets the scan to the beginning of the directory. +\par +\par When finished with the directory, call }{\b\f4\fs24 closedir}{\f4\fs24 (). +\par +\par }{\f6 #define MAXNAMLEN 32\tab /* maximum filename length */ +\par +\par struct dirent\tab \tab /* data from getdents()/readdir() */ +\par \{ +\par long d_ino;\tab /* inode number of entry */ +\par off_t d_off;\tab /* offset of disk directory entry */ +\par unsigned short d_reclen;\tab /* length of this record */ +\par char d_name[MAXNAMLEN];\tab /* name of file */ +\par unsigned short d_namlen;\tab /* length of filename */ +\par \}; +\par }{\f4\fs24 +\par dirent is the structure returned by }{\b\f4\fs24 readdir}{\f4\fs24 () that contains information about the file. }{\b\f4\fs24 d_ino}{\f4\fs24 is not used on the Apple IIGS because neither ProDOS nor HFS have the concept of an "inode", but to simulate its use a unique d_ino value is returned for each }{\b\f4\fs24 readdir}{\f4\fs24 () call. }{\b\f4\fs24 d_off}{\f4\fs24 is the offset in the directory of the current file; the first entry is number 1, the second 2, etc. }{\b\f4\fs24 d_reclen}{\f4\fs24 specifies the length of the entire dirent structure. }{\b\f4\fs24 d_name}{\f4\fs24 is a short array containing the filename of the current file read from the directory. d_namlen is the length of the string in }{\b\f4\fs24 d_name}{\f4\fs24 . +\par +\par More specific information can be obtained by passing }{\b\f4\fs24 d_name}{\f4\fs24 to the }{\b\f4\fs24 stat}{\f4\fs24 () system call. +\par See also: }{\b\f4\fs24 stat}{\f4\fs24 (2) +\par +\par }{\b\f4\fs24 needsgno}{\f4\fs24 +\par +\par }{\f6 int }{\b\f6 needsgno}{\f6 (void)}{\f6\fs24 +\par }{\f4\fs24 +\par This function returns 1 if GNO is operating, and 0 if it is not. Use this function to abort programs that use GNO-specific features, or to allow them to enable non-GNO environment dependent code. +\par }{\b\f4\fs24 +\par }{\b\f4\fs24 parsearg}{\f4\fs24 +\par +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\b\f6 ~GNO_PARSEARG}{\f6 subroutine (4:}{\i\f6 commandline}{\f6 ,4:}{\i\f6 argptr}{\f6 ) +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\b\f6 ~GNO_PARSEARG}{\f6 (char *}{\i\f6 commandline}{\f6 , char **}{\i\f6 argptr}{\f6 ) +\par }{\f4\fs24 +\par This function will take the command-line passed to a utility and parse it into an argv,argc structure like those used in C programs. This was written NOT as a replacement for a C parser, but for use by assembly language programmers writing shell commands. +\par +\par }{\i\f4\fs24 commandline}{\f4\fs24 is the raw command line string as passed by the shell in the X & Y registers. }{\i\f4\fs24 argptr}{\f4\fs24 is a pointer to an argv[]-style array. parsearg returns the number of arguments found in the accumulator. +\par +\par This function ASSUMES that the ByteWorks Memory Manager has been started up and is usable. +\par +\par This function is based on actual GNO/ME shell (gsh) parsing code. +\par +\par }{\b\f4\fs24 pcreate pbind pgetport psend preceive pdelete preset pgetcount}{\f4\fs24 +\par +\par }{\f6 #include +\par int }{\b\f6 pcreate}{\f6 (int }{\i\f6 count}{\f6 ) +\par int }{\b\f6 pbind}{\f6 (int }{\i\f6 portid}{\f6 , char *}{\i\f6 name}{\f6 ) +\par int }{\b\f6 pgetport}{\f6 (char *}{\i\f6 name}{\f6 ) +\par int }{\b\f6 psend}{\f6 (int }{\i\f6 portid}{\f6 , long int }{\i\f6 msg}{\f6 ) +\par long }{\b\f6 preceive}{\f6 (int }{\i\f6 portid}{\f6 ) +\par int }{\b\f6 pdelete}{\f6 (int }{\i\f6 portid}{\f6 , int (*}{\i\f6 dispose}{\f6 )()) +\par int }{\b\f6 preset}{\f6 (int }{\i\f6 portid}{\f6 , int (*}{\i\f6 dispose}{\f6 )()) +\par int }{\b\f6 pgetcount}{\f6 (int }{\i\f6 portid}{\f6 ) +\par }{\f4\fs24 +\par The Ports IPC mechanism is a very flexible, powerful and efficient method of interprocess communication. A port is a queue that can contain a number of 32-bit values. The size of the port (how many messages it can contain) is specified in the }{\b\f4\fs24 pcreate}{\f4\fs24 () call. +\par +\par Creation of a port is done with }{\b\f4\fs24 pcreate}{\f4\fs24 (). You must specify the size of the port in this call, which must be at least 1 (one). The larger the port, the more data it can hold without blocking a process sending data to the port. }{\b\f4\fs24 pcreate}{\f4\fs24 () returns a port ID value that must be used in subsequent calls to the Port IPC routines. +\par +\par A name may be associated with a port; this allows totally unrelated processes to access a port without having to communicate the port ID through some other method, and without knowing the process ID of the other. To bind a name to a port, call }{\b\f4\fs24 pbind}{\f4\fs24 (). The name argument may be any length, but at most 32 characters are significant. If a name has already been bound to the chosen portid, an error is returned. To get the portid of a port by its name, use the }{\b\f4\fs24 pgetport}{\f4\fs24 () call. Pass in the name of the port whose port ID you wish to obtain. If no port has that name, an error is returned. Names are only unbound from a port when a port is deleted. +\par }{\b\f4\fs24 +\par }{\f4\fs24 psend() is used to send a 32-bit datum to a port. If the port is full (that is, if there are more unread messages in the port than are specified in the }{\b\f4\fs24 pcreate}{\f4\fs24 () call) then the sending process blocks until a message is read from the port. Messages are retrieved from a port using the }{\b\f4\fs24 preceive}{\f4\fs24 () call. pgetcount() returns the number of messages in the port that have not been received; this may be used to avoid blocking on a }{\b\f4\fs24 psend}{\f4\fs24 () call. +\par +\par If you wish to clear the contents of a port, say to synchronize communication after an error condition, use the }{\b\f4\fs24 preset}{\f4\fs24 () call. The arguments to this call are the port ID and the address of a }{\i\f4\fs24 'dispose'}{\f4\fs24 function. Each message in the port, before being cleared, is passed to the dispose function so that appropriate clean-up action may be taken on the data. For example, if the messages correspond to the address of memory blocks obtained with }{\b\f4\fs24 malloc}{\f4\fs24 (), you could pass }{\b\f4\fs24 'free}{\f4\fs24 ()' as the dispose function to automatically deallocate that memory. If you don't wish to take any special action on the data being cleared, pass NULL for the dispose argument. +\par +\par To destroy a port, make the }{\b\f4\fs24 pdelete}{\f4\fs24 () call. It accepts the same arguments as }{\b\f4\fs24 preset}{\f4\fs24 () and they operate as described above. The difference between }{\b\f4\fs24 preset}{\f4\fs24 () and }{\b\f4\fs24 pdelete}{\f4\fs24 () is that the latter totally destroys a port; it may no longer be used. }{\b\f4\fs24 preset}{\f4\fs24 () clears a port's data but leaves the port open for more data transmission. +\par +\par For an example of the use of ports, see the source code to the print spooling utilities (}{\b\f4\fs24 lpr}{\f4\fs24 , }{\b\f4\fs24 lpd}{\f4\fs24 , }{\b\f4\fs24 FilePort}{\f4\fs24 ). These are available from Procyon upon request. +\par +\par }\pard \qj\nowidctlpar\widctlpar\tx9720\adjustright {\b\f4\fs24 regexp}{\f4\fs24 +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4\fs24 +\par Compile and execute regular-expression programs. Use 'man regexp' for details. +\par +\par }{\b\f4\fs24 send receive recvtim recvclr}{\f4\fs24 +\par +\par }{\f6 #include +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f6 int }{\b\f6 send}{\f6 (int pid, unsigned long }{\i\f6 msg}{\f6 ); +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f6 unsigned long }{\b\f6 receive}{\f6 (void); +\par unsigned long }{\b\f6 recvtim}{\f6 (int }{\i\f6 timeout}{\f6 ); +\par unsigned long }{\b\f6 recvclr}{\f6 (void); +\par }{\f4\fs24 +\par These kernel functions comprise GNO's message-passing IPC system. Messages are unsigned 32-bit data values. A process sends a message to another by using the }{\b\f4\fs24 send}{\f4\fs24 () call. You must specify the process ID of the recipient and the message to pass. To receive a message, a process makes the }{\b\f4\fs24 receive}{\f4\fs24 () call. If no message has been sent to the process, the process sleeps until a message arrives. recvclr() is used to clear any pending message a process may have waiting. }{\b\f4\fs24 recvtim}{\f4\fs24 () is similar to }{\b\f4\fs24 receive}{\f4\fs24 () but takes a timeout argument, specified in 1/10ths of a second. If no message has been received in }{\i\f4\fs24 timeout}{\f4\fs24 /10 seconds, }{\b\f4\fs24 recvtim}{\f4\fs24 () fails and returns -1. The message buffer for a process is only one message deep; any attempt to }{\b\f4\fs24 send}{\f4\fs24 () a message to a process that already has one queued results in an error. For an IPC system with a deeper queue, see the Ports IPC section. +\par +\par A }{\b\f4\fs24 receive}{\f4\fs24 () that is interrupted by a signal will abort and return -1, with errno set to EINTR. +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4\fs24 +\par }{\b\f4\fs24 setenv unsetenv}{\f4\fs24 +\par +\par }{\f6 #include +\par int }{\b\f6 setenv}{\f6 (const char *}{\i\f6 name}{\f6 , const char *}{\i\f6 value}{\f6 , int }{\i\f6 rewrite}{\f6 ) +\par void }{\b\f6 unsetenv}{\f6 (const char *}{\i\f6 name}{\f6 )}{\f6 +\par }{\f6 +\par }{\f4\fs24 Set the value of the environmental variable name to be value. If }{\i\f4\fs24 rewrite}{\f4\fs24 is set, }{\b\f4\fs24 setenv}{\f4\fs24 replaces any current value. The variable is considered 'exported', according to the shell convention for variables. No errors are possible, and the only return code is 0. +\par +\par }{\b\f4\fs24 unsetenv}{\f4\fs24 removes the environmental variable specified by name from the variable table. The variable is no longer accessible, and any value that was assigned to that variable is deallocated. No errors are possible, and there is no return value. +\par +\par }{\b\f4\fs24 statfs}{\f4\fs24 +\par +\par }{\f6 int }{\b\f6 statfs}{\f6 (char *}{\i\f6 path}{\f6 , struct statfs *}{\i\f6 buf}{\f6 ) +\par }{\f4\fs24 +\par Returns information on the filesystem that the file }{\i\f4\fs24 path}{\f4\fs24 resides on. The information is placed in a structure pointed to by the input argument }{\i\f4\fs24 buf}{\f4\fs24 . Read }{\b\f4\fs24 statfs}{\f4\fs24 (3) for more information. +\par +\par }{\b\f4\fs24 strdup}{\f4\fs24 +\par +\par }{\f6 #include +\par char *}{\b\f6 strdup}{\f6 (const char *}{\i\f6 str}{\f6 ) +\par }{\f4\fs24 +\par }{\b\f4\fs24 strdup}{\f4\fs24 () creates a copy of the NUL-terminated string pointed to by }{\i\f4\fs24 str}{\f4\fs24 . It allocates a piece of memory exactly large enough to hold the string with the }{\b\f4\fs24 malloc}{\f4\fs24 () library function. When you no longer need the copy, dispose of it with }{\b\f4\fs24 free}{\f4\fs24 (). +\par See also: }{\b\f4\fs24 strcpy}{\f4\fs24 (), }{\b\f4\fs24 malloc}{\f4\fs24 (), }{\b\f4\fs24 free}{\f4\fs24 () +\par +\par }{\b\f4\fs24 strsep}{\f4\fs24 +\par +\par }{\f6 #include +\par char *}{\b\f6 strsep}{\f6 (char **}{\i\f6 stringp}{\f6 , const char *}{\i\f6 delim}{\f6 ) +\par }{\f4\fs24 +\par Gets a token from string *}{\i\f4\fs24 stringp}{\f4\fs24 , where tokens are nonempty strings separated by characters from delim. +\par +\par }{\b\f4\fs24 strsep}{\f4\fs24 writes NULs into *}{\i\f4\fs24 stringp}{\f4\fs24 to end tokens. }{\i\f4\fs24 delim}{\f4\fs24 need not remain constant from call to call. On return, *}{\i\f4\fs24 stringp}{\f4\fs24 points past the last NUL written (if there might be further tokens), or is NULL (if there are definitely no more tokens). If *}{\i\f4\fs24 stringp}{\f4\fs24 is NULL, }{\i\f4\fs24 strsep}{\f4\fs24 returns NULL. +\par +\par }{\b\f4\fs24 termcap}{\f4\fs24 +\par +\par The termcap library accesses the /etc/termcap database, which is used to provide terminal- independent support for advanced terminal features, such as various text modes, scrolling regions, cursor movement, and more. Use 'man termcap' for more details. +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4\fs24 +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\b\f4\fs24 ttyname}{\f4\fs24 +\par +\par }{\f6 #include +\par char *}{\b\f6 ttyname}{\f6 (int }{\i\f6 fd}{\f6 ) +\par }{\f4\fs24 +\par Returns the filename of the tty referenced by file descriptor }{\i\f4\fs24 fd}{\f4\fs24 . If fd does not refer to a tty file, NULL is returned. Otherwise, a pointer to the filename (NUL-terminated string) is returned. +\par +\par tty filenames are in the format ".ttyXX", where XX is a device designator. When porting existing BSD code, take care to watch for code that depends on the existence of a '/' character in the string, as UNIX tty files are in the form "/dev/ttyXX". +\par +\par The string pointer returned points to a static buffer, and will be overwritten on any further calls to }{\b\f4\fs24 ttyname}{\f4\fs24 . Copy the string if you wish to preserve it. +\par +\par }{\b\f4\fs24 unlink}{\f4\fs24 +\par +\par }{\f6 int }{\b\f6 unlink}{\f6 (char *}{\i\f6 fname}{\f6 ) +\par }{\f4\fs24 +\par Causes the link file specified by }{\i\f4\fs24 fname}{\f4\fs24 to be removed. Since GNO/ME does not yet support symbolic or hard file links, this function operates the same as the }{\b\f4\fs24 remove}{\f4\fs24 () (or DestroyGS) routine. +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 \sect }\sectd \linex0\endnhere\sectdefaultcl {\headerl \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx4680\tqr\tx9360\adjustright \fs20\cgrid {\fs24 TTY(4)\tab Library Routines\tab TTY(4)}{\fs24 +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}{\headerr \pard\plain \s15\nowidctlpar\widctlpar\tqc\tx4680\tqr\tx9360\adjustright \fs20\cgrid {\fs24 TTY(4)\tab Library Routines\tab TTY(4)}{\fs24 +\par }\pard \s15\nowidctlpar\widctlpar\tqc\tx4320\tqr\tx8640\adjustright { +\par }}\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\b\f4\fs24 NAME}{\f4\fs24 +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {tty - general terminal interface +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\f4\fs24 +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\b\f4\fs24 SYNOPSIS}{\f4\fs24 +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {#include +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\f4\fs24 +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\b\f4\fs24 DESCRIPTION}{\f4\fs24 +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {This file documents the special file }{\f6 .tty}{ and the terminal drivers used for user-oriented I/O. +\par }\pard \s22\qj\li720\nowidctlpar\widctlpar\adjustright { +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\b\f4\fs24 The Controlling Terminal}{\f4\fs24 +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {Every process has associated with it a controlling terminal, which is the terminal the process was invoked from. In some versions of Unix, the controlling terminal association is responsible for job control; this is not so under GNO. A process' controlling terminal is inherited from its parent. By opening the special file .tty, a process can access its controlling terminal. This is useful where the input and output of a process was redirected and the process wants to be sure of outputting or getting input from the user at the terminal. +\par }\pard \s22\qj\li720\nowidctlpar\widctlpar\adjustright { +\par A process can remove the association it has with its controlling terminal by opening the file .tty and issuing an +\par +\par ioctl(f, TIOCNOTTY, 0); +\par +\par This is often desirable in server processes. +\par +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\b\f4\fs24 Process Groups}{\f4\fs24 +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {Every terminal has an associated process group. Any time a signal-generating special character is typed at the terminal, the terminal's process group is sent that signal. Unix systems set process groups using ioctl() calls, but under GNO a new interface method is used; process group assignments are controlled with the JOB CONTROL(2) routines. +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\f4\fs24 +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\b\f4\fs24 Modes}{\f4\fs24 +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {There are four modes in which terminal drivers operate. These modes control how the driver deals with I/O. +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\f4\fs24 +\par }\pard \qj\fi-1440\li2160\nowidctlpar\widctlpar\adjustright {\i\f4\fs24 cooked}{\f4\fs24 \tab This is the default mode of the terminal driver. If an incoming character is one of the special characters defined in sgttyb, tchars, or ltchars, the appropriate action is performed (see below). This mode also allows for input editing, as input is internally buffered line by line, and data is returned to a reading process only when CR is entered. +\par }\pard \qj\fi-1440\li2160\nowidctlpar\widctlpar\adjustright {\f4\fs24 +\par }\pard \qj\fi-1440\li2160\nowidctlpar\widctlpar\adjustright {\i\f4\fs24 cbreak}{\f4\fs24 \tab Input is returned on a per-character basis, instead of line by line as in cooked mode. If no data is available, a read will block the calling process. If data is available, a number of characters up to but not exceeding the requested number will be returned. Special characters such as t_intrc are not handled, but are passed on to the caller as data. +\par +\par }{\i\f4\fs24 raw}{\f4\fs24 \tab Like cbreak mode, except that no input or output processing whatsoever is performed. +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4\fs24 +\par +\par }{\b\f4\fs24 Summary of terminal control modes}{\f4\fs24 +\par +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {Due to the colorful history of Unix systems, the data structures used to manipulate terminal modes and settings are separated into four groups. Future revisions of GNO will implement the POSIX termio interface, which consolidates these structures into one place. +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\f4 +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\b\f4\fs24 sgtty}{\f4\fs24 +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {The basic ioctls use the structure defined in : +\par }\pard \s22\qj\li720\nowidctlpar\widctlpar\adjustright { +\par }{\f6\fs20 struct sgttyb \{ +\par }\pard \s22\qj\li720\nowidctlpar\widctlpar\adjustright {\f6\fs20 \tab char\tab sg_ispeed; +\par \tab char\tab sg_ospeed; +\par \tab char\tab sg_erase; +\par \tab char\tab sg_kill; +\par \tab short\tab sg_flags; +\par \}; +\par }{ +\par }\pard \s22\qj\li720\nowidctlpar\widctlpar\adjustright {sg_ispeed and sg_ospeed indicate the baud rates for input and output according to the following table. Speed changes that do not apply to a particular piece of hardware are ignored (for instance, the console driver does not access a serial port so all baud rate settings are, in effect, impossible). Also, not all the baud rates supported by a particular device are allowed to be set from this interface. +\par +\par These symbolic names for the baud rate settings are defined in . +\par +\par B0\tab \tab 0\tab (hang up dataphone) +\par B50\tab \tab 1\tab 50 baud +\par B75\tab \tab 2\tab 75 baud +\par B110\tab \tab 3\tab 110 baud +\par B134\tab \tab 4\tab 134.5 baud +\par B150\tab \tab 5\tab 150 baud +\par B300\tab \tab 7\tab 300 baud +\par B600\tab \tab 8\tab 600 baud +\par B1200\tab }{\tab }{9\tab 1200 baud +\par B1800\tab }{\tab }{10\tab 1800 baud +\par B2400\tab }{\tab }{11\tab 2400 baud +\par B4800\tab }{\tab }{12\tab 4800 baud +\par B9600\tab }{\tab }{13\tab 9600 baud +\par B19200\tab \tab and +\par EXTA\tab \tab 14\tab 19200 baud +\par B38400\tab \tab and +\par EXTB\tab \tab 15\tab 38400 baud +\par B57600\tab 6\tab 57600 baud +\par +\par }\pard \s22\qj\li720\nowidctlpar\widctlpar\adjustright {The sg_erase and sg_kill fields specify the line-editing erase and kill characters. sg_erase is 0x7F (delete) by default, and sg_kill is not currently used. +\par }\pard \s22\qj\li720\nowidctlpar\widctlpar\adjustright { +\par sg_flags is a bitmapped value that indicates various state settings for the terminal driver (values are in hex). +\par +\par EVENP\tab 0x80\tab Use Even parity (serial devices only) +\par ODDP\tab \tab 0x40\tab Use Odd parity (serial devices only) +\par RAW\tab \tab 0x20\tab Raw mode: wake up on all characters, 8-bit interface +\par CRMOD\tab 0x10\tab Map CR into LF; output LF as CR-LF +\par ECHO\tab }{\tab }{0x08\tab Echo (full duplex) +\par CBREAK\tab 0x02\tab Return each character as soon as typed +\par TANDEM\tab 0x01\tab Automatic flow control +\par +\par }{\b RAW}{ and }{\b CBREAK}{ modes were described above, in Modes. +\par +\par If the }{\b CRMOD}{ bit is set, a line feed character is appended to any echoed or ouputted carriage return. +\par +\par The }{\b ECHO}{ bit controls input echoing; if enabled, any characters read from the terminal are echoed. This behavior differs slightly from Unix, where input characters are echoed as soon as typed. +\par +\par }{\b TANDEM}{ mode enables automatic software flow control utilizing the special characters t_startc and t_stopc in tchars (below). Whenever the input queue is in danger of overflowing, the system sends t_stopc; when the queue has drained sufficiently, t_startc is sent. This mode has no effect on the console driver. +\par +\par Note: t_startc and t_stopc are used for both directions of flow control; when t_stopc is received from a remote system (or user), the terminal stops output, and when t_startc is received output resumes. Certain drivers may also require t_stopc and t_startc to be the same character, in which case one or the other setting will be ignored. See the driver's documentation for details. +\par Basic Ioctls +\par +\par Most }{\b ioctl}{() calls apply to terminals. They have the form +\par #include +\par +\par ioctl(int filedes, unsigned long code, void *arg) +\par +\par arg is usually a pointer to a structure or int. The ioctl codes that apply to sgtty are: +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\f4 +\par }\pard \qj\fi-1440\li2160\nowidctlpar\widctlpar\adjustright {\b\f6\fs24 TIOCGETP}{\f4\fs24 \tab Fetch the basic parameters associated with the terminal, and store in the sgttyb structure pointed to by arg. +\par +\par }{\b\f6\fs24 TIOCSETP}{\f4\fs24 \tab Set the terminal's basic parameters according to the sgttyb structure pointed to by arg. The input queue is flushed, and the call waits for the output queue to drain before the parameters are changed. +\par +\par }{\b\f6\fs24 TIOCSETN}{\f4\fs24 \tab This is like TIOCSETP, except there is no delay and the input queue is not flushed. +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {With the following codes arg is ignored. +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\f4 +\par }\pard \qj\fi-1440\li2160\nowidctlpar\widctlpar\adjustright {\b\f6\fs24 TIOCEXCL}{\f4\fs24 \tab Set "exclusive-use" mode. The terminal may not be opened again by any process until all existing references are closed. +\par +\par }{\b\f6\fs24 TIOCNXCL\tab }{\f4\fs24 Turns off "exclusive-use" mode. +\par +\par }{\b\f6\fs24 TIOCHPCL}{\f4\fs24 \tab When the last reference to the terminal is closed, the terminal line is forced to hang up. This applies only to modem drivers. +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {With the following codes, arg is a pointer to an int. +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\f4 +\par }\pard \qj\fi-1440\li2160\nowidctlpar\widctlpar\adjustright {\b\f6\fs24 TIOCGETD}{\f4\fs24 \tab The current line discipline number is stored in the int pointed to by arg. This value is currently ignored. +\par +\par }{\b\f6\fs24 TIOCSETD}{\f4\fs24 \tab The line discipline is set according to the int pointed to by arg. +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4\fs24 +\par }\pard \qj\fi-1440\li2160\nowidctlpar\widctlpar\adjustright {\b\f6\fs24 TIOCFLUSH}{\f4\fs24 \tab The specified queue is flushed. If the value pointed to by arg is zero, both the input and output queues are flushed. If the value is FREAD (defined in ), the input queue is flushed. If the value is FWRITE, the output queue is flushed. +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4 +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {The last few calls permit detailed control of the driver. In cases where an argument is required, it is described. Otherwise, arg should be a NULL pointer. +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\f4 +\par }\pard\plain \s22\qj\fi-1440\li2160\nowidctlpar\widctlpar\adjustright \f4\cgrid {\b\f6 TIOCSTI}{\tab }{The character pointed to by the argument is placed in the input queue as if it had been typed on the terminal. +\par }\pard \s22\qj\fi-1440\li2160\nowidctlpar\widctlpar\adjustright { +\par }{\b\f6 TIOCSBRK}{\tab Begins a break sequence on the terminal. +\par +\par }{\b\f6 TIOCCBRK}{\tab Ends a break sequence. +\par +\par }{\b\f6 TIOCSDTR}{\tab The DTR line is turned on +\par +\par }{\b\f6 TIOCCDTR}{\tab The DTR line is turned off +\par +\par }{\b\f6 TIOCSTOP}{\tab Output is stopped as if t_stopc had been typed on the terminal. +\par }{\b +\par }\pard \s22\qj\fi-1440\li2160\nowidctlpar\widctlpar\adjustright {\b\f6 TIOCSTART}{\tab If output is stopped, it is resumed as if t_startc had been typed on the terminal. +\par }\pard \s22\qj\fi-1440\li2160\nowidctlpar\widctlpar\adjustright { +\par }{\b\f6 TIOCOUTQ}{\tab The number of characters in the output queue is returned in the int pointed to by arg. +\par +\par }{\b\f6 FIONREAD}{\tab The number of characters immediately available for input from the terminal is returned in the int pointed to by arg. This is the preferred method of non-blocking I/O (checking for the presence of characters without waiting for them). +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\f4 +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4\fs24 +\par }{\b\f4\fs24 Tchars}{\f4\fs24 +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {The second structure associated with a terminal defines special characters. The structure is defined in which is automatically included by . +\par }\pard \s22\qj\li720\nowidctlpar\widctlpar\adjustright { +\par struct tchars \{ +\par \tab char\tab t_intrc;\tab /* interrupt */ +\par \tab char\tab t_quitc;\tab /* quit */ +\par \tab char\tab t_startc;\tab /* start output */ +\par \tab char\tab t_stopc;\tab /* stop output */ +\par \tab char\tab t_eofc;\tab /* end-of-file */ +\par \tab char\tab t_brkc;\tab /* input delimiter (like nl) */ +\par \}; +\par +\par The default values for these characters are ^C, ^\\, ^Q, ^S, ^D and -1 respectively. A value of -1 for any of the characters means that the effect of that character is ignored. The stop and start characters may be the same to produce a 'toggle' effect. It is not recommended to set any of the other characters to the same values; the order in which the special characters are checked is not defined, and the results you get may not be what was expected. +\par }\pard \s22\qj\li720\nowidctlpar\widctlpar\adjustright {The ioctl calls that apply to tchars are: +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\f4\fs24 +\par }\pard \qj\fi-1440\li2160\nowidctlpar\widctlpar\adjustright {\b\f6\fs24 TIOCGETC}{\f4\fs24 \tab Returns the special characters settings in the tchars structure pointed to by arg. +\par +\par }{\b\f6\fs24 TIOCSETC}{\f4\fs24 \tab The special characters are set according to the given structure. +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4\fs24 +\par }{\b\f4\fs24 Local mode}{\f4\fs24 +\par +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {The third structure in the terminal interface is a local mode word. The various bitfields in this word are as follows (values are in hex): +\par }\pard \s22\qj\li720\nowidctlpar\widctlpar\adjustright { +\par LCRTBS\tab 0x0001\tab Backspace on erase rather than echoing erase +\par LPRTERA\tab 0x0002\tab Printing terminal erase mode +\par LCRTERA\tab 0x0004\tab Erase character echoes as backspace-space-backspace +\par LTILDE\tab 0x0008\tab Convert ~ to ` on output (for Hazeltine terminals) +\par LMDMBUF\tab 0x0010\tab Stop/start output when carrier drops +\par LLITOUT\tab 0x0020\tab Suppress output translations +\par LTOSTOP\tab 0x0040\tab Send SIGTTOU for background output (not implemented) +\par LFLUSHO\tab 0x0080\tab Output is being flushed +\par LNOHANG\tab 0x0100\tab Don't send hangup when carrier drops +\par LPASSOUT\tab 0x0200\tab Cooked mode with 8-bit output +\par LCRTKIL\tab 0x0400\tab BS-space-BS erase entire line on line kill +\par LPASS8\tab 0x0800\tab Pass all 8 bits through on input, in any mode +\par LCTLECH\tab 0x1000\tab Echo input control chars as ^? +\par LPENDIN\tab 0x2000\tab Retype pending input at next read or input character +\par LDECCTQ\tab 0x4000\tab Only ^Q restarts output after ^S +\par LNOFLSH\tab 0x8000\tab Inhibit flushing of pending I/O when intr char is typed +\par +\par The ioctl's used to access the local mode follow. arg in all cases is a pointer to an int. +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\f4 +\par }\pard \qj\fi-1440\li2160\nowidctlpar\widctlpar\adjustright {\b\f6\fs24 TIOCLBIS}{\f4\fs24 \tab The bits of the local mode word specified by `1' bits in the argument are set; this operation is a bit-wise OR. +\par +\par }{\b\f6\fs24 TIOCLBIC}{\f4\fs24 \tab The bits of the local mode word specified by `1' bits in the argument are cleared; this operation ANDs the local mode with the bitwise negation of the argument. +\par +\par }{\b\f6\fs24 TIOCLSET}{\f4\fs24 \tab Sets the local mode word to the value of the argument. +\par +\par }{\b\f6\fs24 TIOCLGET}{\f4\fs24 \tab Returns the local mode word in the int pointed to by arg. +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4\fs24 +\par }{\b\f4\fs24 Local Special Characters}{\f4\fs24 +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {The fourth terminal structure is another set of special characters. The structure is named ltchars and is again defined in . +\par }\pard \s22\qj\li720\nowidctlpar\widctlpar\adjustright { +\par }{\f6\fs20 struct ltchars \{ +\par }\pard \s22\qj\li720\nowidctlpar\widctlpar\adjustright {\f6\fs20 \tab char\tab t_suspc;\tab /* stop process signal */ +\par \tab char\tab t_dsuspc;\tab /* delayed stop process signal */ +\par \tab char\tab t_rprntc;\tab /* reprint line */ +\par }\pard \s22\qj\li720\nowidctlpar\widctlpar\adjustright {\f6\fs20 \tab char\tab t_flushc;\tab /* flush output (toggles) */ +\par }\pard \s22\qj\li720\nowidctlpar\widctlpar\adjustright {\f6\fs20 \tab char\tab t_werasc;\tab /* word erase */ +\par \tab char\tab t_lnextc;\tab /* literal next character */ +\par \}; +\par }{ +\par }\pard \s22\qj\li720\nowidctlpar\widctlpar\adjustright {Defaults for these characters are ^Z, ^Y, ^R, ^O, ^W, and ^V. As with tchars, a value of -1 disables the effect of that character. Only t_suspc is currently implemented for the console driver. +\par +\par The applicable ioctl functions are: +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\f4\fs24 +\par }\pard \qj\fi-1440\li2160\nowidctlpar\widctlpar\adjustright {\b\f6\fs24 TIOCSLTC}{\f4\fs24 \tab sets the local characters according to the ltchars structure pointed to by arg. +\par +\par }{\b\f6\fs24 TIOCGLTC}{\f4\fs24 \tab retreives the local characters, storing them in the argument. +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4\fs24 +\par +\par }{\b\f4\fs24 Window/terminal sizes +\par }{\f4\fs24 +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {Provision is made for storage of the current window or terminal size along with the other terminal information. This info is recorded in a winsize structure, and is defined in : +\par }\pard \s22\qj\li720\nowidctlpar\widctlpar\adjustright { +\par }{\f6\fs20 struct winsize \{ +\par }\pard \s22\qj\li720\nowidctlpar\widctlpar\adjustright {\f6\fs20 \tab unsigned short\tab ws_row;\tab /* rows, in characters */ +\par \tab unsigned short\tab ws_col;\tab /* columns, in characters */ +\par \tab unsigned short\tab ws_xpixel;\tab /* horizontal size, pixels */ +\par \tab unsigned short\tab ws_ypixel;\tab /* vertical size, pixels */ +\par \}; +\par }{ +\par }\pard \s22\qj\li720\nowidctlpar\widctlpar\adjustright {A '0' in a field indicates that the field value is undefined. '0' is the default when a terminal is first opened. These values are not used by the terminal driver itself; rather, they are for the benefit of applications. The ioctl calls for winsize are: +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\f4\fs24 +\par }\pard \qj\fi-1800\li2520\nowidctlpar\widctlpar\adjustright {\b\f6\fs24 TIOCGWINSZ}{\f4\fs24 \tab Returns the window size parameters in the provided winsize structure. +\par +\par }{\b\f6\fs24 TIOCSWINSZ}{\f4\fs24 \tab Sets the window size parameters. If any of the values differ from the old ones, a SIGWINCH signal is sent to the terminal's process group. +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\f4\fs24 +\par }{\b\f4\fs24 FILES}{\f4\fs24 +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {.tty +\par }\pard \s22\qj\li720\nowidctlpar\widctlpar\adjustright {.ttyco (console driver) +\par .tty* (user-installed drivers) +\par }\pard\plain \qj\nowidctlpar\widctlpar\adjustright \fs20\cgrid {\f4\fs24 +\par }\pard \qj\nowidctlpar\widctlpar\adjustright {\b\f4\fs24 SEE ALSO}{\f4\fs24 +\par }\pard\plain \s22\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\i GNO Shell Reference Manual}{, }{\b stty}{(1), }{\b ioctl}{(2), }{\b signal}{(2) +\par }\pard\plain \s17\qj\li720\nowidctlpar\widctlpar\adjustright \f4\cgrid {\f0 +\par }} \ No newline at end of file diff --git a/refs.html b/refs.html index 0360d1f..8cd1203 100644 --- a/refs.html +++ b/refs.html @@ -97,23 +97,33 @@ For the historically inclined, an HTML version of the version 2.0.4 manuals is also available from August 1996: