Path: csiph.com!xmission!news.snarked.org!news.linkpendium.com!news.linkpendium.com!panix!usenet.stanford.edu!not-for-mail From: Eli Schwartz Newsgroups: gnu.bash.bug Subject: Re: An xtrace variant Date: Sun, 28 Jun 2020 15:51:37 -0400 Lines: 76 Approved: bug-bash@gnu.org Message-ID: References: <87h7uv0zi8.fsf@hobgoblin.ariadne.com> NNTP-Posting-Host: lists.gnu.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="Np6LyIS0rxuoJQlzmaEETqfiqzw03GnLQ" X-Trace: usenet.stanford.edu 1593373917 2911 209.51.188.17 (28 Jun 2020 19:51:57 GMT) X-Complaints-To: action@cs.stanford.edu To: bug-bash@gnu.org Envelope-to: bug-bash@gnu.org X-Spam-BL-Results: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=archlinux.org; s=orion; t=1593373903; bh=b1Umwat7iZRPRNejoLCH8N87W5JFwNZqULijFaSpjco=; h=Subject:To:References:From:Date:In-Reply-To; b=UvBLiPrdP46QVeegdq1gWrzWePF4VtuKBnuCPPDhBDz2P6rYnT5v6/d2TrBe71gVq GplC+qI7VTqN6dQHjxGpWNI3FgGyMVQ/AIiBgyjNswkjXmARhryu6eFk4QqcpkuX1G v/y0wh9yXp/qr3TJTDNMRT03ijdvtW4Em604xN1mwYjpcc8tCxs9Zj4Mn8+/TQtEPi X62ZKdZcHv2wIj4rI6iDBMnD1blT2L4zfoUhY2ViQPIiiXZTuWPbTxxaYSIGdNatuI oA8mLPTKLfSI0ejpd++wGIgrxDWcFDqNZRR+zrPexsaTuLeY4EjDkRT0bVK3mUXqFf O5EaYWbmWK1qz8aQ9tfOAjLgWhzPSl0wt6JwggJRy+JDhLokbn4VVxB3X9I6eNeMoT 6RNcWCOwxCck/XpJmOr0I2SgsrESjsRUBXSjqc3dak9OwSBzBBYSsjrwgYRWCPsL6K 9KMyRis/2NtJbCffH7nj59hcgiLVEke1X9ZJfXU7dHGj+F+EP8E883zywNlkXjMckZ WgytA5IPfNfP2XiXAE1uJ6FbrVaF8ZH/fDK/y3DUq1ivPtSGAEptl4iHDsJyZlPMPT udoUCxs9wUEXSmQOhk4AGl29tLlkjYLhqwDCG8xBz0Hy6+zLeC1BA5kDzUm6R/T7dK ZEf3oc/jKZQ5y40z+rwoDhAU= X-Clacks-Overhead: GNU Terry Pratchett User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 In-Reply-To: <87h7uv0zi8.fsf@hobgoblin.ariadne.com> Received-SPF: pass client-ip=88.198.91.70; envelope-from=eschwartz@archlinux.org; helo=orion.archlinux.org X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/28 15:51:48 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -53 X-Spam_score: -5.4 X-Spam_bar: ----- X-Spam_report: (-5.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H4=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: bug-bash@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Bug reports for the GNU Bourne Again SHell List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: X-Mailman-Original-References: <87h7uv0zi8.fsf@hobgoblin.ariadne.com> Xref: csiph.com gnu.bash.bug:16473 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --Np6LyIS0rxuoJQlzmaEETqfiqzw03GnLQ Content-Type: multipart/mixed; boundary="WBZDLxOS4E6FvwqNuczvw2nwgAtpaLtES" --WBZDLxOS4E6FvwqNuczvw2nwgAtpaLtES Content-Type: text/plain; charset=utf-8 Content-Language: en-US-large Content-Transfer-Encoding: quoted-printable On 6/28/20 3:19 PM, Dale R. Worley wrote: > When debugging a shell script, a useful command is: >=20 > bash -x script-name >=20 > The deficiency of this is that "-x" causes all simple commands in your > startup files to be echoed as they are executed, and often this output > is a lot longer than the output from the commands in the script. >=20 > For a long time, I've wanted a variant of -x that only echoed the simpl= e > commands after bash is done executing the startup files. I finally did= > a test implementation, naming a new switch "-X". If it is set at the > end of the execution of the startup files, then bash sets "-x", which > causes subsequent simple commands to be echoed. Why not just run bash -x script-name without the bash -l option and without $BASH_ENV set? The first is implicitly true based on your stated command line. The second doesn't seem like a high bar to set, and it's not exactly default behavior... if you really do need $BASH_ENV can't you do the set -x at the end of that file? --=20 Eli Schwartz Arch Linux Bug Wrangler and Trusted User --WBZDLxOS4E6FvwqNuczvw2nwgAtpaLtES-- --Np6LyIS0rxuoJQlzmaEETqfiqzw03GnLQ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEvSewel70XCra9w4EhIGKaBmvSpsFAl749MkACgkQhIGKaBmv SpuDpA//SuyR1lB1uzxZZjt7kKJRFbDQGkqWf2v0t1fxeg9+Pe9/R/x8G1wdHmNm YsQ1l98c5ymRp9iJYAwyFMoVcPvthA35ioeLOnwcxAfyQt1CevYRbG6w8S8ZMnJb sAZn4enBppkZxH80snxGTUW6EPq7uJc+hPd76762kBWEY7W5+2QE4PAgnYUfTYA3 SfaM16uK21SE8v4C0CcmLquAIz/kcJcaEYTocXmXbBWk4N8m5pRilnlltm2PL4/3 mgZrYyAx7JIcap6G5+4xBNg5Bc0nQC65BhTVIkxgHDwdUcKFUOA6cT1U+CbnvQWF bgeFX3ykGDkuGGosz+PWtAE8DTNJtp94nUETcZ6E3Y2qqYx4LCoXA5o/IjjjGP/5 ZrSfU7/zDLHJkXEULzXL25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