From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id MCV9Hsi9sGLOGAEAbAwnHQ (envelope-from ) for ; Mon, 20 Jun 2022 20:34:48 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id ILJfHsi9sGK7RgEA9RJhRA (envelope-from ) for ; Mon, 20 Jun 2022 20:34:48 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id D09702F41A for ; Mon, 20 Jun 2022 20:34:47 +0200 (CEST) Received: from localhost ([::1]:57888 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o3MEX-00078P-VF for larch@yhetil.org; Mon, 20 Jun 2022 14:34:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44486) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o3Lf0-0006K8-LI for bug-guix@gnu.org; Mon, 20 Jun 2022 13:58:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:36267) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o3Lf0-0002Nh-C8 for bug-guix@gnu.org; Mon, 20 Jun 2022 13:58:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1o3Lf0-00027V-Ba for bug-guix@gnu.org; Mon, 20 Jun 2022 13:58:02 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#53355: bug#51466: bug#53355: guix shell --check: confusing error message Resent-From: Bengt Richter Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Mon, 20 Jun 2022 17:58:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 53355 X-GNU-PR-Package: guix X-GNU-PR-Keywords: moreinfo To: Chris Marusich Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= , 53355@debbugs.gnu.org, 51466@debbugs.gnu.org Received: via spool by 53355-submit@debbugs.gnu.org id=B53355.16557478478099 (code B ref 53355); Mon, 20 Jun 2022 17:58:02 +0000 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 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-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1655750088; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:in-reply-to:in-reply-to:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post: dkim-signature; bh=hXUKwhh3e3D8V9vPgxW3i7bJ7LH7i98WFa9FoLWnKV8=; b=kD0GWtNg6Hd62JasB9KzHODv3gDxV5xdZP4U2iI60/c2hhkjv+FIiIahh1RctOhTIW7sQe k6VHaOcKBNO7WX4YhrjRgVQfZ1JOYwOzsPcyJ4MJt/D0Jjgh1kF4UanoopUxiV2k7iMyq+ c0J8ptvZU+d0ZApJ0XO3dp3KEY5UdgNg10ng9vHgdmBR1dpT42oCaVt7sBvLFfJJEcLGW/ wicKh+0dqSA2RkAJbK29wzXfcDK4cUo33LJC3iBUZQ13IUaRYCOw3n6OwuoCxRx9fFiQxz lsvkIzoa53vNVdnlNpoiLQuSfZzmWvKKd/+bS/lXLPkGa7ZPID0LUsLBBh9BrA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1655750088; a=rsa-sha256; cv=none; b=sBtY/bHwQsWX/yyqsYSMwNcQHm/Fiy+z+dMVG4TPf6VxJ6+5D8Z3bLACFLp1jbjBvRhjRj BBpeIHurTq8xj9jVTtek6BdDTFdOY5wjfefjz6Yjh0DKgLTTvdz5Cu95KENoJ3EWP8h90L m1Lkc82mSM3VxeLjceTas5MLB0m1N2E/JNSo3WR6vkcy5UNK531tDwRDR/Hc9Ppm34eUfY RL6U1ITsgcYS2S4yqRbaNvGSXg/uwW1++Ecr4etk0eowgJqfBgARdJN+9gQ7xc96z9fQa8 etbugDpcJlcPQX2spaxc4Z1Gu7tpBiU1m6Sl8X4rrKAL31yRPiX3tiXUMoRFAA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=bokr.com header.s=easymail header.b=NQwtDNS3; dkim=fail ("headers rsa verify failed") header.d=bokr.com header.s=easymail header.b=NQwtDNS3; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: 2.53 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=bokr.com header.s=easymail header.b=NQwtDNS3; dkim=fail ("headers rsa verify failed") header.d=bokr.com header.s=easymail header.b=NQwtDNS3; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: D09702F41A X-Spam-Score: 2.53 X-Migadu-Scanner: scn0.migadu.com X-TUID: 9q6Wurc3qej4 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