bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bash --pretty-print and pattern


From: Chet Ramey
Subject: Re: bash --pretty-print and pattern
Date: Thu, 20 Feb 2025 09:37:49 -0500
User-agent: Mozilla Thunderbird

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    chet@case.edu    http://tiswww.cwru.edu/~chet/

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]