Fossil SCM

Listed the actual differences between fossil grep options and those defined by POSIX in www/grep.md.

wyoung 2018-10-03 21:25 trunk
Commit d5499091eed2757ccf8e93e502236517ba9605fbca5625e14d5231be3add77ed
1 file changed +31 -6
+31 -6
--- www/grep.md
+++ www/grep.md
@@ -16,17 +16,42 @@
1616
|--------|-------------------------------------------------------------
1717
| `-i` | ignore case in matches
1818
| `-l` | list a checkin ID prefix for matching historical versions of the file
1919
| `-v` | print each checkin ID considered, regardless of whether it matches
2020
21
-No equivalent of other POSIX `grep` options currently exist.
21
+That leaves many divergences at the option level from POSIX `grep`:
22
+
23
+* There is no built-in way to get a count of matches, as with `grep
24
+ -c`.
25
+
26
+* You cannot give more than one pattern, as with `grep -e` or `grep
27
+ -f`.
28
+
29
+* There is no equivalent of `grep -F` to do literal fixed-string
30
+ matches only.
31
+
32
+* `fossil grep -l` does not do precisely the same thing as POSIX
33
+ `grep -l`: it lists checkin ID prefixes, not file names.
34
+
35
+* Fossil always gives the line number in its output, which is to say
36
+ that it acts like `grep -n`. There is no way to disable the line
37
+ number in `fossil grep` output.
38
+
39
+* There is no way to suppress all output, returning only a status code
40
+ to indicate whether the pattern matched, as with `grep -q`.
41
+
42
+* There is no way to suppress error output, as with `grep -s`.
43
+
44
+* Fossil `grep` accepts only a single input file name. You cannot give
45
+ it a list of file names, and you cannot give it a directory name for
46
+ Fossil to expand to the set of all files under that directory. This
47
+ means Fossil `grep` has no equivalent of the common POSIX `grep -R`
48
+ extension. (And if it did, it would probably have a different option
49
+ letter, since `-R` in Fossil has a different meaning, by
50
+ convention.)
2251
23
-Note in partcicular that there is no equivalent of `grep -R`, either
24
-implicitly or explicitly. Fossil `grep` currently accepts only a single
25
-input file name. You cannot give it a list of file names, and you cannot
26
-give it a directory name for Fossil to expand to the set of all files
27
-under that directory.
52
+* You cannot invert the match, as with `grep -v`.
2853
2954
Patches to remove those limitations will be thoughtfully considered.
3055
3156
3257
## Regular Expression Dialect
3358
--- www/grep.md
+++ www/grep.md
@@ -16,17 +16,42 @@
16 |--------|-------------------------------------------------------------
17 | `-i` | ignore case in matches
18 | `-l` | list a checkin ID prefix for matching historical versions of the file
19 | `-v` | print each checkin ID considered, regardless of whether it matches
20
21 No equivalent of other POSIX `grep` options currently exist.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
22
23 Note in partcicular that there is no equivalent of `grep -R`, either
24 implicitly or explicitly. Fossil `grep` currently accepts only a single
25 input file name. You cannot give it a list of file names, and you cannot
26 give it a directory name for Fossil to expand to the set of all files
27 under that directory.
28
29 Patches to remove those limitations will be thoughtfully considered.
30
31
32 ## Regular Expression Dialect
33
--- www/grep.md
+++ www/grep.md
@@ -16,17 +16,42 @@
16 |--------|-------------------------------------------------------------
17 | `-i` | ignore case in matches
18 | `-l` | list a checkin ID prefix for matching historical versions of the file
19 | `-v` | print each checkin ID considered, regardless of whether it matches
20
21 That leaves many divergences at the option level from POSIX `grep`:
22
23 * There is no built-in way to get a count of matches, as with `grep
24 -c`.
25
26 * You cannot give more than one pattern, as with `grep -e` or `grep
27 -f`.
28
29 * There is no equivalent of `grep -F` to do literal fixed-string
30 matches only.
31
32 * `fossil grep -l` does not do precisely the same thing as POSIX
33 `grep -l`: it lists checkin ID prefixes, not file names.
34
35 * Fossil always gives the line number in its output, which is to say
36 that it acts like `grep -n`. There is no way to disable the line
37 number in `fossil grep` output.
38
39 * There is no way to suppress all output, returning only a status code
40 to indicate whether the pattern matched, as with `grep -q`.
41
42 * There is no way to suppress error output, as with `grep -s`.
43
44 * Fossil `grep` accepts only a single input file name. You cannot give
45 it a list of file names, and you cannot give it a directory name for
46 Fossil to expand to the set of all files under that directory. This
47 means Fossil `grep` has no equivalent of the common POSIX `grep -R`
48 extension. (And if it did, it would probably have a different option
49 letter, since `-R` in Fossil has a different meaning, by
50 convention.)
51
52 * You cannot invert the match, as with `grep -v`.
 
 
 
 
53
54 Patches to remove those limitations will be thoughtfully considered.
55
56
57 ## Regular Expression Dialect
58

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button