From nobody Sat Nov 30 16:04:06 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 4Y0vxY57Xyz5fDq0 for ; Sat, 30 Nov 2024 16:04:17 +0000 (UTC) (envelope-from darcy@druid.net) Received: from mail.vex.net (mail.vex.net [98.158.132.68]) (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 did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4Y0vxX3XCnz4dd1 for ; Sat, 30 Nov 2024 16:04:16 +0000 (UTC) (envelope-from darcy@druid.net) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=druid.net header.s=VEXNET header.b=ygKfp2Gf; spf=pass (mx1.freebsd.org: domain of darcy@druid.net designates 98.158.132.68 as permitted sender) smtp.mailfrom=darcy@druid.net; dmarc=pass (policy=none) header.from=druid.net Received: from [192.168.215.111] (unknown [108.147.187.83]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: darcy) by mail.vex.net (Postfix) with ESMTPSA id 32B5C35B7C for ; Sat, 30 Nov 2024 11:04:07 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=druid.net; s=VEXNET; t=1732982648; bh=OgBu2y7kXqthR+Qxfm8rzaRhkqutDuB7JCi2hBhgnBE=; h=Date:Subject:To:References:From:In-Reply-To; b=ygKfp2GfHNWykdN4OWaKLk53BvyjxX6bpIWRepmGfsuAo3Q2qb7NKWOl+UH+P81rC L9BYyHcPavnssX9EQHIBxgy3vRdbqxjbgjzpOgokkvjIXZROKIvevz7v1Sa0A/eZhu KSYZ4hIpnNz4E0N9bBXsShEQuUoQ8O3DMtrK08s4= Message-ID: <015209fe-8cae-4e0e-94ec-a20a87d42d94@druid.net> Date: Sat, 30 Nov 2024 09:04:06 -0700 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 To: questions@freebsd.org References: <95966dac-9d93-401f-9948-5fcb224a1e1f@nethead.se> From: D'Arcy Cain Content-Language: en-US In-Reply-To: <95966dac-9d93-401f-9948-5fcb224a1e1f@nethead.se> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spamd-Result: default: False [-3.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.99)[-0.987]; DMARC_POLICY_ALLOW(-0.50)[druid.net,none]; R_SPF_ALLOW(-0.20)[+mx]; R_DKIM_ALLOW(-0.20)[druid.net:s=VEXNET]; MIME_GOOD(-0.10)[text/plain]; XM_UA_NO_VERSION(0.01)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; ASN(0.00)[asn:19842, ipnet:98.158.132.0/24, country:CA]; RCVD_COUNT_ONE(0.00)[1]; RCPT_COUNT_ONE(0.00)[1]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[]; MLMMJ_DEST(0.00)[questions@freebsd.org]; ARC_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; TO_DN_NONE(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[questions@freebsd.org]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DKIM_TRACE(0.00)[druid.net:+] X-Rspamd-Queue-Id: 4Y0vxX3XCnz4dd1 X-Spamd-Bar: --- 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