From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_HELO_IP_MISMATCH,RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=3.4.4 Received: from zero.zsh.org (zero.zsh.org [IPv6:2a02:898:31:0:48:4558:7a:7368]) by inbox.vuxu.org (Postfix) with ESMTP id 1437C2241E for ; Sat, 30 Mar 2024 17:07:46 +0100 (CET) ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1711814866; b=MiJ/aJDptnRgVfaxTJComQWWeMalOuFW44Qf62E0BVmM0zAdZNOkiQGpeRTC6GsykHazBks2KP Q792uUzWFZcp8i28nkFLS+PJpwCIxRERMS74O1gtuEp2cpMPki9dO7hxAm3ovQXuViEJAJ2T6X gn8n3aml/DNYLF4O5n2sIOPqoMKs2TpLN5IMRcDDT3hhp0p58PcpE1JV7vUh/uDwJ91zbbjzd3 u5eCW02wF4Fd5VH3tImRtqcCgYwqKSQRyORZqlWASev+Z+/hrQlNGdHunHrd1awZHMSgWqWZY0 hca800dGlcrM5jQOiHSaR1IfwTi3xhpUjsiCkAHVLCtanQ==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (smtpout01-ext2.partage.renater.fr) smtp.remote-ip=194.254.240.33; dkim=pass header.d=unistra.fr header.s=CF279DD4-6F58-4C59-BB33-73FDC6DFC1E3 header.a=rsa-sha256; dmarc=pass header.from=unistra.fr; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1711814866; bh=KSTZU3Z48ecBJLxnNlh5nAoEFO+wtKpsjzsEYacNOBk=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:DKIM-Signature: DKIM-Signature; b=svWZNqoqmJymVtimHfdsdGwh5QXK/Uyrufl2iXtNVR4syDuokf/nbQdifc17sqv3q62aUf8ycQ Gm44LwAw9dv/ZQ5dtO22hMtu9wRCiBErFJPWgYQxOr3cv0OXE5CENjmDFcZmG2H+nIwHqFmWC4 F80qDvtpZFHxI/7VXJ32w0okWz+HfZCGH8vJ5BqdeJnSxoEl/B42oQ1SeGVxPftJ7xrcCgCEwR ReDu/wD7hJ4DfKUAX3eqbGmMYjJ9YEwGUx4TWtOg00N8xMJuNszQaDdu1WpXMxTbZVMtplf52c E8IO3ih+NzkPtlF4TS3jE7j6caePOzjRMKNc//84iSyFhg==; 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-Transfer-Encoding:In-Reply-To :Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID; bh=fcWptRCVU6EseaGZoZakLTdGGOtM7PMARNvdiNXR9yg=; b=mRRJH1XYGaZDcjqHGAbeLgNg40 64wXcvebbEJOV8f1A5r5Viau2LM9HMdqxXEzlh7f1f6TEUHTcALEaXbGY6menkQyQkhHuSZt6JSOM o/qPX+qsQsheBcHqjC2hfGh5EI5S9koOtilskRdGdmOpu5fdlwFz69Ae2j+ANkPmgUJjSCoxUwErp XlHJUtmLwCTF5hFXXFGDJJ7i1gwGQAdZbK2umtZ9+CbXbfL82vNwK9rMx65P9sriYdO5lntTsNDkM ZWdPxLz3Qm9934ez6NtUp5tAJhjYUk7URRVSa7WRv89MPvbD1W+rLFArwjDE6DFeQpJVrQv435fhV 580OxRvQ==; Received: by zero.zsh.org with local id 1rqbFC-000C54-Ca; Sat, 30 Mar 2024 16:07:46 +0000 Authentication-Results: zsh.org; iprev=pass (smtpout01-ext2.partage.renater.fr) smtp.remote-ip=194.254.240.33; dkim=pass header.d=unistra.fr header.s=CF279DD4-6F58-4C59-BB33-73FDC6DFC1E3 header.a=rsa-sha256; dmarc=pass header.from=unistra.fr; arc=none Received: from smtpout01-ext2.partage.renater.fr ([194.254.240.33]:47228) by zero.zsh.org with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) id 1rqbEe-000BMc-KR; Sat, 30 Mar 2024 16:07:13 +0000 Received: from zmtaauth03.partage.renater.fr (zmtaauth03.partage.renater.fr [194.254.240.26]) by smtpout10.partage.renater.fr (Postfix) with ESMTP id 2B2A56DE8A; Sat, 30 Mar 2024 17:07:10 +0100 (CET) Received: from zmtaauth03.partage.renater.fr (localhost [127.0.0.1]) by zmtaauth03.partage.renater.fr (Postfix) with ESMTPS id 242F68000E; Sat, 30 Mar 2024 17:07:10 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by zmtaauth03.partage.renater.fr (Postfix) with ESMTP id 14B178001A; Sat, 30 Mar 2024 17:07:10 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.10.3 zmtaauth03.partage.renater.fr 14B178001A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=unistra.fr; s=CF279DD4-6F58-4C59-BB33-73FDC6DFC1E3; t=1711814830; bh=fcWptRCVU6EseaGZoZakLTdGGOtM7PMARNvdiNXR9yg=; h=Date:From:To:Message-ID:MIME-Version; b=WgKGvubkJpvJafDofwDfpdZDUtOv7KNdngB+jnUPWbH3V19TaGp8lmv9HBwEgmBxW 2ARiJbX/UVunP463qACJSbg1CF0OhnbvtnaRAuZ5Sw7NNIVahhPnzVkDXUGoEwCN8X R/tJphXQrumiFe+c05o2TLxnGCS5z9huPDgvBxuvOUbsFDKFiP2t8AL9VlbAb4bBtP eBe1HlUNCcymv9nHZTijHMDnXMQN1pPK8ufnLdgwwUEIlQ9mWqvwJFrhLvIiXHnGCn plRBoPAt9DFQS8kckWFDEuY09T2woXE3J5+DhugBau28HhEZic0+ys2N9DdO07CIzt hcij/9HbnNDaA== Received: from zmtaauth03.partage.renater.fr ([127.0.0.1]) by localhost (zmtaauth03.partage.renater.fr [127.0.0.1]) (amavis, port 10026) with ESMTP id CB6kwIgne6sh; Sat, 30 Mar 2024 17:07:10 +0100 (CET) Received: from 37.167.172.197 (unknown [194.254.241.250]) by zmtaauth03.partage.renater.fr (Postfix) with ESMTPA id CE87E8000E; Sat, 30 Mar 2024 17:07:09 +0100 (CET) Date: Sat, 30 Mar 2024 17:07:09 +0100 From: Marc Chantreux To: Ray Andrews Cc: Zsh Users Subject: Re: vanishing spaces Message-ID: References: <3643c571-5830-420c-9d1f-88a6bf22cc0e@eastlink.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <3643c571-5830-420c-9d1f-88a6bf22cc0e@eastlink.ca> X-Virus-Scanned: clamav-milter 0.103.8 at clamav04 X-Virus-Status: Clean X-Renater-Ptge-SpamState: clean X-Renater-Ptge-SpamScore: -100 X-Renater-Ptge-SpamCause: gggruggvucftvghtrhhoucdtuddrgedvledruddvhedgiedvucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecutffgpfetvffgtfenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhepfffhvfevuffkfhggtggugfgjsehtkeertddttddunecuhfhrohhmpeforghrtgcuvehhrghnthhrvghugicuoehmtgesuhhnihhsthhrrgdrfhhrqeenucggtffrrghtthgvrhhnpefhtedtgfefkeevkeetudfgfeethfejueevudetfedtteevkeffjedtgfeivdejhfenucfkphepudelgedrvdehgedrvdeguddrvdehtdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeduleegrddvheegrddvgedurddvhedtpdhhvghlohepfeejrdduieejrddujedvrdduleejpdhmrghilhhfrhhomhepmhgtsehunhhishhtrhgrrdhfrhdpnhgspghrtghpthhtohepvddprhgtphhtthhopehrrgihrghnughrvgifshesvggrshhtlhhinhhkrdgtrgdprhgtphhtthhopeiishhhqdhushgvrhhsseiishhhrdhorhhg Content-Transfer-Encoding: quoted-printable X-Seq: 29743 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 Sat, Mar 30, 2024 at 08:18:30AM -0700, Ray Andrews wrote: > % aptitude search '~i?name(nvidia)' aptitude search '~i~nnvidia' for short. check it out: aptitude-doc-en: /usr/share/doc/aptitude/html/en/ch02s04s05.html > =A0=A0=A0 ... I have reason to capture the output of several versions o= f aptitude > searches into a variable. I hope 'eval' is the right way: about the vanishing spaces: it's because you need to protect them with quotes both while reading and writing them: bad: output=3D$( eval $* ) echo $output good: output=3D"$( eval $* )" echo "$output" Aside: I don't understand why you eval it. it's ok to write output=3D"$( aptitude search '~i~nnvidia' )" plus: I try to avoid eval as much as possible because it's fragile. if your command is stored in "$@" with all the parameters set correctly, you don't need eval: set -- aptitude search '~i~nnvidia' output=3D$( "$@" ) quotes are important here also as "$@" will be expanded as "aptitude" "search" "~i~nnvidia" HTH, marc