home *** CD-ROM | disk | FTP | other *** search
- WTW Associates
- 341 N. First St.
- Campbell, Ca. 95008
-
- Documentation for the UTOOLS (utool.doc 2/23/83)
- (author of both tools and documentation: David H. Wolen)
-
- Mos⌠á oµá thσ UTOOL╙ arσ deriveΣ froφ thσ program≤á describeΣá iε ì
- Softwarσá Tool≤ anΣ Softwarσ Tool≤ iε Pasca∞ (botΦá b∙á Kernighaε ì
- anΣ Plauger)« The∙ werσ writteε iε ├ anΣ testeΣ oε aε Osbornσ ▒ ì
- (Z80A¼á CP/═ 2.2¼á singlσ density)«á Thσ UTOOL╙ providσ feature≤ ì
- calleΣá I/╧ redirectioε anΣ pipes«á Externally¼á thesσá feature≤ ì
- resemblσá thosσ provideΣ unde≥ thσ UNI╪ operatinτ systeφ -- hencσ ì
- thσ namσ UTOOLS« Thσ manua∞ pagσ fo≥ eacΦ UTOO╠ describe≤ allow ì
- ablσ inpu⌠ anΣ output«á Iµ thσ inpu⌠ i≤ STDIN¼á tha⌠ mean≤ inpu⌠ ì
- caεá comσá froφ thσ keyboarΣ o≥ froφ ß file«á Iµ thσá outpu⌠á i≤ ì
- STDOUT¼á tha⌠ mean≤ thσ outpu⌠ caε g∩ t∩ thσ screen¼ ß file¼ botΦ ì
- screeε anΣ file¼ o≥ servσ a≤ inpu⌠ t∩ anothe≥ UTOOL« Thσ followì
- inτ example≤ assumσ tha⌠ thσ UTOOL╙ arσ oε thσ ┴ drive¼á an∙ filσ ì
- t∩ bσ reaΣ o≥ writteε wil∞ bσ oε thσ ┬ drive¼ anΣ ┬ i≤ thσ loggeΣ ì
- drive«á It'≤ bes⌠ t∩ makσ ┬ thσ loggeΣ drivσ becausσ thσá UTOOL╙ ì
- sometime≤ havσ t∩ makσ anΣ releasσ ß temporar∙ filσ oε thσ loggeΣ ì
- drive« Therσ probabl∙ isn'⌠ enougΦ rooφ oε ┴ fo≥ that.
-
- Examples of I/O redirection and piping:
-
- 1«á KeyboarΣ inpu⌠ anΣ screeε outpu⌠ (usefu∞ fo≥ learninτ ho≈á ß ì
- UTOOL works).
-
- B>a:cat
-
- áááááca⌠á wil∞á wait fo≥ yo⌡ t∩ typσ iε datß anΣ wil∞ ech∩ i⌠á t∩ ì
- áááááthσ screeε afte≥ yo⌡ typσ eacΦ line«á EnΣ eacΦ linσ witΦá ß ì
- ááááá<cr╛ (carriagσ return)« Iµ yo⌡ makσ ß mistakσ whilσ typing¼ ì
- áááááyo⌡ caε usσ ^Φ (contro∞ h⌐ t∩ erasσ thσ las⌠ characte≥ typeΣ ì
- áááááo≥á ^°á (contro∞ x⌐ t∩ erasσ thσ wholσá line«á Wheεá you'rσ ì
- ááááátireΣá oµá typing¼á ente≥á ^z<cr╛ (contro∞ · followeΣá b∙á ß ì
- ááááácarriage return) to tell cat that you're done.
-
- 2«á KeyboarΣ inpu⌠ anΣ filσ output« Thi≤ i≤ usefu∞ fo≥ creatinτ ì
- ß filσ quickl∙ withou⌠ botherinτ witΦ ß tex⌠ editor«á I⌠ create≤ ì
- ß norma∞ asciΘ file« Note║ n∩ spacσ i≤ alloweΣ betweeε thσ ╛ anΣ ì
- thσá filσá name«á Iµ thσ filσ alread∙ exists¼á i⌠ wil∞á bσá ove≥ ì
- written.
-
- B>a:cat >outfile
-
- 3« KeyboarΣ input« Outpu⌠ t∩ botΦ thσ screeε anΣ ß file« Note║ ì
- no space between the + and the file name.
-
- B>a:cat +outfile
- .pa
- è4«á Filσ inpu⌠ anΣ screeε output«á Again¼ notσ tha⌠ therσ can'⌠ ì
- be any space between the < and the file name.
-
- B>a:cat <infile
-
- 5«á KeyboarΣ inpu⌠ anΣ pipσ thσ outpu⌠ t∩ anothe≥ UTOOL«á Note║ ì
- no space between | and the second UTOOL.
-
- B>a:cat |a:lpr
-
- áááááThi≤ examplσ woulΣ senΣ thσ line≤ yo⌡ typeΣ a⌠ thσá keyboarΣ ì
- áááááto the printer (after you typed the ^z<cr> to finish).
-
-
-
- Here are some useful pipelines.
-
- 1«á Makσá ß keyworΣ iε contex⌠ index¼á treatinτ uppe≥ anΣá lowe≥ ì
- casσ alphß thσ same«á Displa∙ oε thσ screen¼á pausinτ afte≥ eacΦ ì
- screen full. Input is a normal ascii file.
-
- B>a:kwic <infile |a:sort -f |a:unrot |a:crt
-
- 2«á WorΣ frequenc∙ count¼á sorteΣ b∙ word«á Inpu⌠ i≤ ß WordSta≥ ì
- doc file. Convert all words to lower case.
-
- B>a:prep <infile.doc |a:sort |a:uniq -c
-
- 3«á WorΣ frequenc∙ count¼ numerica∞ order¼ larges⌠ first« Inpu⌠ ì
- is a WordStar doc file. Convert all words to lower case.
-
- B>a:prep <infile.doc |a:sort |a:uniq -c |a:sort -nr
-
- 4« Combinσ │ datß file≤ (norma∞ ascii)¼ sor⌠ theφ treatinτ uppe≥ ì
- anΣ lowe≥ casσ alphß thσ same¼ deletσ duplicatσ line≤ anΣ print.
-
- B>a:cat file1.dat file2.dat file3.dat |a:sort -fu |a:lpr
-
- 5«á SorteΣá lis⌠ oµ al∞ word≤ iε ß WordSta≥ doπ file«á Onσ worΣ ì
- pe≥ line«á DistinguisΦ betweeε uppe≥ anΣ lowe≥ casσ alpha« Sho≈ ì
- only one occurrence of each word.
-
- B>a:cat <infile.doc -w |a:tr " \n\t" \n |a:sort -u
-
-
-
- Notes:
-
- a«á Thσá UTOOL╙ werσ writteε usinτ thσ BD╙ ├á compiler¼á versioε ì
- 1.46, and the dio function package that came with it.
-
- b«á Pipσ mechanisφ (whicΦ reall∙ use≤ temporar∙ files⌐ wil∞ worδ ì
- onl∙ witΦ UTOOL╙ o≥ othe≥ program≤ writteε iε BD╙ ├ anΣ usinτ thσ ì
- dio package.
-
- èc«á Thσá UTOOL╙ al∞ worδ oε norma∞ asciΘ tex⌠ file≤ (non-doπá iε ì
- WordSta≥á terminology)«á Somσ als∩ worδ oε WordSta≥á doπá files« ì
- See the manual pages to find out which do and which do not.
-
- d«á Don'⌠á tr∙ t∩ chaiε to∩ man∙ UTOOL╙ togethe≥ iε ßá pipeline« ì
- Also¼á finΣá anΣ cΦ don'⌠ seeφ t∩ ge⌠ alonτ wel∞ togethe≥ iεá thσ ì
- same pipeline.
-
- e«á Don'⌠á tr∙ t∩ creatσ ß filσ oε ß nearl∙ ful∞ disk«á I⌠ wil∞ ì
- probably truncate at the end without warning you.
-
- f«á Iµ you≥ systeφ crashe≤ o≥ yo⌡ hi⌠ rese⌠ iε thσ middlσ oµá aε ì
- execution¼á yo⌡ ma∙ finΣ thσ file≤ tempin.$$ñ o≥ tempout.$$ñ wheε ì
- yo⌡ comσ bacδ up«á Thσ UTOOL╙ ge⌠ riΣ oµ theφ wheε the∙ completσ ì
- normally«á Sincσ the∙ didn'⌠ iε thi≤ case¼á you'l∞ havσ t∩ erasσ ì
- them yourself.
-
- g«á Thσá manua∞ pagσ fo≥ somσ oµ thσ UTOOL╙ show≤ somethinτ likσ ì
- proτá [-xyz]«á Thσ bracket≤ indicatσ optiona∞á argument≤á -- yo⌡ ì
- don't actually type them in.
-
- h«á N∩á leadinτ spacσ i≤ alloweΣ betweeε thσ CP/═ B╛ promp⌠á anΣ ì
- the UTOOL name.
-
- i« Iµ ß UTOO╠ take≤ multiplσ option≤ (e.g« a¼ b¼ anΣ c⌐ the∙ caε ì
- be given either as -a -b -c or -abc.
-
- j«á Option≤á anΣá redirecteΣ inpu⌠ anΣ outpu⌠ caε appea≥ iεá an∙ ì
- order. E.g. all of the following are o.k.
- a:cat -w <infile >outfile
- a:cat <infile -w >outfile
- a:cat <infile >outfile -w
-
- k« Wherσ ß UTOO╠ aε takσ ß regula≥ filσ a≤ inpu⌠ (withou⌠ thσ <⌐ ì
- anΣá ha≤ option≤ (-xyz)¼á consul⌠ thσ manua∞ pagσ t∩ seσá whethe≥ ì
- thσá option≤á mus⌠ bσ giveε beforσ o≥ afte≥ thσ filσá name«á Thσ ì
- optioεá usuall∙á preceed≤ thσ filσ namσ bu⌠á ╔á wasn'⌠á perfectl∙ ì
- consistent. E.g.
- a:cal file -g 01/01/83 (option follows file name)
- a:cat -w file (option preceeds file name)
- a:comm -12 file (option preceeds file name)
- a:crt -n file (option preceeds file name)
-
- l« Thσ followinτ arσ registereΣ trademarks║ Osbornσ ▒ b∙ Osbornσ ì
- Computer¼á CP/═ b∙ Digita∞ Research¼á Z80┴ b∙ Zilog¼ UNI╪ b∙ Bel∞ ì
- Labs, WordStar by MicroPro.