Hi Ed,
I guess you have to down grade the trick from "well documented" to
merely "well known". :-) It's part of the grand Oral Tradition of Unix,
along with the similar trick of using ./-x to cause a file that
starts with a minus sign to not be treated as an option.
I will go ahead and add a sentence or two at an appropriate spot in
the manual.
Thanks for the suggestion,
Arnold
Ed Morton <address@hidden> wrote:
Documentation enhancement request:
Someone recently asked me how to pass a file name containing an `=` sign
(e.g. a file named `count=1`) as the input file name argument to awk.
They had tried this which of course fails:
awk 'script' count=1
and I glibly told them it was well documented that you should do it as:
awk 'script' ./count=1
Then I tried to find the documentation to provide a reference for that
and I couldn't.
The gawk manual in
https://www.gnu.org/software/gawk/manual/gawk.html#Other-Arguments tells
us that `count=1` on it's own would be taken as a variable assignment
and then
https://www.gnu.org/software/gawk/manual/gawk.html#Assignment-Options
confirms that fact but I couldn't find anywhere that tells us how to
solve the issue by just sticking `./` in front of the file name.
Maybe we could get that stated somewhere in the manual?
Ed.