From nobody Sat Nov 30 16:47:25 2024 X-Original-To: questions@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Y0wvQ4RSJz5fHGT for ; Sat, 30 Nov 2024 16:47:30 +0000 (UTC) (envelope-from peo@nethead.se) Received: from ns1.nethead.se (ns1.nethead.se [5.150.237.139]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "ns1.nethead.se", Issuer "E6" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Y0wvP56Wgz4lR7 for ; Sat, 30 Nov 2024 16:47:29 +0000 (UTC) (envelope-from peo@nethead.se) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=nethead.se header.s=NETHEADSE header.b=zUnX39uJ; spf=pass (mx1.freebsd.org: domain of peo@nethead.se designates 5.150.237.139 as permitted sender) smtp.mailfrom=peo@nethead.se; dmarc=pass (policy=none) header.from=nethead.se X-Virus-Scanned: amavisd-new at Nethead AB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nethead.se; s=NETHEADSE; t=1732985247; bh=d8yy30n2oM/oO7WG444QfuQOiLz7Z+eYcAC/cRFcjAg=; h=Date:Subject:To:References:From:In-Reply-To; b=zUnX39uJKs+Bxw4F6NnWY4XcQT4mT/5nxorhklyGA8msTIhG12kTUPslPWE01mbk9 qx0zJTceyqb6ku8f66qU+tSo573h2L5vECva/pEZyDs7wAYpYM+nWBRmckD4Es9pHe pEr/mtTAyvBHf3naagev9lotBbvLoI0OJn7t9S8A= Message-ID: <6fd544b3-578c-46d3-a036-347ec1db1d24@nethead.se> Date: Sat, 30 Nov 2024 17:47:25 +0100 List-Id: User questions List-Archive: https://lists.freebsd.org/archives/freebsd-questions List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: freebsd-questions@freebsd.org Sender: owner-freebsd-questions@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: shell script for removing unprintable characters in file names Content-Language: en-US To: questions@freebsd.org References: <95966dac-9d93-401f-9948-5fcb224a1e1f@nethead.se> <015209fe-8cae-4e0e-94ec-a20a87d42d94@druid.net> From: Per olof Ljungmark In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spamd-Result: default: False [-3.95 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.96)[-0.956]; DMARC_POLICY_ALLOW(-0.50)[nethead.se,none]; R_DKIM_ALLOW(-0.20)[nethead.se:s=NETHEADSE]; R_SPF_ALLOW(-0.20)[+ip4:5.150.237.139:c]; MIME_GOOD(-0.10)[text/plain]; XM_UA_NO_VERSION(0.01)[]; ARC_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:8473, ipnet:5.150.192.0/18, country:SE]; RCVD_COUNT_ZERO(0.00)[0]; MLMMJ_DEST(0.00)[questions@freebsd.org]; RCPT_COUNT_ONE(0.00)[1]; FROM_HAS_DN(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TO_DN_NONE(0.00)[]; DKIM_TRACE(0.00)[nethead.se:+] X-Rspamd-Queue-Id: 4Y0wvP56Wgz4lR7 X-Spamd-Bar: --- On 2024-11-30 17:10, paul beard wrote: > I read the question as how to recover and rename the files to remove the > out of bounds characters, not how to view the names. Yes, exactly, viewing is doable, batch recovering is what I'm after. > On Sat, Nov 30, 2024 at 8:04 AM D'Arcy Cain > wrote: > > On 11/30/24 08:33, Per olof Ljungmark wrote: > > Hi, > > > > I am tasked with recovering hundreds or more files created with > unknown > > OSs and have unknown characters in the name, replaced with a '?'. > > > > Like file?nam?.??? > > > > Please, if you have such a script can you post or email it? > Replacing > > the unknown character with anything, like '-' or '_' using whatever > > shell, sh, bash or csh. > > > > Perhaps you just need to set your terminal to UTF: > > export LC_ALL=en_US.UTF-8 > export LC_MESSAGES=en_US.UTF-8 > > -- > D'Arcy J.M. Cain > >  |  Democracy is three wolves > http://darcy.druid.net/ > |  and a sheep voting on > +1 416 788 2246     (DoD#0082)    (eNTP)   |  what's for dinner. > IM: darcy@VybeNetworks.com, VoIP: sip:darcy@druid.net > > > > > -- > Paul Beard / www.paulbeard.org/