From nobody Sun Dec 01 10:05:21 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 4Y1Mx23KCZz5fNBq for ; Sun, 01 Dec 2024 10:05:26 +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 4Y1Mx11dkpz4sll for ; Sun, 1 Dec 2024 10:05:25 +0000 (UTC) (envelope-from peo@nethead.se) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=nethead.se header.s=NETHEADSE header.b="ZShZt4w/"; 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=1733047522; bh=J22l56VpU1vM55UKSuv/loGr77Zo9nwqpS1foBhHH8k=; h=Date:Subject:To:References:From:In-Reply-To; b=ZShZt4w/KX5kfDBP3UOrJ7pfFoyad5qybBTg3Dc+qObMCVo2xgOWpwV+K83zNbhCf xbvbV+dCxgj33r9WO0BF1+pSRA0OohEDQTkH+kaf3rxUbOEuiCz1Ji4wpXHYEIxw5i 7BptDqlAknm/GCEcxzj2OVq13iFGtepz8HRQrpUQ= Message-ID: Date: Sun, 1 Dec 2024 11:05:21 +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> <86v7w464zp.fsf@bay.localnet> From: Per olof Ljungmark In-Reply-To: <86v7w464zp.fsf@bay.localnet> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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]; MIME_GOOD(-0.10)[text/plain]; XM_UA_NO_VERSION(0.01)[]; RCPT_COUNT_ONE(0.00)[1]; 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]; ARC_NA(0.00)[]; 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: 4Y1Mx11dkpz4sll X-Spamd-Bar: --- On 2024-11-30 17:50, Carl Johnson wrote: > Per olof Ljungmark writes: > >> 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. > > You should look into the 'detox' port to see if it can do what you want. > It is customizable if it the defaults don't work for you, although I > just use the defaults. It did exactly what I wanted, thank you. Per