Re: :? within a function

Chet Ramey <[email protected]> Tue, 19 May 2026 10:26:59 -0400
Newsgroups gmane.comp.shells.bash.help,gmane.comp.shells.bash.bugs
Message-ID <[email protected]>
On 5/18/26 5:36 PM, Zachary Santer wrote:

> If you're changing that language in the manual to "the command in
> which the error occurred," that does seem like a reasonable catch-all.

That's closer to the POSIX language.

> I just don't really think of function calls as commands.

They are. If you're more comfortable with it, think of the function
body as the compound command being executed.

>> Since it's sourcing the file and reading commands from it one at a
>> time, it returns to the current top level and reads the next command
>> from the sourced file.
> 
> An argument could be made that the command line with a prompt is the
> true "top level" here. That's where you return to after you're done
> sourcing the file, after all.

See my reply to kre.

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
		 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    [email protected]    http://tiswww.cwru.edu/~chet/