From owner-freebsd-questions@freebsd.org Fri Oct 16 03:48:21 2020 Return-Path: Delivered-To: freebsd-questions@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7AB3C44E93C for ; Fri, 16 Oct 2020 03:48:21 +0000 (UTC) (envelope-from ralf-mardorf@riseup.net) Received: from mx1.riseup.net (mx1.riseup.net [198.252.153.129]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.riseup.net", Issuer "Sectigo RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CCBvS583Jz4Nmy for ; Fri, 16 Oct 2020 03:48:20 +0000 (UTC) (envelope-from ralf-mardorf@riseup.net) Received: from bell.riseup.net (bell-pn.riseup.net [10.0.1.178]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client CN "*.riseup.net", Issuer "Sectigo RSA Domain Validation Secure Server CA" (not verified)) by mx1.riseup.net (Postfix) with ESMTPS id 4CCBvG6WzpzDsyh for ; Thu, 15 Oct 2020 20:48:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=riseup.net; s=squak; t=1602820090; bh=shHO+yDi7Hg9M080Em/DdVFp4baTSgevWQEQqbh1ylY=; h=Date:From:To:Subject:In-Reply-To:References:From; b=lmF/Lh+ydX+vTYwIlJpgcn0GhZLam3IC2Bw1B2AQA9PWh/9i+VviwmFO8YhabN8pX aeETvZaxWCVbiZb/qAOZZH2Th2kdNixxf5E5a50Xypy/rqD778R6z1UMjMj2C1NL3H DoQ97VyucoK59pBCgM9qEANF8PS+6eWtyG4Qk+1Y= X-Riseup-User-ID: CBA2FE826F596E7E627F51E0B72D36995F6862A952E43E463EAEBD1F2C83972D Received: from [127.0.0.1] (localhost [127.0.0.1]) by bell.riseup.net (Postfix) with ESMTPSA id 4CCBvG1djbzJmq1 for ; Thu, 15 Oct 2020 20:48:10 -0700 (PDT) Date: Fri, 16 Oct 2020 05:47:57 +0200 From: Ralf Mardorf To: freebsd-questions@freebsd.org Subject: Re: sh scripting question Message-ID: <20201016054735.33ad768e@archlinux> In-Reply-To: <20201015204226099763897@bob.proulx.com> References: <24456.60388.135834.43951@jerusalem.litteratus.org> <20201015204226099763897@bob.proulx.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4CCBvS583Jz4Nmy X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=riseup.net header.s=squak header.b=lmF/Lh+y; dmarc=pass (policy=none) header.from=riseup.net; spf=pass (mx1.freebsd.org: domain of ralf-mardorf@riseup.net designates 198.252.153.129 as permitted sender) smtp.mailfrom=ralf-mardorf@riseup.net X-Spamd-Result: default: False [-4.62 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[riseup.net:s=squak]; NEURAL_HAM_MEDIUM(-0.98)[-0.978]; FROM_HAS_DN(0.00)[]; RWL_MAILSPIKE_GOOD(0.00)[198.252.153.129:from]; TO_MATCH_ENVRCPT_ALL(0.00)[]; R_SPF_ALLOW(-0.20)[+mx]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-questions@freebsd.org]; TO_DN_NONE(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; DWL_DNSWL_LOW(-1.00)[riseup.net:dkim]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[riseup.net:+]; DMARC_POLICY_ALLOW(-0.50)[riseup.net,none]; NEURAL_HAM_SHORT(-1.03)[-1.025]; NEURAL_HAM_LONG(-1.02)[-1.018]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; MID_RHS_NOT_FQDN(0.50)[]; ASN(0.00)[asn:16652, ipnet:198.252.153.0/24, country:US]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[freebsd-questions]; RCVD_IN_DNSWL_LOW(-0.10)[198.252.153.129:from] X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Oct 2020 03:48:21 -0000 On Thu, 15 Oct 2020 21:05:04 -0600, Bob Proulx wrote: >leading or trailing spaces Hi, IMO our scripts should not waste resources to work around insane path and/or file names such as $ touch " ; && || \\ .txt # " or other issues, unless a third party could misuse missing workarounds. In some real world corner cases, you better don't use a script at all, see https://lists.claws-mail.org/pipermail/users/2020-October/027113.html , where the scrip impossibly can work around the "issue" in the first place. Scripts are useful tools, but they cannot be used for everything. A script used to handle paths and files on our own machines, run by us, should be written to handle sane path and file names, since we should use only sane path and file names, period. To me already "FreeBSD is great.txt" isn't a good file name, I would name it "freebsd_is_great.txt", but that's just me. However, naming it " FreeBSD is great.txt ", would be just stupid. 2 Cents, Ralf