From owner-freebsd-questions@freebsd.org Fri Oct 16 13:05:58 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 C6BD6435286 for ; Fri, 16 Oct 2020 13:05:58 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mout.kundenserver.de (mout.kundenserver.de [217.72.192.75]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mout.kundenserver.de", Issuer "TeleSec ServerPass Class 2 CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CCRGs49llz3RcS for ; Fri, 16 Oct 2020 13:05:57 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from r56.edvax.de ([94.222.3.6]) by mrelayeu.kundenserver.de (mreue108 [212.227.15.183]) with ESMTPA (Nemesis) id 1MYNS0-1kyqD70Waw-00VN5Q; Fri, 16 Oct 2020 15:05:51 +0200 Date: Fri, 16 Oct 2020 15:05:50 +0200 From: Polytropon To: Kurt Hackenberg Cc: freebsd-questions@freebsd.org Subject: Re: sh scripting question Message-Id: <20201016150550.6562ab84.freebsd@edvax.de> In-Reply-To: References: <24456.60388.135834.43951@jerusalem.litteratus.org> <20201015204226099763897@bob.proulx.com> Reply-To: Polytropon Organization: EDVAX X-Mailer: Sylpheed 3.1.1 (GTK+ 2.24.5; i386-portbld-freebsd8.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:JdlUlCbSVMOiwf7ttOJZeDTyvRLRmvBi49H/vxJcdrLH7kV4Hsm sPj/AFxbEpAKyMA/LsF6wW7i3PnJMwxTJy5IlcLqXDp+6E4GJN2rbbAflqGIFf5TkQ1Rwp8 ZPSIjD+Mbss7THWEsPcIQGxHg01fe5XCtmcNyJ8fU+JZLs/DhXq6AsMKgDA8S9xH3AwfbUv cm4kznMi3WTTJVQOJpIPQ== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:1qi1m+0cApE=:Xqkxybz+wB2xe2j6H8uQd2 kd0xtxYra1h4He2y3w4h+SxgGEzJT11swtelYbvQQMRF8GmzBPgb3hDq0dXPeMtwKScKCiIk9 jWiQ15odcjz8vF1cDOWFQMSDSRLB9Qbh/M0gdrUltPFFwt/vspydnd0cPUiHZOitXOj+TzMGm aG5LSx1KCd2Ip3UVz6yAPmE6x/9pV4RE8hquQkMgs8AaxAKjuKYFHf164Ja6znpkLDrVrpbSv WuVBMHAFz3xkeWalQLoVuBoSXSeS0a885oYIgNyNFCLH7iE7q/SFr/QYWFqtgkz2Qc/SQHeau w/6PAy4TnMkjdRwSEyTcxmzhf4U4MAoMLzAUqk+5rh0i9eUMvB6vnBG9vLvvFyStPNFVPZzE4 4QVOAj/skyN8jNmxgKgzWG11/EUm4u1Tp6u92YEUUeh2Oqdata4T9jSM0QjMR X-Rspamd-Queue-Id: 4CCRGs49llz3RcS X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of freebsd@edvax.de has no SPF policy when checking 217.72.192.75) smtp.mailfrom=freebsd@edvax.de X-Spamd-Result: default: False [-0.02 / 15.00]; HAS_REPLYTO(0.00)[freebsd@edvax.de]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; HAS_ORG_HEADER(0.00)[]; NEURAL_HAM_SHORT(-1.04)[-1.044]; RCPT_COUNT_TWO(0.00)[2]; RECEIVED_SPAMHAUS_PBL(0.00)[94.222.3.6:received]; RCVD_TLS_LAST(0.00)[]; R_DKIM_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:8560, ipnet:217.72.192.0/20, country:DE]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.63)[-0.631]; REPLYTO_EQ_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-0.75)[-0.747]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[edvax.de]; AUTH_NA(1.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MID_CONTAINS_FROM(1.00)[]; RCVD_IN_DNSWL_NONE(0.00)[217.72.192.75:from]; R_SPF_NA(0.00)[no SPF record]; RWL_MAILSPIKE_POSSIBLE(0.00)[217.72.192.75:from]; RCVD_COUNT_TWO(0.00)[2]; MAILMAN_DEST(0.00)[freebsd-questions] 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 13:05:58 -0000 On Thu, 15 Oct 2020 23:14:13 -0400, Kurt Hackenberg wrote: > On 2020-10-15 23:05, Bob Proulx wrote: > > > Oh you are tormenting us now. :-) There are some subtle issues here. > > > Maybe a shell is the wrong tool. No, it's not, it's just not as trivial as if the filenames would have been "normalized", i. e., if they wouldn't use reserved (but valid!) characters such as spaces. :-) I have dealt with this kind of torture many times already, and I'm quite happy I have a script that "normalizes" filenames for further use, if this is possible and allowed; if not, there are specific precautions you have to observe in your sh code. The common "for f in *; do ... bla $f ... done" just doesn't work anymore. -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...