On 2/20/25 7:25 AM, Koichi Murase wrote:

However, even if you make sure that "extglob" is enabled when the
script file is parsed in real situations as described above,
"--pretty-print" still doesn't work because it doesn't execute the
file at all. To parse and print a file with the actual set of shell
options that the file is supposed to be parsed, you need to set them
in the command-line options of Bash. In the present case, you can run
it in the following way:

$ bash --pretty-print -O extglob test.sh

You can use BASH_ENV for this. The primary reason that pretty-printing mode
doesn't suppress execution until after any startup files are read is to
allow a custom startup file to set the shell options you want for printing.

--
``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/

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature

Reply via email to