home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 6 File / 06-File.zip / tail.zip / AIXLIKE.INF (.txt) next >
OS/2 Help File  |  1994-07-13  |  52KB  |  1,792 lines

  1.  
  2. ΓòÉΓòÉΓòÉ 1. In General ΓòÉΓòÉΓòÉ
  3.  
  4. The programs in the AIXLIKE package are OS/2 implementations of the like-named 
  5. AIX version 3.1 shell commands.  The command line syntax is supposed to be 
  6. identical to the AIX versions (with a couple of exceptions noted below), and 
  7. the output is supposed to be identical except in cases of operating system 
  8. dependent information. 
  9.  
  10. Differences in the operation of the OS/2 and AIX versions of these utilities 
  11. should be limited to differences in the shells and differences in the 
  12. underlying OS.  Here are some of the differences: 
  13.  
  14. o Path seperator character.  The OS/2 utilities accept only OS/2 style path 
  15.   names. 
  16.  
  17. o Ambiguous path names.  The OS/2 versions do not accept ambiguous directory 
  18.   names as part of paths.  Instead, most of the programs support an -s switch, 
  19.   which applies the utility recursively to subdirectories.  For example, 
  20.  
  21.            wc -s *.c
  22.   counts lines, words and bytes for each file matching "*.c" in the current 
  23.   working diretory and in each subdirectory below it. 
  24.  
  25. o Quoted strings. None of the various quoting schemes implemented by the AIX 
  26.   shells are supported.  In particular, 
  27.  
  28.    - Escape sequences such as \n and \t are only weakly supported on the 
  29.      command line.  I've made an effort to interpret these correctly in sed. 
  30.  
  31.    - Quotes in the form `this is a quoted string' are not supported. Use double 
  32.      quotes: "this is a supported quoted string". 
  33.  
  34.    - Single quotes are not supported.  Use double quotes. 
  35.  
  36. The programs in the AIXLIKE package have had quite a bit of testing, but you 
  37. can expect to find bugs in them, and there are probably places where my 
  38. understanding of the AIX versions is wrong or incomplete. Most of them have 
  39. been available on OS2TOOLS for a couple of years, and, based on my mail, have 
  40. had at least moderate use. The programs are in use on my desk, running under 
  41. OS/2 version 1.3, but they have not been extensively tested on versions 1.2 or 
  42. 2.0. I will accept, and try to fix, all bug reports.  I will also accept 
  43. reports of variance from 'spec'-that is, differences between the way these 
  44. programs run and the way their counterparts run on AIX 3.1. Bug reports and 
  45. other comments should go to AIXLIKE FORUM on the IBMPC conference disk. 
  46.  
  47. Source is provided for all the code in the AIXLIKE package.  To the best of my 
  48. knowledge, this code is 'clean': it is the product of my own work, done on my 
  49. own time, and is therefore wholly owned by IBM. (Exceptions to this are noted 
  50. below.) To the extent that my permission is required, I grant permission to any 
  51. employee of IBM to use or modify this code for IBM management-approved 
  52. purposes.  I'd appreciate a note telling me what you did to it, though; and if 
  53. you find a way to speed up the grep matching routines, please, PLEASE, let me 
  54. know. 
  55.  
  56. There are also versions of LEX and YACC (actually FLEX and BISON) on PCTOOLS. 
  57. They are in the YACC package owned by John Q. Walker.  I've used them, and they 
  58. have worked well for me.  They are not distributed with source. Brian Yoder has 
  59. a version of ls, as well as chmod, cd, and other programs in UTIL2 PACKAGE on 
  60. OS2TOOLS. 
  61.  
  62. The version of df in this package was written by Peter J. Schwaller. I made 
  63. some trivial additions to it.  If you find a bug, it's probably mine; if you 
  64. want to pat someone on the back, send mail to PJS at RALVMC. 
  65.  
  66. The version of du in this package was written by Dierk Schueler. Likewise, the 
  67. code he gave me was of very high quality and I thank him for it. 
  68.  
  69. The version of compress in this package is modified from public domain code. 
  70. You will have to get permission from legal to redistribute the compress code. 
  71.  
  72. If anyone has other AIXLIKE utilities that they would like to share, I'll be 
  73. glad to include them in this package.  I ask only that 
  74.  
  75.  1. You make the user interface as much as possible like the AIX version 3.1 
  76.     counterpart. 
  77.  
  78.  2. You agree to fix bugs as time allows. 
  79.  
  80.  3. Your source is 'clean' and you agree to distribute it under the 
  81.     restrictions I outlined above. 
  82.  
  83. The program descriptions in the following chapters contain material taken from 
  84. AIX Commands Reference for IBM RISC System/6000. volumes 1 - 3. 
  85.  
  86.  
  87. ΓòÉΓòÉΓòÉ 2. The AIXLIKE Utilities ΓòÉΓòÉΓòÉ
  88.  
  89.  
  90. ΓòÉΓòÉΓòÉ 2.1. at ΓòÉΓòÉΓòÉ
  91.  
  92. at  --  Runs commands at a later time 
  93.  
  94. Usage 
  95.  
  96.     at  [-c | -k | -s] [-m] Time [Today | Date] [Increment] [-l | -r job]
  97.  
  98. The at command reads from standard input the names of commands to be run at a 
  99. later time and allows you to specify when the commands should be run. 
  100.  
  101. The AIX at command mails you all output from standard output and standard error 
  102. for the scheduled commands, unless you redirect that output.  It also writes 
  103. the job number and the scheduled time to standard error. The OS/2 version, 
  104. lacking an underlying mail system, puts the output in a directory called 
  105. \at\output.  The jobs are listed by job number. 
  106.  
  107. When the at command is executed, it retains the current process environment. 
  108. It does not retain open file descriptors, traps, and priority. 
  109.  
  110. You can use the AIX at command if your name appears in the file 
  111. /usr/adm/cron/at.allow.  If that file does not exist, the at command checks the 
  112. file /usr/adm/cron/at.deny to determine if you should be denied a  ccess to the 
  113. at command.  If neither file exists, only someone with root au  thority can 
  114. submit a job.  The allow/deny files contain one user name per lin  e. If (the 
  115. at.allow file does exist, the root user's login nmae must be included in it for 
  116. that person to be able to use the command.) In the OS/2 version, everyone has 
  117. permission to use the at command 
  118.  
  119. The required Time parameter can be one of the following: 
  120.  
  121.  1. A number followed by an optional suffix.  The at command interprets one- 
  122.     and two-digit numbers as hours.  It interprets four digits as hours and 
  123.     minutes.  The NLTIME environment variable specifies the order of hours and 
  124.     minutes.  The default      order is the hour followed by the minute.  You 
  125.     can also separate hour     s and minutes with a : (colon).  The default 
  126.     order is Hour:Minute. 
  127.  
  128.  2. The at command also recognizes the following keywords as special Times: 
  129.     noon, midnight, now, A for AM, P for PM, N for noon, and M for midnight. 
  130.     Note that you can use the special word now only if you also specify a Date 
  131.     or an Increment.  Otherwise, the at command tells you: too late.  The 
  132.     NLTSTRS environment variable controls the additional keywords that the at 
  133.     command recognizes. 
  134.  
  135. You may specify the Date parameter as either a month name and a day number (and 
  136. possibly a year number preceded by a comma), or a day of the week. The NLDATE 
  137. environment variable specifies the order of the month name and day number (by 
  138. default, month followed by day).  The NLLDAY environment variable specifies 
  139. long day names; NLSDAY and NLSMONTH specify short day and month names.  (By 
  140. default, the long name is fully spelled out; the short name is appreviated to 
  141. two or more characters for weekdays, and three characters for months).  The at 
  142. command recognizes two special "days", today and tomorrow by default. (The 
  143. NLSTRS environment variable specifies these special days.)  today is the 
  144. default Date if the specified time is later than the current hour; tomorrow is 
  145. the default if the time is earlier than the current hour.  If the specified 
  146. month is less than the current month (and a year is not given), next year is 
  147. the default year. The optional Increment can be one of the following: 
  148.  
  149.  1. A + (plus sign) followed by a number and one of the following words: 
  150.     minute[s], hour[s], day[s], week[s], month[s], year[s] (or their 
  151.     non-English equivalents). 
  152.  
  153.  2. The special word next followed by one of the following words: minute[s], 
  154.     hour[s], day[s], week[s], month[s], year[s] (or their non-English 
  155.     equivalents). 
  156.  
  157. FLAGS 
  158.  
  159. -c        Requests that the csh command be used for executing this job. (Not 
  160.           currently implemented in the OS2 version.  CMD.EXE is the shell used 
  161.           in all cases.  This flag, as well as the -k and -s flags, are 
  162.           accepted but not used.) 
  163.  
  164. -k        Requests that the ksh command be used for executing this job. 
  165.  
  166. -l        Reports your scheduled jobs 
  167.  
  168. -m        Mails a message to the user about the successful completion of the 
  169.           command.  (This flag is accepted but has no effect in the OS/2 
  170.           version.) 
  171.  
  172. -r Job    Removes Jobs previously scheduled by the at or batch commands, where 
  173.           job is the number assigned by the at or batch commands. In the AIX 
  174.           at, if you do not have root user authority (see the su command), you 
  175.           can only remove your own jobs.  The atrm command is available to the 
  176.           root user to remove jobs issued by other users or all jobs issued by 
  177.           a specific user. The OS/2 version allows anyone to remove any job. 
  178.  
  179. -s        Requests the bsh command (Bourne shell) be used for executing this 
  180.           job.  (Not currently implemented in the OS/2 version.) 
  181.  
  182. EXAMPLES 
  183.  
  184.  1. To schedule the command from the terminal, enter a command similar to one 
  185.     of the following: 
  186.  
  187.                        at 5 pm Friday uuclean
  188.                        Ctrl-Z
  189.  
  190.     Note:  In the OS/2 at command, as well as in most of the other programs in 
  191.     the AIXLIKE package, ctrl-D is not supported as a termination signal.  In 
  192.     the case of the OS/2 at command, ctrl-Z is required to indicate the end of 
  193.     input. 
  194.  
  195.                        at now next week uuclean
  196.                        Ctrl-Z
  197.  
  198.                        at now + 2 days uuclean
  199.                        Ctrl-Z
  200.  
  201.                        at now + 2 days
  202.                        uuclean
  203.                        Ctrl-Z
  204.  
  205.  2. To run the uuclean command at 3:00 in the afternoon on the 24th of January, 
  206.     enter any one of the following commands: 
  207.  
  208.                        echo uuclean | at 3:00 pm January 24
  209.  
  210.                        echo uuclean | at 3pm Jan 24
  211.  
  212.                        echo uuclean | at 1500 jan 24
  213.  
  214.  3. To have a job reschedule itself, invoke the at command from within the 
  215.     shell by including code similar to the following within the command file: 
  216.  
  217.                        echo "cmdfile" | at now tomorrow
  218.  
  219.  4. To list the jobs you have sent to be run later, enter: 
  220.  
  221.                        at -l
  222.  
  223.  5. To cancel a job, enter: 
  224.  
  225.                        at -r 63567720.026
  226.  
  227.     This cancels job 63567720.026.  Use the at -l command to list the job 
  228.     numbers assigned to your jobs. 
  229.  
  230. OS/2 SPECIFICS 
  231.  
  232. The OS/2 implementation has two programs: at.exe and atd.exe. The first is 
  233. loaded each time you invoke the at command.  The second is a daemon that is 
  234. invoked by the at command (if it is not already loaded) and remains loaded 
  235. until there is no more scheduled work. li.For the at command to work correctly 
  236. after a system restart, you must load atd.exe during the startup procedure. 
  237. (If there is no scheduled work, it quietly goes away.)  A good way to do this 
  238. is to put the line 
  239.  
  240.            atd
  241. in your STARTUP.CMD file.  (Add a path if necessary). 
  242.  
  243. The daemon, atd, has an associated icon.  Put the icon file (atd.ico in the 
  244. same directory as atd, or in a directory on your DPATH. 
  245.  
  246. The at function creates (if they don't already exist), three directories.  By 
  247. default, the directories are 
  248.  
  249.    C:\at  --  usually empty except for its subdirectories 
  250.    C:\at\jobs  --  where queued jobs are stored 
  251.    C:\at\output  --  where the output of executed jobs is stored 
  252.  
  253. You have control over the directory names.  Use the ATJOBS environment variable 
  254. to select the directory in which queued jobs are stored. Output will be stored 
  255. in a parallel directory named output. 
  256.  
  257. Output will accumulate in the at\out subdirectory.  Periodically (perhaps as 
  258. scheduled by at itself) you should clean it out. 
  259.  
  260.  
  261. ΓòÉΓòÉΓòÉ 2.2. atob, btoa ΓòÉΓòÉΓòÉ
  262.  
  263. btoa: converts a binary file to an ascii format suitable for mailing. 
  264.  
  265. atob: restores the original binary file 
  266.  
  267. Both these programs are filters.  They read from stdin and write to stdout.  To 
  268. use them, redirect the output as required.  For example, to create a mailable 
  269. ascii file from the file prog.exe, do something like 
  270.  
  271.    btoa <prog.exe >progexe.asc
  272.  
  273. To restore the original binary file, do something like 
  274.  
  275.    atob <progexe.asc >prog.exe
  276.  
  277. btoa encoding is more efficient, but less common than uuencoding (see uuencode 
  278. below).  btoa encoding results in a file that is approximately 25% larger than 
  279. the source binary file (usually slightly less than 25%; sometimes slightly 
  280. more).  uuencoding results in a file that is 33% larger than the original 
  281. binary file. Nevertheless, if you want to make sure the receiver can decode the 
  282. material you send, you are better off uuencoding. 
  283.  
  284.  
  285. ΓòÉΓòÉΓòÉ 2.3. compress, uncompress, or zcat ΓòÉΓòÉΓòÉ
  286.  
  287. compress: compress and expand data 
  288.  
  289. Syntax 
  290.  
  291.    compress [-d -f -v -c -b Bits] Name [Name...
  292.  
  293.    uncompress [-f -c -v] Name [Name...
  294.  
  295.    zcat Name [Name...
  296.  
  297. The compress command reduces the size of the named files using adaptive 
  298. Lempel-Ziv coding.  Whenever possible, each file is replaced by one with the 
  299. extension .Z while keeping the same ownership modes, access and modification 
  300. times.  Compressed files can be restored to their original form using the 
  301. uncompress or zcat command. 
  302.  
  303. The compress command uses the modified Lempel-Ziv algorithm popularized in A 
  304. Technique for High Performance Data Compression, Terry A. Welch, IEEE Computer, 
  305. Vo. 17, no. 6 (June, 1984), pp. 8-19. 
  306.  
  307. The amount of compression obtained depends on the size of the input, the number 
  308. of Bits per code, and the distribution of common substrings. 
  309.  
  310. Flags 
  311.  
  312. -d        Causes the compress command to uncompress Name. 
  313.  
  314. -f        Forces compression of Name even if it does not actually shrink or the 
  315.           corresponding Name file already exists.  If -f is not given, the user 
  316.           is prompted as to whether an existing Name file should be 
  317.           overwritten. 
  318.  
  319. -c        Makes the compress or uncompress command write to the standard 
  320.           output; no files are changed.  The non-destructive behavior of the 
  321.           acat command is identical to that of the uncompress -c command. 
  322.  
  323. -b Bits   Specified the maximum number of Bits to use to replace common 
  324.           substrings in the file.  The default for Bits is 16, with values of 9 
  325.           through 16 acceptable.  First, the algorithm uses 9-bit codes 2257 
  326.           thru 512.  Then it uses 10-bit codes, continuing until the limit 
  327.           specified by the -b flag is reached.  The -b flag is not permitted 
  328.           with the uncompress command. 
  329.  
  330.           After the Bits limit is attaned, the compress command periodically 
  331.           checks the compression ratio.  If it is increasing, the compress 
  332.           command continues to use the existing code dictionary.  However, if 
  333.           the compression ratio decreases, the compress command discards the 
  334.           table of substrings and rebuilds it from scratch.  This allows the 
  335.           algorithm to adapt to the next block of the file. 
  336.  
  337. -v        Causes the percentage reduction of each file to print. 
  338.  
  339. The logic for all three commands is in module compress.exe. If you want to have 
  340. OS/2 versions of uncompress and zcat, simply copy compress.exe to 
  341. uncompress.exe (on HPFS) or uncompre.exe (on FAT); and to zcat.exe. 
  342.  
  343.  
  344. ΓòÉΓòÉΓòÉ 2.4. df ΓòÉΓòÉΓòÉ
  345.  
  346. df: Reports information about space on file systems 
  347.  
  348. Usage 
  349.  
  350.      df [-l|-M|-i|-s|-v[ ]FileSystem FileSystem... | File File...]
  351.         \              / \                                      /
  352.          \            /   \                                    /
  353.           \..one of../     \................one of............/
  354.  
  355. The df command displays information about total space and available space on a 
  356. file system.  The FileSystem parameter specified the name of the device on 
  357. which the file system resides (the drive letter, under OS/2); in UNIX it can 
  358. also be the relative path name of a file system. If you do not specify the 
  359. FileSystem parameter, the df command displays information for all mounted file 
  360. systems.  If a file or directory is specified, then the df command displays 
  361. information for the file system on which the file resides. 
  362.  
  363. If the file system is being actively modified when the df command is run, the 
  364. free count may not be accurate. 
  365.  
  366. The FileSystem specifications, if given, must be in the form 
  367.  
  368.        d:
  369. where d is the drive letter on which the file system is mounted. 
  370.  
  371. The File specifications, if given, are relative to the current working 
  372. directory. 
  373.  
  374. Flags 
  375.  
  376. -i        Specified that the number of free and used i-nodes for the file 
  377.           system is displayed; this is the default when the specified file 
  378.           system is mounted. This flag is accepted but ignored for OS/2. 
  379.  
  380. -l        Specified that information on total K bytes, used space, free space, 
  381.           percentage of used space, and mount point for the file system is 
  382.           displayed. 
  383.  
  384. -M        Specifies that the mount point information for the file system is 
  385.           displayed in the second column. 
  386.  
  387. -s        Specifies a full search of the free block list.  This flag is 
  388.           accepted but ignored for OS/2. 
  389.  
  390. -v        Specifies that all information for the specified file system is 
  391.           displayed.  Same as -l. 
  392.  
  393.  
  394. ΓòÉΓòÉΓòÉ 2.5. du ΓòÉΓòÉΓòÉ
  395.  
  396. du -- summarizes disk usage. 
  397.  
  398. Syntax: 
  399.  
  400.       du [-lrs] [-a] [-b] File or Directory ...
  401.  
  402. The du command displays the number of bytes for all files and directories 
  403. specified by the File and Directory parameters, and recursively, for all 
  404. directories within the specified Directory Parameter.  By specifying the -a 
  405. flag, you can also have the du command report the number of bytes in individual 
  406. files.  The byte count includes all space allocated for the file (including 
  407. unused space), and will usually be a larger number than is shown by the OS/2 
  408. dir command. 
  409.  
  410. The AIX implementation reports space in 1024-byte blocks.  The OS/2 version 
  411. reports bytes unless you specify the -b flag, which forces reporting to 
  412. 1024-byte blocks.  Not that many devices have an allocation unit smaller than 
  413. 1024, however, so rounding errors may occur, and a list of modules may not add 
  414. up to the correct total of blocks. 
  415.  
  416. NOTES: 
  417.  
  418.  1. If the -a flag is not specified, the du command does not report on any 
  419.     individual files. 
  420.  
  421. FLAGS: 
  422.  
  423. -a        Displays disk use for each file 
  424.  
  425. -b        (OS/2 only) displays usage in 1024-byte blocks.  If this flag is not 
  426.           used, usage is displayed in bytes. 
  427.  
  428. -l        Allocates blocks evenly over links.  Has no effect under OS/2. 
  429.  
  430. -r        Indicates inaccessible files and directories. 
  431.  
  432. -s        Displays only the total sum (for each of the specified files or 
  433.           directories given). 
  434.  
  435. EXAMPLES: 
  436.  
  437.  1. To summarize the disk usage of a directory tree and each of its subtrees, 
  438.     enter 
  439.  
  440.               du \u\fran
  441.  
  442.     This displays the number of bytes in the \u\fran directory and each of its 
  443.     subdirectories. 
  444.  
  445.  2. To display the disk usage of each file, enter: 
  446.  
  447.               du -a \u\fran
  448.  
  449.     This displays the bytes contained in each file and subdirectory of the 
  450.     \u\fran directory.  The number beside a directory is the disk usage of that 
  451.     directory tree.  The number beside a regular file is the disk usage of that 
  452.     file alone. 
  453.  
  454.  3. To display only the total disk usage of a directory tree, enter: 
  455.  
  456.               du -rs \u\fran
  457.  
  458.     This displays only the sum total disk usage of the \u\fran directory and 
  459.     the files it contains.  Specify the -s flag.  The -r flag tells the du 
  460.     command to display an error message if it cannot read a file or directory. 
  461.  
  462.  
  463. ΓòÉΓòÉΓòÉ 2.6. fgrep ΓòÉΓòÉΓòÉ
  464.  
  465. fgrep -- searches a file for a pattern. 
  466.  
  467. Usage: 
  468.  
  469.           fgrep [-v][-x][-h][-s][-i] [-c | -l] [-b | -n]
  470.                 [Pattern | -e Pattern | -f StringFile] File [File...
  471.  
  472. The fgrep command searches the input files specified by the File parameter 
  473. (standard input by default) for lines matching a pattern.  The fgrep command 
  474. searches specifically for Pattern parameters that are fixed strings. The fgrep 
  475. command displays the name of the file containing the matched line if you 
  476. specify more than one file in the File parameter. The exit values of this 
  477. command are: 
  478.  
  479. 0    A match was found 
  480.  
  481. 1    No match was found 
  482.  
  483. 2    A syntax error was found or a file was inaccessible (even if matches were 
  484.      found). 
  485. Flags: 
  486.  
  487. -b                      Precedes each line by the block number on which it was 
  488.                         found. Use this flag to help find disk block numbers by 
  489.                         context. (In this implementation the relative 
  490.                         allocation unit number is shown); 
  491.  
  492. -c                      Displays only a count of matching lines. 
  493.  
  494. -e Pattern              Specifies a pattern.  This works the same as a simple 
  495.                         pattern, but is useful when a pattern begins with a -. 
  496.  
  497. -f StringFile           Specifies a file that contains strings to be matched. 
  498.                         (The file may specify up to 256 strings in this OS/2 
  499.                         implementation). 
  500.  
  501. -h                      Suppresses file names when multiple files are being 
  502.                         processed. 
  503.  
  504. -i                      Ignores the case of lettters when making comparisons. 
  505.  
  506. -l                      Lists just the names of files (once) with matching 
  507.                         lines.  Each file name is separated by a new-line 
  508.                         character. 
  509.  
  510. -n                      Precedes each line with its relative line number in the 
  511.                         file. 
  512.  
  513. -s                      Search all subdirectories below the specified path 
  514.                         (OS/2 only). NOTE:  in the AIX implementation, the -s 
  515.                         switch indicates that no search results should be 
  516.                         printed and that only error messages should be 
  517.                         displayed. For consistancy, I have chosen to override 
  518.                         this not-all-that-useful switch. 
  519.  
  520. -v                      Displays all lines except those that match the 
  521.                         specified pattern. 
  522.  
  523. -x                      Displays lines that match the pattern exactly with no 
  524.                         additional characters. 
  525.  
  526. -y                      Ignore case of letters when making comparisons 
  527.  
  528.  
  529. ΓòÉΓòÉΓòÉ 2.7. find ΓòÉΓòÉΓòÉ
  530.  
  531. find -- finds files with a matching expression. 
  532.  
  533. The find command recursively searches the directory tree for each specified 
  534. path seeking files that match a Boolean Expression written using the terms 
  535. given below.  The output from the find command depends on the terms used in 
  536. Expression. 
  537.  
  538.         find   Path [Path ...] Expression
  539. Note:  In the following descriptions, the parameter Number is a decimal integer 
  540. that can be specified as +Number (more than Number), -Number (less than 
  541. Number), or Number (exactly Number). 
  542.  
  543. -fstype Type                True if the file system to which the file belongs 
  544.                             is of the type Type, where Type is jfs (journaled 
  545.                             file system) or nfs (networked file system). 
  546.  
  547.                             In OS/2, ALWAYS TRUE. 
  548.  
  549. -inum Number                True if the i-node is Number.  In OS/2, ALWAYS 
  550.                             TRUE. 
  551.  
  552. -name FileName              True if FileName matches the file name.  You can 
  553.                             use pattern-matching characters, provided they are 
  554.                             quoted. 
  555.  
  556. -perm OctalNumber           In OS/2, ALWAYS TRUE. 
  557.  
  558. -prune                      In OS/2, ALWAYS TRUE. 
  559.  
  560. -type Type                  True if the file Type is of the specified type, as 
  561.                             follows: 
  562.  
  563.    b   Block special file (In OS/2, ALWAYS FALSE) 
  564.  
  565.    c   Character file   (In OS/2, ALWAYS FLASE) 
  566.  
  567.    d   Directory 
  568.  
  569.    f   Plain file 
  570.  
  571.    p   FIFO (a named pipe) 
  572.  
  573.    l   Symbolic link    (In OS/2, ALWAYS FALSE) 
  574.  
  575.    s   Socket 
  576.  
  577. -links Number               True if the file has Number links. In OS/2, ALWAYS 
  578.                             FALSE. 
  579.  
  580. -user UserName              True if the file belongs to user UserName. In OS/2, 
  581.                             ALWAYS TRUE. 
  582.  
  583. -group GroupName            True if the file belongs to group GroupName. In 
  584.                             OS/2, ALWAYS TRUE. 
  585.  
  586. -nogroup                    True if the file belongs to no groups.  In OS/2, 
  587.                             ALWAYS TRUE. 
  588.  
  589. -size Number                True if the file is Number blocks long (512 bytes 
  590.                             per block).  For this comparision, the file size is 
  591.                             rounded up to the next higher block. 
  592.  
  593. -atime Number               True if the file has been accessed in Number days. 
  594.  
  595. -mtime Number               True if the file has been modified in Number days. 
  596.  
  597. -ctime Number               True if the file has beeen changed in Number days. 
  598.  
  599. -exec Command               True if the Command runs and returns 0.  The end of 
  600.                             Command must be punctuated by a quoted or escaped 
  601.                             semicolon.  A command parameter of {} is replaced 
  602.                             by the current path name. 
  603.  
  604. -ok Command                 The find command asks you whether it should start 
  605.                             Command.  If your response begins with Y (upper or 
  606.                             lower case), Command is started.  The end of 
  607.                             Command must be punctuated by a quoted or escaped 
  608.                             semicolon. 
  609.  
  610. -print                      Always true; causes the current path name to be 
  611.                             displayed.  The find command does not display path 
  612.                             names unless you specify this expression term. 
  613.  
  614. -cpio Device                Write the current file to Device in the cpio 
  615.                             command format. Always fails in OS/2. 
  616.  
  617. -newer File                 True if the current file has been modified more 
  618.                             recently than the file indicated by File. 
  619.  
  620. -\( Expression \)           True if the expression in parentheses is true. 
  621.  
  622. -depth                      Always true.  Supposed to cause the descent of the 
  623.                             directory hierarchy to be done so that all entries 
  624.                             in a directory are affected before the directory 
  625.                             itself.  This can be useful when the find commdna 
  626.                             is used with the cpio command to transfer files 
  627.                             that are contained in directories without write 
  628.                             permission. 
  629.  
  630.                             Does nothing at all in OS/2. 
  631.  
  632. -ls                         Always true;  prints more path information. 
  633.  
  634. -xdev                       Always true;  no effect in OS/2. 
  635.  
  636. -o                          logical or.  (Juxtaposition of two terms without -o 
  637.                             implies a logical and.) 
  638.  
  639. !                           Negation of an expression term 
  640.  
  641.  
  642. ΓòÉΓòÉΓòÉ 2.8. grep ΓòÉΓòÉΓòÉ
  643.  
  644. grep -- searches a file for a pattern. 
  645.  
  646. Usage: 
  647.  
  648.           grep [-i][-w][-y][-q][-s][v][-pSeperator [-c | -l] [-b | -n]
  649.                 [Pattern | -e Pattern | File [File...
  650.  
  651. The grep command searches for the pattern specified by the Pattern parameter 
  652. and writes each matching line to standard output.  The patterns are limited 
  653. regular expressions in the style of the ed command. 
  654.  
  655. The grep command displays the name of the file containing the matched line if 
  656. you specify more than one name in the File parameter. Characters with special 
  657. meaning to the OS2 shell must be quoted when they appear in the Pattern 
  658. parameter.  When the Pattern parameter is not a simple string, you usually must 
  659. enclose the entire pattern in double quotation marks.  In an expression such as 
  660. [a-z], the minus means through according to the current collating sequence.  A 
  661. collating sequence may define equivalence classes for use in the character 
  662. ranges. The exit values of this command are: 
  663.  
  664. 0    A match was found 
  665.  
  666. 1    No match was found 
  667.  
  668. 2    A syntax error was found or a file was inaccessible (even if matches were 
  669.      found). 
  670.  
  671. Notes: 
  672.  
  673.  1. Lines are limited to 512 characters; longer lines are broken into multiple 
  674.     lines of 512 or fewer characters. 
  675.  
  676.  2. Paragraphs (under the -p flag) are currently limited to a length of 5000 
  677.     characters. 
  678.  
  679. Flags: 
  680.  
  681. -b                  Precedes each line by the block number on which it was 
  682.                     found. Use this flag to help find disk block numbers by 
  683.                     context. (In this implementation the relative allocation 
  684.                     unit number is shown); 
  685.  
  686. -c                  Displays only a count of matching lines. 
  687.  
  688. -e Pattern          Specifies a pattern.  This works the same as a simple 
  689.                     pattern, but is useful when a pattern begins with a -. 
  690.  
  691. -i                  Ignores the case of lettters when making comparisons. 
  692.  
  693. -l                  Lists just the names of files (once) with matching lines. 
  694.                     Each file name is separated by a new-line character. 
  695.  
  696. -n                  Precedes each line with its relative line number in the 
  697.                     file. 
  698.  
  699. -pSeperator         Displays the entire paragraph containing matched lines. 
  700.                     Paragraphs are delimited by paragraph seperators, as 
  701.                     specified by the Seperator parameter, which is a pattern in 
  702.                     the same form as the search pattern.  Lines containing the 
  703.                     paragrphs seperators are used only as seperators; they are 
  704.                     never included in the output.  The default paragraph 
  705.                     seperator is a blank line. 
  706.  
  707. -q                  Suppresses error messages about files that are not 
  708.                     accessible. 
  709.  
  710. -s                  Search all subdirectories below the specified path. NOTE: 
  711.                     in the AIX implementation, the -s switch indicates that no 
  712.                     search results should be printed and that only error 
  713.                     messages should be displayed. For consistancy, I have 
  714.                     chosen to override this not-all-that-useful switch. 
  715.  
  716. -v                  Displays all lines except those that match the specified 
  717.                     pattern. 
  718.  
  719. -w                  Does a word search. 
  720.  
  721. -y                  Ignore case of letters when making comparisons 
  722.  
  723. This OS/2 implementation is slower than Ralph Yozzo's implementation available 
  724. in the GREP package on PCTOOLS.  If you have a lot of grepping to do, you might 
  725. want to use Ralph's.  On the other hand, this implementation retains the 
  726. traditional behavior of the utility, and may act more like you expect.  This 
  727. version also supports ed-type general expressions, including subpatterns and 
  728. recursion operators, which Ralph's does not. 
  729.  
  730.  
  731. ΓòÉΓòÉΓòÉ 2.9. head ΓòÉΓòÉΓòÉ
  732.  
  733. Head -- displays the first few lines of a file or files. 
  734.  
  735. Usage 
  736.  
  737.        head [-Count] [File [File ...
  738.  
  739. where 
  740.  
  741. Count          Specifies the number of lines of each of the specified files to 
  742.                be displayed. 
  743.  
  744. File           Specifies 0 or more file specs.  The default in stdin. 
  745.  
  746.  
  747. ΓòÉΓòÉΓòÉ 2.10. kill ΓòÉΓòÉΓòÉ
  748.  
  749. Kill -- sends a signal to a running process 
  750.  
  751. Usage 
  752.  
  753.        kill [-l] or [-Signal] pid
  754.                  or
  755.        kill 0 or -1
  756.  
  757. The kill command sends a signal (by default, the KillProcess signal) to a 
  758. running process which you specify by process ID (pid). This default action 
  759. normally stops processes that ignore or do not catch the signal.  The OS/2 
  760. command PSTAT reports process IDs. You can also use the AIXLIKE ps command to 
  761. find the process ID number of commands. 
  762.  
  763. If you are not a root user, you must own the process you want to stop. When 
  764. operating as a root user, you can stop any process.  In OS/2 you are always the 
  765. root user. 
  766.  
  767. Flags 
  768.  
  769. 0                     In AIX, sends the signal to all processes having a PID 
  770.                       equal to the PID of the sender (except those with PIDs 0 
  771.                       and 1).  In OS/2 it does nothing at all. 
  772.  
  773. -1                    In Aix, sends the signal to all processes with a PID 
  774.                       equal to the effective user ID of the sender (except to 0 
  775.                       and 1).  In OS/2 it does nothing at all. 
  776.  
  777. ProcessID             Sends the signal to all processes whose process-group 
  778.                       number is equal to the absolute value of the ProcessID 
  779.  
  780. -l                    Lists supported signal names and numbers: 
  781.  
  782.    KillProcess 
  783.    SIGBREAK 
  784.    SIGINTR 
  785.    SIGUSER1 
  786.    SIGUSER2 
  787.    SIGUSER3 
  788.  
  789. -Signal               The signal can be the signal number or the signal name. 
  790.  
  791. NOTE:  This has not been well-exercised on OS/2 version 2.0.  I suspect it may 
  792. have problems. 
  793.  
  794.  
  795. ΓòÉΓòÉΓòÉ 2.11. more ΓòÉΓòÉΓòÉ
  796.  
  797. more or page -- Displays continuous text one screen at a time on a display 
  798. screen. 
  799.  
  800. Usage 
  801.  
  802.          more -cdflsu -n +Number    File [File ...
  803.           or                or
  804.          page            +/Pattern
  805.  
  806. The more command displays continuous text one screen at a time. It pauses after 
  807. each screen adn prints the word More at the bottom of the screen. If (you then 
  808. press a carriage return, the more command displays an additional line.  If you 
  809. press the space bar, the more command displays another screen of text. NOTE: 
  810.  
  811. The OS/2 version does not support differences between the 'page' and 'more' 
  812. commands.  If you want a 'page', just rename 'more'. 
  813.  
  814. Only attached OS/2 displays have been tested.  You may have trouble with an 
  815. attached ascii terminal or with telnet.  If you do, please report it. 
  816.  
  817. Flags: 
  818.  
  819. -c          Keeps the screen from scrolling and makes it easier to read text 
  820.             while the more command is writing to the terminal.  The -c flag is 
  821.             ignored if the terminal does not have the ability to clear to the 
  822.             end of a line. 
  823.  
  824.             Under OS/2, this option is much faster than the scrolling case. 
  825.  
  826. -d          Prompts the user to continue, quit, or obtain help. 
  827.  
  828. -f          Causes the more command to count logical lines, rather than screen 
  829.             lines.  The -f flag is recommended if the nroff command is being 
  830.             piped through the ul command. 
  831.  
  832. -l          Does not treat control-L (form feed) in a special manner. If the -l 
  833.             flag is not supplied, the more command pauses after any line that 
  834.             contains a control-L, as though a full screen of text has been 
  835.             reached.  If a file begins with a form feed, the screen is cleared 
  836.             before the file is printed. 
  837.  
  838. -n          (Where n is an integer) specified the number of lines in the 
  839.             window.  If the -n flag is specified, the more command does not use 
  840.             the default number. 
  841.  
  842. -s          Squeezes multiple blank lines from the output to produce only one 
  843.             blank line.  The -s flag is particularly helpful when viewing 
  844.             output from the nroff command.  This flag maximizes the useful 
  845.             information present on the screen. 
  846.  
  847.             Not implemented for OS/2 yet. 
  848.  
  849. -u          Suppresses the more command from underlining or creating stand-out 
  850.             mode for underlined information in a source file. 
  851.  
  852. +Number     Starts at the specified line Number. 
  853.  
  854. +/Pattern   Starts two lines before the line containint the regular expression 
  855.             Pattern. 
  856.  
  857. In AIX, the more command uses the file /etc/terminfo to determine terminal 
  858. characteristics and to determine the default window size; in OS/2, I haven't 
  859. figured out how to do it yet, except in the locally attached case. On a 
  860. terminal capable of displaying 24 lines, the default window size is 22 lines. 
  861. If the more command is reading from a file rather than a pipe, it displays a 
  862. percent sign (%) with the more command prompt.  This provides the fraction of 
  863. the file (in characters, not lines) that the more command has read. The page 
  864. command is equivalent to the more command. 
  865.  
  866. Command Sequences: 
  867.  
  868.  Other command sequences that can be entered when the more command 
  869.  
  870.   pauses are as follows ( | is an optional integer option, defaulting
  871.   to 1):
  872.  
  873. |<space>    Displays / more lines (or another screen full of text if no option 
  874.             is given). 
  875.  
  876. ctrl-D      Displays 11 more lines (a "scroll").  If i is given, the scroll 
  877.             size is set to i/.  Same as d. 
  878.  
  879. d           Displays 11 more lines (a "Scroll").  Same as ctrl-D. 
  880.  
  881. .|z         Same as typing a space except that if | is present, it becomes the 
  882.             new window size. 
  883.  
  884. |s          Skips | lines and prints a full screen of lines. 
  885.  
  886. |f          Skips | screens and prints a full screen of lines 
  887.  
  888. |b          Skips back I screens and prints a full screen of lines 
  889.  
  890. |ctrl-B     Skips back / screens and prints a full screen of lines. 
  891.  
  892. q or Q      Exits from more command. 
  893.  
  894. =           Displays the current line number 
  895.  
  896. v           Invokes vi editor <Not implemented in OS/2 version > 
  897.  
  898. h           This is the help command.  Provides a description for all the more 
  899.             commands. 
  900.  
  901. |/expr      Searches for the |-th occurance of the regular expression 
  902.             Expression.  If there are less than | occurances of Expression/, 
  903.             and the input is a file (rather than a pipe), the position in the 
  904.             file remains unchanged.  Otherwise, a full screen is displayed, 
  905.             starting two lines prior to the location of the expression. 
  906.  
  907. |n          Searches for the |th occurance of the last regular expression 
  908.             entered.  Goes to the point from which the last search started.  If 
  909.             a search has not been performed in the current file, this sequence 
  910.             causes the more command to go to the beginning of the file. 
  911.  
  912. !command    Invokes a shell.  The characters '%' and '!' in the command 
  913.             sequence replaced with the current file name and the previous shell 
  914.             command respectively.  If there is no current file name, '%' is not 
  915.             expanded.  The sequences "\%" and "\!" are replaced by"%" and "!" 
  916.             respectively. 
  917.  
  918. i:n         Skips to the I/th next file given in the command line. If n is not 
  919.             valid, skips to the last file. 
  920.  
  921. .i:p        Skips to the I/th previous file given in the command line. If this 
  922.             sequence is entered while the more command is in the middle of 
  923.             printing a file, the more command goes back to the beginning of the 
  924.             file. 
  925.  
  926. :f          Displays the current file name and line number. 
  927.  
  928. :q or :Q    Exits (same as q or Q). 
  929.  
  930. . (dot)     Repeats the previous command. 
  931.  
  932. When any of the command sequences are entered, they begin to process 
  933. immediately.  It is not necessary to type a carriage return. 
  934.  
  935. The more command sets terminals to Noecho mode.  This enables the output to be 
  936. continuous and only displays the / and ! commanda on your terminal as your 
  937. type.  If the standard output is not a terminal, the more command processes 
  938. like the cat command.  However, it prints a header before each file (if there 
  939. is more than one file). 
  940.  
  941. NOTE:  This has not been well-exercised on OS/2 version 2.0.  I suspect it may 
  942. have problems. 
  943.  
  944. Implementation Notes 
  945.  
  946. o I've decided to set a maximum number of files at 64.  I won't even try to 
  947.   process more than that. 
  948.  
  949. o I'm going to use VIO for video output. 
  950.  
  951.  
  952. ΓòÉΓòÉΓòÉ 2.12. printenv ΓòÉΓòÉΓòÉ
  953.  
  954. printenv -- Displays the values of the variables in the environment. 
  955.  
  956. Syntax 
  957.  
  958.            prinvent [name [name ...
  959.  
  960. The printenv command displays the values of the variables in the environment. 
  961. If a Name is specified, only its value is printed. If a Name is not specified, 
  962. the printenv command displays the current environment, one Name=Value per line. 
  963.  
  964. If a Name is specified and it is not defined in the environment, the printenv 
  965. command returns exit status 1, else it returns status 0. 
  966.  
  967.  
  968. ΓòÉΓòÉΓòÉ 2.13. ps ΓòÉΓòÉΓòÉ
  969.  
  970. The OS/2 process model is so different, it's amazing that you get anything at 
  971. all when you enter ps.  What you do see has no relation whatever to what you 
  972. get from the AIX version. 
  973.  
  974. You can put anything on the command line.  Anything but -? or -help will be 
  975. ignored. 
  976.  
  977. The following fields are displayed: 
  978.  
  979. Heading         Content 
  980.  
  981. PID            Process ID 
  982.  
  983. PPID           Parent's Process ID 
  984.  
  985. SID            Session ID 
  986.  
  987. MHNDL          Module handle 
  988.  
  989. THRDS          Number of threads 
  990.  
  991. MODS           Number of module entries 
  992.  
  993. SEMS           Number of System Semaphores 
  994.  
  995. SSEG           Number of Shared Segments 
  996.  
  997. COMMAND        'Name' field from def file 
  998.  
  999. The ps command will fail with a version check message on OS/2 version 2. There 
  1000. is a new API, Dos32QuerySysStat, in version 2.0 that appears to provide the 
  1001. same kinds of information as the old, undocumented DosQProcStat call in version 
  1002. 1.x, but I haven't figured out how to use it yet. 
  1003.  
  1004.  
  1005. ΓòÉΓòÉΓòÉ 2.14. pwd ΓòÉΓòÉΓòÉ
  1006.  
  1007. pwd -- Displays the path name of the working directory. 
  1008.  
  1009. Syntax: 
  1010.  
  1011.          pwd
  1012.  
  1013. The pwd command writes to standard output the full path name of your current 
  1014. directory (from the root directory <of the current drive>. All directories are 
  1015. seperated by a < \ (backslash>.  <The current drive is represented first, 
  1016. followed by a colon, then> the root directory. The last directory name is your 
  1017. current directory. 
  1018.  
  1019.  
  1020. ΓòÉΓòÉΓòÉ 2.15. rm ΓòÉΓòÉΓòÉ
  1021.  
  1022. rm  --  Deletes file objects. 
  1023.  
  1024. Usage: 
  1025.  
  1026.           rm [-f][-i][-r][-] File [File ...
  1027.  
  1028. Flags 
  1029.  
  1030. -f      instructs program to delete even those modules that are READONLY. 
  1031.  
  1032. -i      prompt user before deleting each file.  When used in conjunction with 
  1033.         the -r switch, the user is also prompted as each subdirectory is dived 
  1034.         into. 
  1035.  
  1036. -r      recursive.  Delete all subdirectories below the indicated file object. 
  1037.         BE VERY CAREFUL WITH THIS!  You have been warned. 
  1038.  
  1039. -       consider everything following to be a file name.  Not very useful in an 
  1040.         OS/2 environment, where file names can't start with '-', but we retain 
  1041.         it for conformity. 
  1042.  
  1043.  
  1044. ΓòÉΓòÉΓòÉ 2.16. sed ΓòÉΓòÉΓòÉ
  1045.  
  1046. sed -- provides a stream editor 
  1047.  
  1048. Syntax: 
  1049.  
  1050.              sed [-n] [-e Script] [-f SourceFile]   File
  1051.                            |              |           |
  1052.                            |              |           |
  1053.                            ----------------------------
  1054.                                         |
  1055.                                  0 or more of each
  1056.  
  1057. Description: 
  1058.  
  1059. The sed command modifies lines from the specified File according to an edit 
  1060. script and writes them to standard output.  The sed command includes many 
  1061. features for selecting lines to be modified and making changes only to the 
  1062. selected lines. 
  1063.  
  1064. The sed command uses two work spaces for holding the line being modified: the 
  1065. pattern space, where the selected line is held; and the hold space, where a 
  1066. line can be stored temporarily. 
  1067.  
  1068. An edit script consists of individual subcommands, each one on a seperate line. 
  1069. The general form of sed subcommands is the following: 
  1070.  
  1071.          [address-range] function [modifiers]
  1072.  
  1073. The sed command processes each input File by reading an input line into a 
  1074. pattern space, applying all sed subcommands in sequence whose addresses select 
  1075. that line, and writing the pattern space to standard output. It then clears the 
  1076. pattern space and repeats this process for each line in the input File.  Some 
  1077. of the subcommands use a hold space to save all or part of the pattern space 
  1078. for subsequent retrieval. 
  1079.  
  1080. When a command includes an address (either a line number or a search pattern), 
  1081. only the addressed line or lines are affected by the command. Otherwise, the 
  1082. command is applied to all lines. 
  1083.  
  1084. An address is either a decimal line number, a $ (dollar sign), which addresses 
  1085. the last line of input, or a context address.  A context address is a regular 
  1086. expression similar to those used in ed except for the following differences: 
  1087.  
  1088.    o You can select the character delimiter for patterns.  The general form of 
  1089.      the expression is 
  1090.  
  1091.                  ?pattern?
  1092.      where ? is a character delimiter you select. The default form for the 
  1093.      pattern is  /pattern/. 
  1094.  
  1095.    o The \n sequence matches a new-line character in the pattern space, except 
  1096.      the terminating new line. 
  1097.  
  1098.    o A dot (.) matches any character except a terminating new-line character. 
  1099.      That is, unlike ed, which cannot match a new-line character in the middle 
  1100.      of a line, sed can match a new-line character in the pattern space. 
  1101.  
  1102. Certain commands allow you to specify one line or a range of lines to which the 
  1103. command should be applied.  These commands are called addressed commands.  The 
  1104. following rules apply to addresses commands: 
  1105.  
  1106.    o A command line with no address selects every line. 
  1107.  
  1108.    o A command line with one address, expressed in context form, selects each 
  1109.      line that matches the address. 
  1110.  
  1111.    o A command line with two addresses separated by commas selects the entire 
  1112.      range from the first line that matches the first address to next line that 
  1113.      matches the second.  If the second address is a number less than or equal 
  1114.      to the line number first selected, only one line is selected.  Thereafter, 
  1115.      the process is repeated, looking again for the first address. 
  1116.  
  1117. NOTES: 
  1118.  
  1119.  1. The Text parameter accompanying the a\, c\ and i\ commands can continue 
  1120.     onto more than one line provided all lines but the last end with a \ to 
  1121.     quote the new-line character. Back slashes in text are treated like back 
  1122.     slashes in the replacement string of an s command, and can be used to 
  1123.     protect initial blanks and tabs against the stripping that is done on every 
  1124.     script line.  The RFile and WFile parameters must end the command line and 
  1125.     must be preceded by exactly one blank. Each WFile is created before 
  1126.     processing begins. 
  1127.  
  1128.  2. The sed command can process up to 99 commands in a pattern file. 
  1129.  
  1130. Flags 
  1131.  
  1132. -e Script         Uses the Script string as the editing script.  If you are 
  1133.                   using just one -e flag and no -f flag, the -e can be omitted. 
  1134.  
  1135. -f SourceFile     Uses SourceFile as the source of the edit script. SourceFile 
  1136.                   is a prepared set of editing commands to be applied to Fi le. 
  1137.  
  1138. -n                Suppresses all information normally written to standard 
  1139.                   output. 
  1140.  
  1141. Commands (the number of allowable arguments, in parentheses, is shown preceding 
  1142. the command). 
  1143.  
  1144. (1)a\nText                    Places Text on the output before reading the next 
  1145.                               input line. The script syntax is a\<new line 
  1146.                               character>Text. 
  1147.  
  1148. (2)b[label]                   Branches to the : command bearing the label.  If 
  1149.                               label is the null string, it brances to the end 
  1150.                               of the script. 
  1151.  
  1152. (2)c\nText                    Deletes the pattern space; with 0 or 1 addresses, 
  1153.                               or at the end of a 2-address range, places Text 
  1154.                               on the output.  Then it starts the next cycle. 
  1155.                               The script syntax is c\<new line character>Text. 
  1156.  
  1157. (2)d                          Deletes the pattern space.  Then it starts the 
  1158.                               next cycle. 
  1159.  
  1160. (2)D                          Deletes the initial segment of the pattern space 
  1161.                               through the first new-line character.  Then it 
  1162.                               starts the next cycle. 
  1163.  
  1164. (2)g                          Replaces the contents of the pattern space with 
  1165.                               the contents of the hold space. 
  1166.  
  1167. (2)G                          Appends the contents of the hold space to the 
  1168.                               pattern space. 
  1169.  
  1170. (2)h                          Replaces the contents of the hold space with the 
  1171.                               contents of the pattern space. 
  1172.  
  1173. (2)H                          Appends the contents of the pattern space to the 
  1174.                               hold space. 
  1175.  
  1176. (1)i\nText                    Writes Text to standard output before reading the 
  1177.                               next line into the pattern space. The script 
  1178.                               syntax is i\<new line character>Text. 
  1179.  
  1180. (2)l                          Writes the patttern space to standard output 
  1181.                               showing non-displayable characters as 2- or 
  1182.                               4-digit hex values. Long lines are folded. 
  1183.  
  1184. (2)n                          Writes the pattern space to standard output.  It 
  1185.                               replaces the pattern space with the next line of 
  1186.                               input. 
  1187.  
  1188. (2)N                          Appends the next line of input to the pattern 
  1189.                               space with an embedded new-line character (the 
  1190.                               current line number changes).  You can use this 
  1191.                               to search for patterns that are split onto two 
  1192.                               lines. 
  1193.  
  1194. (2)p                          Writes the pattern space to standard output. 
  1195.  
  1196. (2)P                          Writes the initial segment of the pattern space 
  1197.                               through the first new line character to standard 
  1198.                               output. 
  1199.  
  1200. (1)q                          Branches to the end of the script.  It does not 
  1201.                               start a new cycle. 
  1202.  
  1203. (2)r RFile                    reads the contents of RFile.  It places contents 
  1204.                               on the output before reading the next input line. 
  1205.  
  1206. (2)s/pattern/replacement/flags Substitutes replacement string for the first 
  1207.                               occurance of the pattern in the pattern space. 
  1208.                               Any character be substituted the / delimiter. 
  1209.  
  1210.                               You can add zero or more of the following flags: 
  1211.  
  1212.    g       Substitutes all nonoverlapping instances of the pattern parameter, 
  1213.            rather than just the first one. 
  1214.  
  1215.    p       Writes the pattern psace to standard out if a replacement was made. 
  1216.  
  1217.    w WFile Writes the pattern pace to WFile if a replacement was made. Appends 
  1218.            the pattern space to WFile. If (WFile was not already created by a 
  1219.            previous write by this sed script, sed creates it. 
  1220.  
  1221.                               NOTE: in the replacement string, the unescaped 
  1222.                               character '&' stands for the text matched by the 
  1223.                               pattern string. 
  1224.  
  1225. (2)t label                    Branches to :label in the script file if any 
  1226.                               substitutions were made since the most recent 
  1227.                               reading of an input line or execution of a t 
  1228.                               subcommand.  If you do not specify label, control 
  1229.                               transfers to the end of the script. 
  1230.  
  1231. (2)w WFile                    Appends the pattern space to WFile. 
  1232.  
  1233. (2)x                          Exchanges the contents of the pattern space and 
  1234.                               the hold space. 
  1235.  
  1236. (2)y/pattern1/pattern2/       Replaces all occurances of characters in pattern1 
  1237.                               with the corresponding pattern2 characters.  They 
  1238.                               byte lengths of pattern1 and pattern2 must be 
  1239.                               equal. 
  1240.  
  1241. (2)! sed-cmd                  Applies the subcomand only to lines NOT selected 
  1242.                               by the address or adresses. 
  1243.  
  1244. (0):label                     This script entry simply marks a branch point to 
  1245.                               be referenced by the b and t commands.  This 
  1246.                               label can be any sequence of 8 or fewer bytes 
  1247.                               (actually, in this implementation it can be any 
  1248.                               length). 
  1249.  
  1250. (1)=                          Writes the current line number of standard output 
  1251.                               as a line. 
  1252.  
  1253. (2){subcmd ... ...}           Groups subcommands enclosed in {} (braces). 
  1254.  
  1255.  
  1256. ΓòÉΓòÉΓòÉ 2.17. sleep ΓòÉΓòÉΓòÉ
  1257.  
  1258. Suspends execution for an interval. 
  1259.  
  1260. Usage: 
  1261.  
  1262.              sleep Seconds
  1263.  
  1264. The sleep command suspends execution of a process for the interval specified by 
  1265. Seconds.  Seconds can range from 1 to 32767. 
  1266.  
  1267. To interupt the sleep command, press ctl+break. 
  1268.  
  1269.  
  1270. ΓòÉΓòÉΓòÉ 2.18. split ΓòÉΓòÉΓòÉ
  1271.  
  1272. split - splits a file into pieces 
  1273.  
  1274. SYNTAX 
  1275.  
  1276.    split -Number File Prefix Prefix
  1277.  
  1278. where 
  1279.  
  1280. -Number       gives the number of lines to each piece of the output file set. 
  1281.               It defaults to 1000 lines. 
  1282.  
  1283. File          is the name of the file to be split 
  1284.  
  1285. Prefix        is the leading part of the output file name.  It defaults to 'x'. 
  1286.  
  1287. DESCRIPTION 
  1288.  
  1289. The split command reads the specified file and writes it in Number-line pieces 
  1290. (default 1000 lines) to a set of output files.  The name of the first output 
  1291. file is constructed by combining the specified prefix (x by default) with aa, 
  1292. the second by combining the prefix with ab, and so on lexicongraphically, 
  1293. through zz (a maximum of 676 files). You cannot specify a Prefix longer than 12 
  1294. characters. 
  1295.  
  1296. For OS2, we check the first output file name.  If it is illegal for the file 
  1297. system, we exit. 
  1298.  
  1299.  
  1300. ΓòÉΓòÉΓòÉ 2.19. strings ΓòÉΓòÉΓòÉ
  1301.  
  1302. strings - finds printable ascii strings in a binary file 
  1303.  
  1304. Usage 
  1305.  
  1306.           strings [-] [-a] [-o] [-number] file
  1307.  
  1308. The strings command looks for ascii strings in a binary file. A  string is any 
  1309. sequence of 4 or more printing characters ending with a newline or a null.  The 
  1310. strings command is useful for identifying random object files. 
  1311.  
  1312. Flags 
  1313.  
  1314. -a or -     Searches the entire file, not just data section, for ascii strings. 
  1315.             (This is always done in OS/2). 
  1316.  
  1317. -o          Lists each string preceded by its offset in the file (in octal). 
  1318.  
  1319. -number     Specified minimum string length rather than 4. 
  1320.  
  1321. Examples 
  1322.  
  1323.  1. Searching a file 
  1324.  
  1325.                       strings strings
  1326.     outputs 
  1327.  
  1328.    !This program cannot be run in Dos mode. 
  1329.    m~Cj 
  1330.    DOSCALLS 
  1331.    splits stdin and so on. 
  1332.  
  1333.  2. Searches for strings at least 12 characters long 
  1334.  
  1335.                       strings -12 strings
  1336.  
  1337.  3. Searches for strings at least 20 characters long and also show s offset in 
  1338.     file. 
  1339.  
  1340.                       strings -o -20 /usr/bin/strings
  1341.  
  1342.     outputs 
  1343.  
  1344.    115 !This program cannot be run in DOS mode. 
  1345.    21105 strings: Could not open input file %s 
  1346.    21164 strings: finds printable strings in object or binary file 
  1347.    21260 Usage:   strings [-] [-a] [-o] [-number] file and so on. 
  1348.  
  1349.  
  1350. ΓòÉΓòÉΓòÉ 2.20. tail ΓòÉΓòÉΓòÉ
  1351.  
  1352. Writes a file to standard output, beginning at a specified point. 
  1353.  
  1354. Usage 
  1355.  
  1356.     head [+/-Number[suffix] [-fr] [File [File ...
  1357.  
  1358. where 
  1359.  
  1360. +/-Number             indicates the starting point.  If Number is introduced by 
  1361.                       +, then the starting point is Number units from the 
  1362.                       beginning of the file.  If Number is introduced by - then 
  1363.                       the starting point is Number units from the end of the 
  1364.                       file.  Default is -10 
  1365.  
  1366. suffix                is one of l, b, c or k.  If l (the default), 'units' is 
  1367.                       lines.  If b, then 'units' is 512-byte blocks.  If k, 
  1368.                       then 'units' is 1024-byte blocks.  If c, then 'units' is 
  1369.                       characters. 
  1370.  
  1371. -f                    Specifies that tail not end after copying the input file, 
  1372.                       but rather check at 1-second intervals for more input. 
  1373.                       Thus, it can be used to monitor the growth of a file 
  1374.                       being written by another process. 
  1375.  
  1376. -r                    Displays lines from the end of the file in reverse order. 
  1377.                       The default for the -r option is print the entire file in 
  1378.                       reverse order. 
  1379.  
  1380. The tail command writes the named File (standard input by default) to standard 
  1381. output, beginning at the point you specify.  It begins reading at +Number lines 
  1382. from the beginning of File or -Number lines from the end of File.  The default 
  1383. Number is 10.  Number is counted in units of lines, block, or characters, 
  1384. according to the subflag appearing after Number.  The block size is either 512 
  1385. bytes or 1k bytes. 
  1386.  
  1387. Examples. 
  1388.  
  1389.  1. To display the last 10 lines of a file: 
  1390.  
  1391.                tail notes
  1392.  
  1393.  2. To specify how far from the end to start: 
  1394.  
  1395.                tail -20 notes
  1396.  
  1397.  3. To specify how far from the beginning to start: 
  1398.  
  1399.                tail +200c notes
  1400.     This displays notes starting with the 200th character from the beginning. 
  1401.  
  1402.  4. To follow the growth of a file: 
  1403.  
  1404.                tail -1 -f accounts
  1405.     This displays the last line of accounts.  Once every second, the tail 
  1406.     command displays any lines that have been added to the file. This continues 
  1407.     until stopped by ctl+Break. 
  1408.  
  1409.  
  1410. ΓòÉΓòÉΓòÉ 2.21. tee ΓòÉΓòÉΓòÉ
  1411.  
  1412. tee - read from stdin, write to stdout and one or more other files 
  1413.  
  1414. Usage 
  1415.  
  1416.        tee [-a][-i] File [File ...
  1417.  
  1418. The tee command reads standard input and writes the output of a program to 
  1419. standard output and copies it into the specified file or files at the same 
  1420. time. 
  1421.  
  1422. Flags 
  1423.  
  1424. -a      Adds the output to the end of File instead of writing over it. 
  1425.  
  1426. -i      Ignores interupts.  (This flag is accepted in the OS/2 version , but 
  1427.         has no effect.) 
  1428.  
  1429. The flags have to be specified separately: -i and -a but not -ia. 
  1430.  
  1431. Implementation notes:  this version handles up to 100 output files. 
  1432.  
  1433.  
  1434. ΓòÉΓòÉΓòÉ 2.22. timex ΓòÉΓòÉΓòÉ
  1435.  
  1436. timex  --  reports elapsed time for a command. 
  1437.  
  1438. Usage: 
  1439.  
  1440.              timex [-o] [-s] [-p] Command
  1441. The timex command reports, in seconds, the elapsed time for a command. In AIX 
  1442. it does lots of other neat things, too, but those neat things are not supported 
  1443. by OS/2.  For compatibility, I support the same flags, but they don't do 
  1444. anything: 
  1445.  
  1446. -o      Reports total number of blocks read or written and total characters 
  1447.         transferred by a command and its children. 
  1448.  
  1449. -p      Lists process accounting records for a command, and all its children. 
  1450.  
  1451. -s      Reports total system activity during the execution of the command. 
  1452.  
  1453.  
  1454. ΓòÉΓòÉΓòÉ 2.23. touch ΓòÉΓòÉΓòÉ
  1455.  
  1456. touch  --  updates the access and modification times of a file. 
  1457.  
  1458. Usage: 
  1459.  
  1460.         touch [-a | -m] [-c] [-f] [s] [time] Directory|File Directory|File ...
  1461.  
  1462. time is in the format  MMDDHHmmyy, where 
  1463.  
  1464. MM is the month number (required) 
  1465.  
  1466. DD is the day number  (required) 
  1467.  
  1468. HH is the hour based on a 24-hour clock (required) 
  1469.  
  1470. mm is the minute    (required if yy is specified (defaults to 0)) 
  1471.  
  1472. yy is the last 2 digits of the year (optional, defaults to current year) 
  1473.  
  1474. The touch command updates the access and modification times of each File or 
  1475. Directory names to the one specified on the command line.  If you do not 
  1476. specify Time, the touch command uses the current time.  If you specify a file 
  1477. that does not exist, the touch command creates a file with that name unless you 
  1478. request otherwise with the -c flag. 
  1479.  
  1480. The format of the data and time are specified in the config.sys. 
  1481.  
  1482. The return code from the touch command is the number of files for which the 
  1483. times could not be successfully modified (including files that did not exist 
  1484. and were not created). 
  1485.  
  1486. Flags: 
  1487.  
  1488. -a      Changes only the access time. 
  1489.  
  1490. -c      Does not create the file if it already exists 
  1491.  
  1492. -f      Attempts to force the touch in spite of read and write permissions on a 
  1493.         file. 
  1494.  
  1495. -m      Changes only the modification time. 
  1496.  
  1497. -s      Apply changes to all matching files in subtrees (OS/2 only) 
  1498.  
  1499.  
  1500. ΓòÉΓòÉΓòÉ 2.24. tr ΓòÉΓòÉΓòÉ
  1501.  
  1502. Translates characters. 
  1503.  
  1504. Syntax: 
  1505.  
  1506.      tr [-A -c -Ac -cs -s] [-B] String1 String2
  1507.         |                |
  1508.         -----one of-------
  1509.  
  1510.  or
  1511.  
  1512.      tr [-d -cd] [-B] String1
  1513.         |      |
  1514.         -one of-
  1515.  
  1516. Description: 
  1517.  
  1518. The tr command copies characters form the standard input to the standard output 
  1519. with substitution or deletion of selected characters. Input characters from 
  1520. string1 are replaced with the corresponding characters from String2.  The tr 
  1521. command cannot handle an ASCII NUL (\000) in String1 or String2; it always 
  1522. deletes NUL from the input. 
  1523.  
  1524. For compatibility with BSD, the OS/2 version has the -B flag to force BSD 
  1525. semantics on the command line.  The discussion below describes 'AIX' semantics 
  1526. and 'BSD' semantics as described in the AIX commands reference. 
  1527.  
  1528. In the AIX version abbreviations that can be used to introduce ranges of 
  1529. characters or repeated characters are as follows: 
  1530.  
  1531. [a-z]       Stands for a string of characters whose ASCII codes run from 
  1532.             characters a to character z, inclusive. 
  1533.  
  1534. [a*num]     Stands for the number of repetitions of a.  The num variable is 
  1535.             considered to be in decimal unless the first digit of num is 0; 
  1536.             then it is considered to be in octal. 
  1537.  
  1538. In the BSD version, the abbreviation that can be used to introduce ranges of 
  1539. characters is: 
  1540.  
  1541. a-z         Stands for a string of characters whose ASCII codes run from 
  1542.             character a to character z, inclusive.  Note that brackets are not 
  1543.             special characters and the hyphen is. 
  1544.  
  1545. Use the escape character \ (backslash) to remove special meaning from any 
  1546. character in a string.  Use the \ folllowed by 1, 2 or 3 octal digits for (the 
  1547. ascii code of a character. 
  1548.  
  1549. Flags: 
  1550.  
  1551. -A      Translates on a byte-by-byte basis.  The OS/2 version always translates 
  1552.         on a byte-by-byte basis. 
  1553.  
  1554. -B      Forces BSD semantics for String1 and String2. 
  1555.  
  1556. -c      Indicates that the characters (1-255 decimal) *not* in String1 are to 
  1557.         be replaced by the characters in string 2. 
  1558.  
  1559. -d      Deletes all input characters in String1. 
  1560.  
  1561. -s      If the translated characters are consecutively repeated in the output 
  1562.         stream, output only one character. 
  1563.  
  1564. Examples 
  1565.  
  1566.  1. To translate braces into parentheses: 
  1567.  
  1568.               tr '{}' '()' <textfile >outfile
  1569.  
  1570.     This translates each { to ( and each } to ).  All other characters remain 
  1571.     unchanged. 
  1572.  
  1573.  2. To translate lowercase characters to uppercase: 
  1574.  
  1575.               tr '[a-z]' '[A-Z]' <textfile >outfile
  1576.             or
  1577.               tr -B a-z A-Z <textfile >outfile
  1578.  
  1579.  3. In the AIX version, this is what happens if the strings are not the same 
  1580.     length: 
  1581.  
  1582.               tr '[0-9]' '#' <textfile >outfile
  1583.  
  1584.     This translates each 0 to a # (number sign). 
  1585.  
  1586.     Note:  if the two character strings are not the same length, then the extra 
  1587.     characters in the longer one are ignored. :enote. 
  1588.  
  1589.  4. In the BSD version, if the strings are not the same length: 
  1590.  
  1591.               tr -B 0-9 #  <textfile >outfile
  1592.     This translates each digit to a #. 
  1593.  
  1594.     Note:  If String2 is too short, it is padded to the length of String1 by 
  1595.     duplicating its last character. :enote. 
  1596.  
  1597.  5. In the AIX version, to translate each digit to a #: 
  1598.  
  1599.               tr '[0-9]' '[#*]' <textfile >outfile
  1600.  
  1601.     The * tells tr to repeat the # enough times to make the second string as 
  1602.     long as the first one. 
  1603.  
  1604.  6. To translate each string of digits to a single #: 
  1605.  
  1606.               tr -s '[0-9]' '[#*]' <textfile >outfile
  1607.            or
  1608.               tr -Bs 0-9 # <textfile >outfile
  1609.  
  1610.  7. To translate all ASCII characters that are not specified: 
  1611.  
  1612.               tr -c '[ -~]' '[A-_]?' <textfile >outfile
  1613.  
  1614.       This translates each nonprinting ASCII characters to the corresponding 
  1615.     control key letter (/001 translates to "A", /002 to "B", etc.) ASCII DEL 
  1616.     (/177), the character that follows ~ (tilde), translates to ?. 
  1617.  
  1618.     Or with the BSD version: 
  1619.  
  1620.               tr -Bc ' -~' 'A-_?' <textfile >outfile
  1621.  
  1622.  8. To create a list of the words in a file: 
  1623.  
  1624.               tr -cs '[a-z][A-Z]' '[\012*]' <textfile >outfile
  1625.           or
  1626.               tr -Bcs a-z A-z '\012' <textfile >outfile
  1627.  
  1628.     This translates each string of nonalphabetic characters to a single 
  1629.     new-line character.  The result is a list of all the words in textfile, one 
  1630.     word per line. 
  1631.  
  1632.  
  1633. ΓòÉΓòÉΓòÉ 2.25. uniq ΓòÉΓòÉΓòÉ
  1634.  
  1635. uniq -- Deletes repeated lines in a file. 
  1636.  
  1637. Usage 
  1638.  
  1639.           uniq [-c][-d][-u] [-Number [+Number] ...] InFile OutFile
  1640.                \          /
  1641.                one of these
  1642.  
  1643. The uniq command reads standard input or the InFile parameter, compares 
  1644. adjacent lines, removes the second and succeeding occurances of a line, and 
  1645. writes to standard output or the file specified by the OutFile parameter.  The 
  1646. InFile and OutFile parameters should always be different files.  Repeated lines 
  1647. must be on consecutive lines to be found.  You can arrange them with the sort 
  1648. command before processing. 
  1649.  
  1650. FLAGS 
  1651.  
  1652. -c          Precedes each output line with a count of the number of times each 
  1653.             line appears in the file.  This flag supersedes -d and -u. 
  1654.  
  1655. -d          Displays only the repeated lines. 
  1656.  
  1657. -u          Displays only the unrepeated lines. 
  1658.  
  1659. -Number     Skips over the first Number fields.  A field is a string of 
  1660.             non-space, non-tab characters separated by tabs and/or spaces from 
  1661.             adjacent data on the same line. 
  1662.  
  1663. +Number     Skips over the first Number characters.  Fields specified by the 
  1664.             Number parameter are skipped before characters. 
  1665.  
  1666.  
  1667. ΓòÉΓòÉΓòÉ 2.26. uudecode ΓòÉΓòÉΓòÉ
  1668.  
  1669. Decodes a file that has been encoded using the uuencode program (q.v.). 
  1670.  
  1671. Usage: 
  1672.  
  1673.         uudecode filename
  1674. where 
  1675.  
  1676. filename      is a valid path and name of the file containing the encoding.  If 
  1677.               filename is not specified, input is taken from stdin. 
  1678.  
  1679. uudecode reads the input file until it finds a valid 'begin' line. That line 
  1680. has the format 
  1681.  
  1682.           begin rrr file-name
  1683.  
  1684. where 
  1685.  
  1686. begin         is a constant, beginning in line 1. 
  1687.  
  1688. rrr           is 3 octal permissions, usually 666.  These are ignored in the 
  1689.               OS/2 version of uudecode. 
  1690.  
  1691. file-name     is the name of the unencoded file to be created. 
  1692.  
  1693. uudecode creates file-name, decodes and writes out the file.  It stops when it 
  1694. gets to a null line (see uuencode). 
  1695.  
  1696. EXAMPLE 
  1697.  
  1698.    uudecode mailfile
  1699.  
  1700. The file mailfile is read until a valid begin line is found, subsequent lines 
  1701. are treated as uuencoded data, until a null line is found. 
  1702.  
  1703.  
  1704. ΓòÉΓòÉΓòÉ 2.27. uuencode ΓòÉΓòÉΓòÉ
  1705.  
  1706. Encodes a file. 
  1707.  
  1708. Syntax 
  1709.  
  1710.        uuencode [SourceFile] RemoteDestination
  1711.  
  1712. where 
  1713.  
  1714. SourceFile               is the name of the data file to be encoded. If it is 
  1715.                          not specified, input is taken from stdin. 
  1716.  
  1717. RemoteDestination        is the name under which the uudecode program (q.v.) 
  1718.                          will decode file. 
  1719.  
  1720. uuencode creates a file containing a 'begin' line (described under uudecode 
  1721. above), containing the permissions and the name with which the encoded data is 
  1722. to be created on decoding.  Then it encodes each byte of the input file.  The 
  1723. encoding algorithm outputs characters in the range 32 to 96 (decimal).  These 
  1724. characters normally survive mailers and other programs that sometimes transform 
  1725. characters. 
  1726.  
  1727. EXAMPLES 
  1728.  
  1729.    uuencode my.fil out.nam
  1730.  
  1731. The file my.fil is read and encoded.  The string 'out.nam' is put in the 
  1732. 'begin' record, and when uudecode decodes the file, it will create a file named 
  1733. out.nam. 
  1734.  
  1735.    uuencode bin.fil
  1736.  
  1737. Stdin is read and encoded.  On decoding, the file will be created as bin.fil. 
  1738.  
  1739.  
  1740. ΓòÉΓòÉΓòÉ 2.28. wc ΓòÉΓòÉΓòÉ
  1741.  
  1742. wc  --  counts lines, words and characters 
  1743.  
  1744. The wc command counts the number of lines, words, or characters in File or in 
  1745. the standard input if you do not specify any Files.  The command writes The 
  1746. results to standard output and keeps a total count for all named files. A word 
  1747. is defined as a string of characters delimted by spaces, tabs, or new-line 
  1748. characters.  By default, the wc command counts lines, words, and characters (as 
  1749. bytes). 
  1750.  
  1751. Usage: 
  1752.  
  1753.      wc [-c]||[-cl]||[-cw]||[-cwl]||[-l]||[-lw]||[-w]||[-k] {File ...
  1754.  
  1755. Flags: 
  1756.  
  1757. -c      Count bytes. 
  1758.  
  1759. -l      Count lines. 
  1760.  
  1761. -w      Count words. 
  1762.  
  1763. -k      Count actual characters, not bytes.  Specifying the -k flag is 
  1764.         equivalent to specifying -kclw. 
  1765.  
  1766. -s      (OS2 only). Specifies that Files matching the pattern are searched for 
  1767.         in subdirectories of the specified directory. 
  1768.  
  1769. The order of the -c, -w and -l flags is significant.  It determines the order 
  1770. of the columns.  Default is "lines" "words" "characters". 
  1771.  
  1772.  
  1773. ΓòÉΓòÉΓòÉ 2.29. which ΓòÉΓòÉΓòÉ
  1774.  
  1775. Finds the path of the program or programs named on the command line, showing 
  1776. *which* copy would have been executed if the program name had been given on a 
  1777. command line. 
  1778.  
  1779. DOES NOT DO ALIASes.  There is no standard OS/2 way of doing aliases. 
  1780.  
  1781. It does expand wild cards. 
  1782.  
  1783.  All command names are searched for if an extension is not specified. First exe 
  1784. then cmd. 
  1785.  
  1786. Instead of using the path in .cshrc, as the AIX version does, this version uses 
  1787. the environment variable PATH. 
  1788.  
  1789. Syntax 
  1790.  
  1791.             which file [file [file...
  1792.