Re: :? within a function
Chet Ramey <[email protected]> Mon, 18 May 2026 15:48:30 -0400
| Newsgroups | gmane.comp.shells.bash.help,gmane.comp.shells.bash.bugs |
|---|---|
| Organization | ITS, Case Western Reserve University |
| Message-ID | <[email protected]> |
On 5/17/26 9:47 PM, Zachary Santer wrote: > Display Error if Null or Unset. If parameter is unset or null, or > unset if the colon is not present, the shell writes the expansion of > word (or a message to that effect if word is not present) to the > standard error and, if it is not interactive, exits with a non-zero > status. An interactive shell does not exit, but does not execute the > command associated with the expansion and any containing function > calls exit with a nonzero status. Otherwise, the value of parameter is > substituted. Bash aborts "the command in which the error occurred," which is the function call, and returns to the top level to read the next command. 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. Chet -- ``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/
OpenPGP_signature.asc
(application/pgp-signature, 203 B)
-----BEGIN PGP SIGNATURE----- wmMEABEIACMWIQR8ATX7CIqvbGbGULm7WGnwZOp0qwUCagttDgUDAAAAAAAKCRC7WGnwZOp0qwAU AJwICtyvOPdkbGDItnfM9F26EIjpKwCcDRGtueyUaqDug/OGXux6PqMwTmA= =CYtf -----END PGP SIGNATURE-----