[grepmail-devel] -o and -O output flags
Brought to you by:
coppit
From: David C. <da...@co...> - 2000-05-03 19:38:33
|
Greetings grepmail developers! Terry Brown described this nasty problem: $ grepmail -R pattern mail/ > mail/output In this case grepmail could possibly search the output file, appending results to itself! One way to get around this problem is: $ grepmail -R pattern mail/ > /tmp/output $ mv /tmp/output mail/ but that's annoying. What about explicitly setting the output file with -o? $ grepmail -R -o /tmp/output pattern mail/ Here, -o has the following semantics: -o Specify the output file, overwriting any existing file. (If this file appears on the input list of files, it is ignored.) -O Specify the output file, appending to any existing file. (If this file appears on the input list of files, it is ignored.) The downsides are: 1) it's an obscure situation that doesn't seem to justify a new flag (or two). Can anyone think of another reason for -o? 2) -o and -O seem to be shouldering work that is better done by the shell. (appending vs. overwriting, for example) 3) Fighting feature-itis is good. I kinda feel like this is a problem we shouldn't have to deal with, unless introducing -o solves other problems. Any thoughts? David _________________________________________________________________________ David Coppit - Graduate Student da...@co... The University of Virginia http://coppit.org/ "Yes," said Piglet, "Rabbit has Brain." There was a long silence. "I suppose," said Pooh, "that that's why he never understands anything." |