From nobody Sat Nov 30 16:10:28 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 4Y0w4y6BmQz5fDrQ for ; Sat, 30 Nov 2024 16:10:42 +0000 (UTC) (envelope-from paulbeard@gmail.com) Received: from mail-ej1-x629.google.com (mail-ej1-x629.google.com [IPv6:2a00:1450:4864:20::629]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Y0w4y1st7z4fRY for ; Sat, 30 Nov 2024 16:10:42 +0000 (UTC) (envelope-from paulbeard@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20230601 header.b=Sx+MgAra; spf=pass (mx1.freebsd.org: domain of paulbeard@gmail.com designates 2a00:1450:4864:20::629 as permitted sender) smtp.mailfrom=paulbeard@gmail.com; dmarc=pass (policy=none) header.from=gmail.com Received: by mail-ej1-x629.google.com with SMTP id a640c23a62f3a-a9ec267b879so402756566b.2 for ; Sat, 30 Nov 2024 08:10:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1732983040; x=1733587840; darn=freebsd.org; h=cc:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=mcRhD19tknzcftiKXXo+n0JhHkvBlutfi91vWPL1ZYc=; b=Sx+MgAraPEawrZBdH9W9d5v1HRXTTh7LbRjQL7mi4IbD4l2Ic4C5QOoqDf+kEAc1Bz pESmJxLoXOIJJmjI4C1HhZ5wgGwcdRWmTP314n4rYHuHC8fHGmvaQ8omTqHJAoRQi/h1 TnsH2f3NTt5ZV/RTtwp1FW8RjLufOJSBXsiP3juqx+vzP2vr023WPBbYDvKctrXqce2J bOLBlUodQyT/7h9OnVZVWRVmf2MxOzeRoc295FRMNpl/0OjWOhYx34hH4vT9gwOQn495 t2hYbyUb8FtK8BwEN1tvqFJI4k5Lsf3MK6Qkpg4+1bu5oqchh+k8fH3aSwA4owpbZ5u4 7sqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732983040; x=1733587840; h=cc:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=mcRhD19tknzcftiKXXo+n0JhHkvBlutfi91vWPL1ZYc=; b=sIxbm4TEg04UeG8dL9wkvW+Jdere+TWeTwTo9gug7w5/PIFdCY4+5C8gGgGYhXQtCi il2r/XWrU77bew8Iuo1YHrySku3BhROZQrSYrmyxhz6IC1pl+J3AYJxcl5GsRcx07rtn kk7+8t7RpgCTdQ20k/Xkgz+zGJMjSLVNNrGIpwXjAknfKUk9E2/zVsa3GjOPTuee0zTu XvXOfBYJcKyVNk3mHaLnm/4M48A/3+HTxy6jl1AwZ1Q27/E/Yde+Y9Os+jHjzim8k/Xk 2p81FHi2yRDKoJl0yCrZdYnMDp+3ozgQaLzUr2RcdGnMTSpX4AzjxCvShOXvTV940jHB Qbbg== X-Gm-Message-State: AOJu0Yxrw2jFFdDYUJ+5o8PnE+5lv8JPDitwu8yI/7nbj6M+IjzFu0Ps 5+LrcLU2avJZ7wrSwivdyUWSD7Fbv7qzyoVM0Yr7hrtsh/B/GJK/03z4K240L5JpIX1z3N0UZuB OYhCi4s+nFYW4xHIkUUj0cws+aNygYp4D X-Gm-Gg: ASbGncv+CLC6BkTitmJhJqcedyda8b/Xlpn6tjLCikYd2Q3+nByvIxfK/ydcLGsTzpq d7ORMvXcKYDDaabwVcIg6pES7lEJ71LzY X-Google-Smtp-Source: AGHT+IHEfoVqXHv5kLY/63aoOuiS542UCEncQMol+p+g5ydImgEl2YGIdfek4TFuFw/tRiMU7nQtFLbmoZZqDVsps7M= X-Received: by 2002:a17:907:7814:b0:aa5:28af:f0e with SMTP id a640c23a62f3a-aa580f19b05mr1175170766b.15.1732983040410; Sat, 30 Nov 2024 08:10:40 -0800 (PST) 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 References: <95966dac-9d93-401f-9948-5fcb224a1e1f@nethead.se> <015209fe-8cae-4e0e-94ec-a20a87d42d94@druid.net> In-Reply-To: <015209fe-8cae-4e0e-94ec-a20a87d42d94@druid.net> From: paul beard Date: Sat, 30 Nov 2024 08:10:28 -0800 Message-ID: Subject: Re: shell script for removing unprintable characters in file names Cc: questions@freebsd.org Content-Type: multipart/alternative; boundary="000000000000868f690628238e4c" X-Spamd-Result: default: False [-2.00 / 15.00]; MISSING_TO(2.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-1.000]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20230601]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; RCVD_TLS_LAST(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; ARC_NA(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; RCPT_COUNT_ONE(0.00)[1]; FREEMAIL_ENVFROM(0.00)[gmail.com]; FREEMAIL_FROM(0.00)[gmail.com]; FROM_HAS_DN(0.00)[]; MISSING_XM_UA(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; PREVIOUSLY_DELIVERED(0.00)[questions@freebsd.org]; TO_DN_NONE(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; MID_RHS_MATCH_FROMTLD(0.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; MLMMJ_DEST(0.00)[questions@freebsd.org]; RCVD_COUNT_ONE(0.00)[1]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::629:from] X-Rspamd-Queue-Id: 4Y0w4y1st7z4fRY X-Spamd-Bar: - --000000000000868f690628238e4c Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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. On Sat, Nov 30, 2024 at 8:04=E2=80=AFAM 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=3Den_US.UTF-8 > export LC_MESSAGES=3Den_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 > > --=20 Paul Beard / www.paulbeard.org/ --000000000000868f690628238e4c Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
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.=C2=A0
On= Sat, Nov 30, 2024 at 8:04=E2=80=AFAM D'Arcy Cain <darcy@druid.net> wrote:
= On 11/30/24 08:33, Per olof Ljungmark wrote:
> Hi,
>
> I am tasked with recovering hundreds or more files created with unknow= n
> OSs and have unknown characters in the name, replaced with a '?= 9;.
>
> Like file?nam?.???
>
> Please, if you have such a script can you post or email it? Replacing =
> the unknown character with anything, like '-' or '_' u= sing whatever
> shell, sh, bash or csh.
>

Perhaps you just need to set your terminal to UTF:

export LC_ALL=3Den_US.UTF-8
export LC_MESSAGES=3Den_US.UTF-8

--
D'Arcy J.M. Cain <darcy@druid.net>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0|=C2=A0 Democra= cy is three wolves
ht= tp://darcy.druid.net/=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 |=C2=A0 and a sheep voting on
+1 416 788 2246=C2=A0 =C2=A0 =C2=A0(DoD#0082)=C2=A0 =C2=A0 (eNTP)=C2=A0 =C2= =A0|=C2=A0 what's for dinner.
IM: darcy@VybeNetworks.com, VoIP: sip:darcy@druid.net



--
Paul Beard / www.paulbeard.org/
--000000000000868f690628238e4c--