On Wed, Mar 01, 2017 at 08:48:20AM -0800, L A Walsh wrote: > Chet Ramey wrote: > >Compatibiity options are all mutually exclusive, last one wins. > --- > But the way it is now -- if someone is using a compat option > for an earlier version, and now needs another compat option > for some other incompat, then they have a problem.
This is not what the options are for. This is not how you write a shell script. The purpose of the compat options is that you, as the script writer, right now, can write and test and deploy your script on a specific version of bash. Once you know that your script works on this version of bash (say, 4.4) you can set the compat option to say "Dear future version of bash, please treat this script the same way bash 4.4 did." Now you know that your script will continue to work even if bash 5.3 changes some crazy thing according to a POSIX-2023 ruling that you can't possibly predict today. The purpose of the compat options is NOT to let you cherry-pick old behaviors. "In this function I'd like the bash 2.05b behavior, and in this function, I'd like the bash 3.1 behavior, and...." No. Bad programmer.