in reply to Re^10: magic-diamond <> behavior -- WHAT?! (coy)
in thread magic-diamond <> behavior -- WHAT?!
All of which is completely in keeping with my assertion that this was an accident of implementation. I see nothing here that says "intentional" over "accidental".
emulate the behavior of sed and awk
...
or from each file listed on the command line
...
The ARGV array is then processed as a list of filenames.
...
put the current filename into variable ARGV
...
as you leave the first filename at the beginning of the array
I'm pretty sure running sed or awk against 'rm -rf .. |' doesn't blow away your directory.
Thanks for the proof that for over 2 decades the intent of the feature was repeatedly documented to be non-magical, despite the implementation, the copy of the implementation in the documentation, and the documentation completely overlooking the "magical" problem.
The documentation talks a lot about the intent. In all of that talking, the intent is always described as "filename"s and there was no mention of an intent at "magical" behavior.
The lazy implementation uses "-" to get STDIN and the note that this thwarts the "obvious" addition of "<" to get safer behavior may be part of why the implementation didn't include such.
- tye
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^12: magic-diamond <> behavior -- WHAT?! (lack of reading comprehension)
by Fletch (Bishop) on Nov 01, 2008 at 03:21 UTC |