From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 8663 invoked from network); 3 Sep 2021 17:15:25 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 3 Sep 2021 17:15:25 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1630689325; b=skvroUhI5Xjf+wsKBUK5dfszf2xNOYRcJWC1r8kw/YreTpWEuXM3pKjOLtxJCjAD0L2mtsE9s4 GCbxOguRkxg/7BG0maycTXxTE5mj/1iso2ZmQX0xK35+0r5dGpxOwkDACH/us//iBC8borqWuk 5YBnx+H7zn+0i84JgoUKxYaPrrXJByrFBIN1ib3idocDrHNd7ckyOf4HB+a6CaLjoQQ/IA1nng 3NAtinPike3paCO8Y8V2p6b1wU7KatXnLUkJQ1bx05OnltR89ASl3aLcISSwo1K9Mus3wuJctR DIE1icX8jLlufbP1QmmDHknlRNmMkti6yR4IBDZbelQMZw==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-yb1-f175.google.com) smtp.remote-ip=209.85.219.175; dkim=pass header.d=brasslantern-com.20150623.gappssmtp.com header.s=20150623 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1630689325; bh=eYeS/6mVqhS3Hnwhdpy4ls1llqwtfHC3m6Pg1x313Y8=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:DKIM-Signature:DKIM-Signature; b=bSYM1que4ijrz+czY836p8vJEEfbHuS6S3GX2vryU0zqn9JmbZwoG/RBugawreeucWWMFbzIV7 8WNdEFJQhRgzO9eXq+m34hUXaIPauCTJa2lWxftloeEh4+Q7X5ysFXxMJynEcF2RWSOgjXob6n Grmhh52qayQ2bYqiQXDG5uTBmpB3MnbRcauYvrkbyv0xpviBUodtM/DucCBlFfBc6hezkkARGC rioGVTdV6x2CGZd4Jvl86hPizr92RxmVZ1n9Vul93hq/dOHoc9ADXehL/aya/iJksz2hQ+wD5l MLzG8bEDtfaL0c9YNG3CzJVntzJgNgFQ/7jPSV72swpRww==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID :Date:From:In-Reply-To:References:MIME-Version:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=eo9s01kdcHVS81DWmRllr3RBfhQxDs2XbqzWP4zl9+M=; b=NmZeIzy/fk2qFV6dREWXX9YNp0 hK4YNO48ksv3150IEadX+Z2fqi7OE8ZcGDHDB1AJAvRYSTkTa1VciqXzV5uOhmYwCuNVhYOjffX3m AoQ8QEHMyU5Gx2cI5/mYsO58o9yzoVVACPLTDxMJ/RKGm81heFu/UPsgamCLcjf9lVSirQXQOR1ER VhxnsPKALJSA9/IsxGqSEuUGW3gaFoGpuKqPZe976v3wjAw9beZH6avh6NrCojL6uiMn8USUbih0L PcyYpeLktUt6FBBB+1z+NkdB9FAxrOCzkJ4gtMUScs+DYGNACZGwXjbIcvBh8GmO2mevQiY7Q0b27 l0aX78gg==; Received: from authenticated user by zero.zsh.org with local id 1mMCmi-000D0k-IK; Fri, 03 Sep 2021 17:15:24 +0000 Authentication-Results: zsh.org; iprev=pass (mail-yb1-f175.google.com) smtp.remote-ip=209.85.219.175; dkim=pass header.d=brasslantern-com.20150623.gappssmtp.com header.s=20150623 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none Received: from mail-yb1-f175.google.com ([209.85.219.175]:43998) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1mMClg-000CHN-So; Fri, 03 Sep 2021 17:14:21 +0000 Received: by mail-yb1-f175.google.com with SMTP id c6so11271861ybm.10 for ; Fri, 03 Sep 2021 10:14:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=eo9s01kdcHVS81DWmRllr3RBfhQxDs2XbqzWP4zl9+M=; b=yoeegTVq13D26htoRZZHvmCB1USQm3wkTxOAW5t7TnlTlcJffWxy2oFUeGmWBXTAV2 DtA7X9xkVOF880Kfbnk1tCdDFEjuQa4iiD1ACWp2uklXxZsT468W0AUH1a03py6s1rO1 /iTxwO9sMvWG9mXZH7li3y2bXRZR4DBG4PCxZq3pbJMvNT86i5/T5noZshinsjijTwZt dwWScHBE8dZzbBSpmcZeyAqlRm7uNSACNjDQq11MW6lB4+58bqm/ZhbGZwA+epJOZqk2 W0CSZm8IvMsepaUDgIs6bhqMhnHImJIgrkHh4ZmJozRFKZbBWxyK9Z6e/AgY8P49iVyV 8F9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=eo9s01kdcHVS81DWmRllr3RBfhQxDs2XbqzWP4zl9+M=; b=sABllaavEwgPNg5Z54zTj/IRA23SPEJcGdLlrhncrB8RkjO8MLaJz81xK97NszgcjH Y/WIsmR0SdvBkY4UkHkthZkbGu2/wsR1ujjciNUt14YM87s8bvWt0ZaBOt/qe2LeSzU0 qloGZm+K2shPrEd5q8Kdk4MeyMHVI/niz1bv3yCMaAO6qKGU/AzUdur34Jk2L7R9GOyB i2fPVdGTeJhklscFkM+eDFKKUehj68jW7YEDbwwm2y6tg14oQxDUoFvSnQyBQeGKxVeR upbdfJpCLFba6lV8BEm1PTgnjqnqD68OfXdjqoIoO/GBt6OvtqoH/pnCmtKRljmV8w8T yUWw== X-Gm-Message-State: AOAM531AkjyFin6bSad7HgVC6V7eF9+Ed6XFs/mg8bP6FaJKlFZhGhtU RiYltD+otnSDTn0UZBaTDDQFptiSlSFgXedIPfjV/mXV240= X-Google-Smtp-Source: ABdhPJxeVed+Qcn5V2I1M32VGOVVPL3yYXa1q3dQYPOzXs3LIdFcDKf/pd+AGIrT78mziIvfAjybukt4F8t6t3pwMzk= X-Received: by 2002:a25:c305:: with SMTP id t5mr138495ybf.410.1630689259502; Fri, 03 Sep 2021 10:14:19 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Bart Schaefer Date: Fri, 3 Sep 2021 10:14:08 -0700 Message-ID: Subject: Re: Accessing the evaluated expression which caused an error To: Zach Riggle Cc: Zsh Users Content-Type: text/plain; charset="UTF-8" X-Seq: 27079 Archived-At: X-Loop: zsh-users@zsh.org Errors-To: zsh-users-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-users-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: On Thu, Sep 2, 2021 at 6:43 PM Zach Riggle wrote: > > I'm aware of funcsourcetrace, funcstack, and TRAPDEBUG / > ZSH_DEBUG_CMD as well, but none of these contain the actual expression > evaluated -- just the input to zsh. > > I know that zsh has the data internally, since "zsh -x" shows the > fully-evaluated expression, so that data must be available somewhere, > even if it's not exposed in a shell variable. Hm. What xtrace does is dump each individual shell word ... it just happens to dump them in the order that puts them together as an "expression". But you'll notice it's not actually an expression, it's just e.g. a single simple command. In fact it's even a bit weird for some structured commands (look at the output for a "case" statement for example). It's correct that none of this is captured in any sort of format that would be usable by a shell script. It never exists all at once in such a format internally. What exactly might you want captured?