From nobody Sat Nov 30 15:33:39 2024 X-Original-To: freebsd-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 4Y0vGP6ZsSz5fBG9 for ; Sat, 30 Nov 2024 15:33:49 +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 4Y0vGN6cYWz4bCt for ; Sat, 30 Nov 2024 15:33:48 +0000 (UTC) (envelope-from peo@nethead.se) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=nethead.se header.s=NETHEADSE header.b=mhz1DOqX; 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=1732980821; bh=VHDtct5gyX1L2SEA86rbzGk/DTdNZ4OWgEeNB7ozFPo=; h=Date:To:From:Subject; b=mhz1DOqXIe8WUWjMwy6ZLnRy71UCuoPIORtPYlIAgHiLEkeNuYdMhWtQIXZvla6gX 2REU76FWxZtB0M9YcA8Vbdr8/SMTy73BUYdqg7xdu1RhtNUrP1RX/TEnV5aA+m4F1a 8F6+47yW/FubT6Fuo8umWE3kxr4qhpIlh2N0diu0= Message-ID: <95966dac-9d93-401f-9948-5fcb224a1e1f@nethead.se> Date: Sat, 30 Nov 2024 16:33:39 +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 To: FreeBSD questions Content-Language: en-US From: Per olof Ljungmark Subject: shell script for removing unprintable characters in file names Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spamd-Result: default: False [-3.98 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.99)[-0.994]; 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)[freebsd-questions@freebsd.org]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; TO_DN_ALL(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DKIM_TRACE(0.00)[nethead.se:+] X-Rspamd-Queue-Id: 4Y0vGN6cYWz4bCt X-Spamd-Bar: --- 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. Thanks a lot! Per