Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > gnu.bash.bug > #11858
| From | Chet Ramey <chet.ramey@case.edu> |
|---|---|
| Newsgroups | gnu.bash.bug |
| Subject | Re: BASH_ARG{C,V} set when sourcing, even without extdebug |
| Date | 2015-11-10 09:31 -0500 |
| Message-ID | <mailman.2062.1447165897.7904.bug-bash@gnu.org> (permalink) |
| References | <8daf3fe2-18e2-48d5-9c1f-fb9ee5c1b4c6@googlegroups.com> |
On 11/10/15 1:59 AM, Grisha Levit wrote: > It looks like the source builtin pushes its own argc and argv onto the arrays but only if it is called with no other arguments. Yes, bash has always done this as a convenience. This is a way to get the name of the sourced file in the common case. When given additional arguments, bash sets BASH_ARGC and BASH_ARGV only when debugging mode is in effect. -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet Ramey, ITS, CWRU chet@case.edu http://cnswww.cns.cwru.edu/~chet/
Back to gnu.bash.bug | Previous | Next — Previous in thread | Find similar | Unroll thread
BASH_ARG{C,V} set when sourcing, even without extdebug Grisha Levit <grishalevit@gmail.com> - 2015-11-09 22:59 -0800
Re: BASH_ARG{C,V} set when sourcing, even without extdebug Chet Ramey <chet.ramey@case.edu> - 2015-11-10 09:31 -0500
csiph-web