From nobody Sat Nov 30 16:50:02 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 4Y0wyP53ztz5fHph for ; Sat, 30 Nov 2024 16:50:05 +0000 (UTC) (envelope-from carlj@peak.org) Received: from mail.nrtc.syn-alias.com (mail.nrtc.syn-alias.com [129.213.214.220]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4Y0wyN6sgDz4m93 for ; Sat, 30 Nov 2024 16:50:04 +0000 (UTC) (envelope-from carlj@peak.org) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=peak.org header.s=synacor-nrtc header.b=kSJHiNJr; spf=pass (mx1.freebsd.org: domain of carlj@peak.org designates 129.213.214.220 as permitted sender) smtp.mailfrom=carlj@peak.org; dmarc=pass (policy=none) header.from=peak.org DKIM-Signature: v=1; a=rsa-sha1; d=peak.org; s=synacor-nrtc; c=relaxed/simple; q=dns/txt; i=@peak.org; t=1732985403; h=From:Subject:Date:To:MIME-Version:Content-Type; bh=lTdFR1PdCEZykapDh327pGsFqx4=; b=kSJHiNJrQ5wIt7D1DJPliISJhJ16z2Tfm8ZZ36BS4G6tTPSRb+H34lW1sDC4C16x wfgw49owP4TR2HjdkcOfKTHkROdryEp+wF0WJNkAM2HfccpcHICpAdmrlumiJPf/ Kluwfht3n0gB5OWL2YLcX/nclRPXSNuXRkk4jkAZ94CRCSHkSJ2c8aqkcc3grorh oLCD5c+V1lkdXCluKfuSNQI+AQWcL9v3FRa2h46Am8jgZ7zBDapIYhdxywkk7oA6 5VgvXQjW1fVq/Dy382PVKh7SkKqqIXSIQb/066ieQrRlBSH1HpGBYirp635MlvsD Oi62AH3mh14CH8ziy39Xuw==; X-Authed-Username: Y2FybGpAcGVhay5vcmc= Received: from [199.58.99.88] ([199.58.99.88:29541] helo=bay.localnet) by mail.peak.org (envelope-from ) (ecelerity 4.4.1.20033 r(msys-ecelerity:tags/4.4.1.0^0)) with ESMTPA id 54/DB-28097-B324B476; Sat, 30 Nov 2024 11:50:03 -0500 Received: from carlj by bay.localnet with local (Exim 4.98 (FreeBSD)) (envelope-from ) id 1tHQfS-000000009uS-1U5e for freebsd-questions@freebsd.org; Sat, 30 Nov 2024 08:50:02 -0800 From: Carl Johnson To: freebsd-questions@freebsd.org Subject: Re: shell script for removing unprintable characters in file names In-Reply-To: <95966dac-9d93-401f-9948-5fcb224a1e1f@nethead.se> (Per olof Ljungmark's message of "Sat, 30 Nov 2024 16:33:39 +0100") References: <95966dac-9d93-401f-9948-5fcb224a1e1f@nethead.se> Date: Sat, 30 Nov 2024 08:50:02 -0800 Message-ID: <86v7w464zp.fsf@bay.localnet> User-Agent: Gnus/5.13 (Gnus v5.13) 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 Content-Type: text/plain X-Vade-Verdict: clean X-Vade-Analysis-1: gggruggvucftvghtrhhoucdtuddrgeefuddrheehgdeltdcutefuodetggdotefrodftvfcurfhrohhf X-Vade-Analysis-2: ihhlvgemucfujgfpteevqfftpdfptffvvedpgffpggdqpfftvfevpdfqfgfvnecuuegrihhlohhuthem X-Vade-Analysis-3: uceftddunecunecujfgurhephffvufgjfhffkfgfgggtsehttddttddtredtnecuhfhrohhmpeevrghr X-Vade-Analysis-4: lhculfhohhhnshhonhcuoegtrghrlhhjsehpvggrkhdrohhrgheqnecuggftrfgrthhtvghrnheptdfh X-Vade-Analysis-5: gfdufeefffdvhefgkedtheeuudektdelgffgvdetvdegfedufeeifedvueefnecukfhppeduleelrdeh X-Vade-Analysis-6: kedrleelrdekkeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeduleelrdeh X-Vade-Analysis-7: kedrleelrdekkedphhgvlhhopegsrgihrdhlohgtrghlnhgvthdpmhgrihhlfhhrohhmpegtrghrlhhj X-Vade-Analysis-8: sehpvggrkhdrohhrghdpnhgspghrtghpthhtohepuddpmhhtrghhohhsthepshhmthhptddvrdhnrhht X-Vade-Analysis-9: tgdrvghmrghilhdqrghshhdurdhshihntgdrlhgrnhdpihhspghnrgepthhruhgvpdgruhhthhgpuhhs X-Vade-Analysis-10: vghrpegtrghrlhhjsehpvggrkhdrohhrghdprhgtphhtthhopehfrhgvvggsshguqdhquhgvshhtihho X-Vade-Analysis-11: nhhssehfrhgvvggsshgurdhorhhg X-Vade-Client: NRTC 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.98)[-0.978]; DMARC_POLICY_ALLOW(-0.50)[peak.org,none]; R_DKIM_ALLOW(-0.20)[peak.org:s=synacor-nrtc]; R_SPF_ALLOW(-0.20)[+ip4:129.213.214.220]; MIME_GOOD(-0.10)[text/plain]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:31898, ipnet:129.213.208.0/21, country:US]; DWL_DNSWL_NONE(0.00)[peak.org:dkim]; RCVD_IN_DNSWL_NONE(0.00)[129.213.214.220:from]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; MLMMJ_DEST(0.00)[freebsd-questions@freebsd.org]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TO_DN_NONE(0.00)[]; RCVD_TLS_LAST(0.00)[]; DKIM_TRACE(0.00)[peak.org:+] X-Rspamd-Queue-Id: 4Y0wyN6sgDz4m93 X-Spamd-Bar: --- 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. -- Carl Johnson carlj@peak.org