|
| 1 | + |
| 2 | + >>>> V E R S I O N 2 <<<< |
| 3 | + |
| 4 | +INTRODUCTION: |
| 5 | +Rh was written by Ken Stauffer to make the |
| 6 | +job of finding files easier by allowing the |
| 7 | +user to enter real C expressions. This notation is |
| 8 | +much easier to master than the notation used by the |
| 9 | +find(1) command, because most Unix users |
| 10 | +already know C. In addition to being easier to use |
| 11 | +than find(1), rh expressions can be used to select |
| 12 | +the desired files. |
| 13 | + |
| 14 | +CREDITS: |
| 15 | + Guy Harris |
| 16 | + - Corrected many portability problems. |
| 17 | + David MacKenzie |
| 18 | + - Manual revisions. Added getopt and regular expressions. |
| 19 | + Norm Hutchinson |
| 20 | + - Fixed ungetit(). |
| 21 | + |
| 22 | +COMPILING: |
| 23 | +To make rh work on your system, you will need to change |
| 24 | +some -D options in the Makefile. Define ONE of the |
| 25 | +following in the definition of CFLAGS: |
| 26 | + |
| 27 | + -DBSD - This would be used for most BSD systems. |
| 28 | + -DSYSV - System V systems. |
| 29 | + |
| 30 | +Also define one of the following: |
| 31 | + |
| 32 | + -DSUNOS_4 - SunOS 4.x (subclass of BSD) |
| 33 | + -DSYSVR3 - System V Release 3.x (subclass of SYSV) |
| 34 | + |
| 35 | +In addition to the C source there is also a file called rh.man. |
| 36 | +This is a nroff file and can be created by a command like: |
| 37 | + |
| 38 | + nroff -man rh.man > rh.cat |
| 39 | + |
| 40 | +The resultant file (rh.cat) is sutable for general viewing. |
| 41 | + |
| 42 | +RUNNING: |
| 43 | +There is a file called rhrc. This file contains some |
| 44 | +examples of things that can go into a $HOME/.rhrc file. |
| 45 | +If the file "rhrc" is moved to your home directory and renamed |
| 46 | +to ".rhrc" then a command like: |
| 47 | + |
| 48 | + % rh -l -e writable |
| 49 | + |
| 50 | +Will do a search of the current directory, executing the function |
| 51 | +"writable()", which finds files that other people have write access to. |
| 52 | + |
| 53 | +Once rh is made, you can do what you want with it. A good test to |
| 54 | +see if it is working is to do: |
| 55 | + |
| 56 | + % rh -vle 1 / |
| 57 | + |
| 58 | +This will find all files that makes the constant expression '1' true. |
| 59 | +So if your root, all the files on the system will be found. |
| 60 | + |
| 61 | +PORTABILITY: |
| 62 | +The file rhdir.c contains code that does directory reading. |
| 63 | +This is most likely where problems will occur. These differences |
| 64 | +have been taken into account for most versions of unix |
| 65 | +and will hopefully work on your system. |
| 66 | +So far 'rh' works on: |
| 67 | + SCO XENIX, BSD 4.3, and SUNOS 4.0 |
| 68 | + |
| 69 | +GRAMMER: |
| 70 | +The following is the grammer that describes the input language |
| 71 | +recognized by rh: |
| 72 | + |
| 73 | + <program> ==> <function list> <expression> EOF |
| 74 | + | <function list> <expression> ; |
| 75 | + |
| 76 | + <function list> ==> <function> |
| 77 | + | <function list> <function> |
| 78 | + | /* empty */ |
| 79 | + |
| 80 | + <function> ==> <function heading> { RETURN <expression> ; } |
| 81 | + |
| 82 | + <function heading> ==> IDENTIFIER |
| 83 | + | IDENTIFIER ( ) |
| 84 | + | IDENTIFIER ( <idlist> ) |
| 85 | + |
| 86 | + <idlist> ==> IDENTIFIER <idtail> |
| 87 | + <idtail> ==> , <idlist> |
| 88 | + | /* empty */ |
| 89 | + |
| 90 | + <expression> ==> <expr0> ? <expression> : <expression> |
| 91 | + |
| 92 | + <expr0> ==> <expr1> || <expr1> |
| 93 | + |
| 94 | + <expr1> ==> <expr2> && <expr2> |
| 95 | + |
| 96 | + <expr2> ==> <expr3> | <expr3> |
| 97 | + |
| 98 | + <expr3> ==> <expr4> ^ <expr4> |
| 99 | + |
| 100 | + <expr4> ==> <expr5> & <expr5> |
| 101 | + |
| 102 | + <expr5> ==> <expr6> == <expr6> |
| 103 | + | <expr6> != <expr6> |
| 104 | + |
| 105 | + <expr6> ==> <expr7> < <expr7> |
| 106 | + | <expr7> > <expr7> |
| 107 | + | <expr7> <= <expr7> |
| 108 | + | <expr7> >= <expr7> |
| 109 | + |
| 110 | + <expr7> ==> <expr8> >> <expr8> |
| 111 | + | <expr8> << <expr8> |
| 112 | + |
| 113 | + <expr8> ==> <expr9> + <expr9> |
| 114 | + | <expr9> - <expr9> |
| 115 | + |
| 116 | + <expr9> ==> <expr10> * <expr10> |
| 117 | + | <expr10> / <expr10> |
| 118 | + | <expr10> % <expr10> |
| 119 | + |
| 120 | + <expr10> ==> ~ <expr10> |
| 121 | + | ! <expr10> |
| 122 | + | - <expr10> |
| 123 | + | <factor> |
| 124 | + |
| 125 | + <factor> ==> ( <expression> ) |
| 126 | + | NUMBER |
| 127 | + | <function call> |
| 128 | + | IDENTIFIER |
| 129 | + | [ <date spec> ] |
| 130 | + | STRING |
| 131 | + |
| 132 | + <function call> ==> IDENTIFIER |
| 133 | + | IDENTIFIER ( <exprlist> ) |
| 134 | + | IDENTIFIER ( ) |
| 135 | + |
| 136 | + <exprlist> ==> <expression> <exprtail> |
| 137 | + <exprtail> ==> , <exprlist> |
| 138 | + | /* empty */ |
| 139 | + |
| 140 | + <datespec> ==> NUMBER / NUMBER / NUMBER |
| 141 | + |
| 142 | +-------------------------------------------------------------------- |
| 143 | +Ken Stauffer. |
| 144 | +root@sixk |
0 commit comments