On 1/5/25 8:09 AM, Robert Elz wrote:
Date: Sun, 5 Jan 2025 11:17:05 +0000 From: Tobi Laskowski <tobil...@outlook.com> Message-ID: <lo6p265mb6347c150fce01eac8d194781b1...@lo6p265mb6347.gbrp265.prod.outlook.com>| It is not possible to have a naive SHELLOPTS=myopt configured outside | the shell without all future options being exported implicitly. I have never used SHELLOPTS, and have never tested this, but: Does "unset SHELLOPTS" not work?
No. It's managed by the shell and readonly. You can remove the export attribute, though.
It would probably be useful to have that as one of the initial commands in every script, perhaps after saving its previous value if that is needed, and then if it is wanted for a sub-shell or exec'd script set it again, as in: SHELLOPTS=whatever script
You can't do this; you have to change the options using `set -o'. SHELLOPTS reflects the current state of the options controllable by `set -o'. -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet Ramey, UTech, CWRU c...@case.edu http://tiswww.cwru.edu/~chet/
OpenPGP_signature.asc
Description: OpenPGP digital signature