* _N_GNU_nonoption_argv_flags_
@ 2011-09-27 18:42 Stephane Chazelas
2011-09-28 2:13 ` _N_GNU_nonoption_argv_flags_ Bart Schaefer
0 siblings, 1 reply; 3+ messages in thread
From: Stephane Chazelas @ 2011-09-27 18:42 UTC (permalink / raw)
To: zsh-workers
Hiya,
I've just come across this paragraph in the ENVIRONMENT
VARIABLES section of the GNU grep man page:
_N_GNU_nonoption_argv_flags_
(Here N is grep's numeric process ID.) If the ith
character of this environment variable's value is
1, do not consider the ith operand of grep to be
an option, even if it appears to be one. A
shell can put this variable in the environment for
each command it runs, specifying which operands
are the results of file name wildcard expansion
and therefore should not be treated as options.
This behavior is available only with the GNU C
library, and only when POSIXLY_CORRECT is not set.
It's news to me. Is there any plan for zsh to implement that?
--
Stephane
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: _N_GNU_nonoption_argv_flags_
2011-09-27 18:42 _N_GNU_nonoption_argv_flags_ Stephane Chazelas
@ 2011-09-28 2:13 ` Bart Schaefer
2011-09-28 9:29 ` _N_GNU_nonoption_argv_flags_ Stephane CHAZELAS
0 siblings, 1 reply; 3+ messages in thread
From: Bart Schaefer @ 2011-09-28 2:13 UTC (permalink / raw)
To: zsh-workers
On Sep 27, 7:42pm, Stephane Chazelas wrote:
}
} _N_GNU_nonoption_argv_flags_
} (Here N is grep's numeric process ID.) If the ith
} character of this environment variable's value is
} 1, do not consider the ith operand of grep to be
} an option, even if it appears to be one.
}
} It's news to me. Is there any plan for zsh to implement that?
I would have to guess there are no plans, because I've never heard
it mentioned (either the variable itself, or of implementing it).
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: _N_GNU_nonoption_argv_flags_
2011-09-28 2:13 ` _N_GNU_nonoption_argv_flags_ Bart Schaefer
@ 2011-09-28 9:29 ` Stephane CHAZELAS
0 siblings, 0 replies; 3+ messages in thread
From: Stephane CHAZELAS @ 2011-09-28 9:29 UTC (permalink / raw)
To: zsh-workers
2011-09-27, 19:13(-07), Bart Schaefer:
> On Sep 27, 7:42pm, Stephane Chazelas wrote:
> }
> } _N_GNU_nonoption_argv_flags_
> } (Here N is grep's numeric process ID.) If the ith
> } character of this environment variable's value is
> } 1, do not consider the ith operand of grep to be
> } an option, even if it appears to be one.
> }
> } It's news to me. Is there any plan for zsh to implement that?
>
> I would have to guess there are no plans, because I've never heard
> it mentioned (either the variable itself, or of implementing it).
I've just seen this in GNU bash source (GPL code):
#if 0 /* UNUSED -- it caused too many problems */
void
put_gnu_argv_flags_into_env (pid, flags_string)
intmax_t pid;
char *flags_string;
{
char *dummy, *pbuf;
int l, fl;
pbuf = itos (pid);
l = strlen (pbuf);
fl = strlen (flags_string);
dummy = (char *)xmalloc (l + fl + 30);
dummy[0] = '_';
strcpy (dummy + 1, pbuf);
strcpy (dummy + 1 + l, "_GNU_nonoption_argv_flags_");
dummy[l + 27] = '=';
strcpy (dummy + l + 28, flags_string);
free (pbuf);
export_env = add_or_supercede_exported_var (dummy, 0);
}
#endif
If Chet reads us, what were the "too many problems" caused.
Where does that come from. I expect it to be an extension of GNU
getopt, but that is not mentionned in the documentation, a grep
on libc.so doesn't return anything and actually it doesn't seem
to even work here:
sh -c 'export _$$_GNU_nonoption_argv_flags_=1111; exec grep -t a'
grep: invalid option -- 't'
--
Stephane
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-09-28 10:05 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-27 18:42 _N_GNU_nonoption_argv_flags_ Stephane Chazelas
2011-09-28 2:13 ` _N_GNU_nonoption_argv_flags_ Bart Schaefer
2011-09-28 9:29 ` _N_GNU_nonoption_argv_flags_ Stephane CHAZELAS
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).