From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 20 13:57:27 2022 Received: (at 53355) by debbugs.gnu.org; 20 Jun 2022 17:57:27 +0000 Received: from localhost ([127.0.0.1]:58396 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o3LeQ-00026T-NM for submit@debbugs.gnu.org; Mon, 20 Jun 2022 13:57:26 -0400 Received: from mailout.easymail.ca ([64.68.200.34]:45366) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o3LeO-00026C-6w; Mon, 20 Jun 2022 13:57:24 -0400 Received: from localhost (localhost [127.0.0.1]) by mailout.easymail.ca (Postfix) with ESMTP id CA0D361FC1; Mon, 20 Jun 2022 17:57:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=bokr.com; s=easymail; t=1655747838; bh=JIjYE/kcxXFZZbotlIywVuaOcYg/NQnYMrmZvGK45dw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=NQwtDNS3Po5ycxkn6JrLWbs2cnN5DW54O0zoIGHio2ZxwOyMh5JfidImDDK3Noink iQuLeCuEvGfia/brVxZT5OPW/q4w2jdnATejBS3Zb4+WG/dwV5BLlBDUTXs3gs70P6 l3A7STVNuE69HQoYyq3pMOHt+kHgmW/oxJGErXXTmiXkeujO0wJCkbdTU2tGxaim0Y VDKUUPL8zWVdpnsfBcXNUB5lBA/Dp/wyvkYOFKEoviNCVFPB3BCdwF92CSlJfnVVvC nW8w9Y343Y68wW9zuQJ9HgiR5LIEulssVzQeB1+VLBU1kasFlsynfxP+Ke4DyGDYzs CUfK/afcPSYLQ== X-Virus-Scanned: Debian amavisd-new at emo07-pco.easydns.vpn Received: from mailout.easymail.ca ([127.0.0.1]) by localhost (emo07-pco.easydns.vpn [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id YPh9IywsAen8; Mon, 20 Jun 2022 17:57:18 +0000 (UTC) Received: from localhost (m90-129-192-219.cust.tele2.se [90.129.192.219]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mailout.easymail.ca (Postfix) with ESMTPSA id 006A56174E; Mon, 20 Jun 2022 17:57:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=bokr.com; s=easymail; t=1655747838; bh=JIjYE/kcxXFZZbotlIywVuaOcYg/NQnYMrmZvGK45dw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=NQwtDNS3Po5ycxkn6JrLWbs2cnN5DW54O0zoIGHio2ZxwOyMh5JfidImDDK3Noink iQuLeCuEvGfia/brVxZT5OPW/q4w2jdnATejBS3Zb4+WG/dwV5BLlBDUTXs3gs70P6 l3A7STVNuE69HQoYyq3pMOHt+kHgmW/oxJGErXXTmiXkeujO0wJCkbdTU2tGxaim0Y VDKUUPL8zWVdpnsfBcXNUB5lBA/Dp/wyvkYOFKEoviNCVFPB3BCdwF92CSlJfnVVvC nW8w9Y343Y68wW9zuQJ9HgiR5LIEulssVzQeB1+VLBU1kasFlsynfxP+Ke4DyGDYzs CUfK/afcPSYLQ== Date: Mon, 20 Jun 2022 19:56:56 +0200 From: Bengt Richter To: Chris Marusich Subject: Re: bug#53355: bug#51466: bug#53355: guix shell --check: confusing error message Message-ID: <20220620175656.GA24590@LionPure> References: <87sftc4osu.fsf@gmail.com> <87h79slysd.fsf@gnu.org> <87sft13dyv.fsf@gmail.com> <874k59d802.fsf@gnu.org> <87wnhy2w73.fsf_-_@gmail.com> <878rudzsmv.fsf@gnu.org> <87sfozzglf.fsf_-_@gmail.com> <871qvsubgv.fsf@gnu.org> <87k09cpest.fsf@gmail.com> <20220620101210.GA19777@LionPure> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20220620101210.GA19777@LionPure> User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 53355 Cc: Ludovic =?utf-8?Q?Court=C3=A8s?= , 53355@debbugs.gnu.org, 51466@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Sorry to reply to myself, but forgot to illustrate. On +2022-06-20 12:12:10 +0200, bokr@bokr.com wrote: > Hi Chris, [...] > > I have had some mystery bash parsing errors, and I noticed > set|less > shows a heck of a lot of functions defined that I don't > remember seeing in the past. > Anyway, shouldn't stuff like that have better hygiene than just prefixed > _underscore ? Or maybe set|less doesn't show all that on your system? > There are a couple functions without prefixed underscore too, which invoke some underscore-prefixed ones that look too trusting of their arguments if you ask me: can someone declare these safe? I think I can grok quote () ... (escape single quotes and enclose result in single quotes, trusting bash state) But what if I want to define my own function quote?? How would I know I was overriding this? I really don't like my programming space occupied by unknowns :-( --8<---------------cut here---------------start------------->8--- quote () { local quoted=${1//\'/\'\\\'\'}; printf "'%s'" "$quoted" } --8<---------------cut here---------------end--------------->8--- but this one below will take more time than I want to spend on code I'm not intentionally going to use, and which invites name clashes in my command name space :-( --8<---------------cut here---------------start------------->8--- quote_readline () { local quoted; _quote_readline_by_ref "$1" ret; printf %s "$ret" } --8<---------------cut here---------------end--------------->8--- where the above calls this: --8<---------------cut here---------------start------------->8--- _quote_readline_by_ref () { if [ -z "$1" ]; then printf -v $2 %s "$1"; else if [[ $1 == \'* ]]; then printf -v $2 %s "${1:1}"; else if [[ $1 == ~* ]]; then printf -v $2 ~%q "${1:1}"; else printf -v $2 %q "$1"; fi; fi; fi; [[ ${!2} == \$* ]] && eval $2=${!2} } --8<---------------cut here---------------end--------------->8--- HTH somehow. -- Regards, Bengt Richter