From nobody Sat Feb 11 15:43:47 2023 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 4PDZdp2SGLz3pDlf for ; Sat, 11 Feb 2023 15:43:58 +0000 (UTC) (envelope-from boyvalue@gmail.com) Received: from mail-qv1-xf30.google.com (mail-qv1-xf30.google.com [IPv6:2607:f8b0:4864:20::f30]) (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 "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PDZdp0pYLz41H6 for ; Sat, 11 Feb 2023 15:43:58 +0000 (UTC) (envelope-from boyvalue@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-qv1-xf30.google.com with SMTP id d13so5566344qvj.8 for ; Sat, 11 Feb 2023 07:43:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=FzPqhqu3l1XUSoIX5fM/+IqNhfgC7N1xm1lKrW2pjrs=; b=PWCSPoKFrGz5ZfrrgwBFQn2nK8WxMKyPGirDHBRPoKUyIwVS9DA5ViqE5FKrs/gwoU VTgwj7aCpxJdm6BzDN4MSdnEmCtNtoTQfQcs3HB/UWTpBi7EtDK+uaL+E172jGp/FlGC Akve9ANeQrb8Cs7hy4+6xbHXDkoBQZ6TJeyt5dXjZ20UEPJT+PeIaJd1BTYUaBbv/6WS Qk27V5jmYDnQS5UWcc/1xe5jhOgWQCuZvv3RtBcrnX2otJhhakGeLUesrF16IKHYeSYz UVMcDcaBIBc3q3KNay6LPvTcv6BrLJQQXVJTBQW4j5yoogg7wRx/WuVU+R+bs1HbsIg6 CMpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to: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=FzPqhqu3l1XUSoIX5fM/+IqNhfgC7N1xm1lKrW2pjrs=; b=2NRWfDpLKQUSWOKQqdAatbkk81xT9hifNPXQ4ys5mQNXjI0xNWQsXSsbb2Rkc8bEvv VN3AcQxGIubdcpuRQdyfBd4VrQ6r7FoUf7RkRZrEGVTQ9hb0kDhPxExJxIvAwbGrLPVq EtGjVg0f3WPtbvCLM1wikDU4aUQkN1BdiOyvOtFLtsUq0aPOS1xZHpXVn+BZA2YMZags DwdDXnZZSzIxATEeLFyMX0N2ojAEni0TmuHuyEasAKKXmd5+BXe2HHLiUjRAE2FYuk6h RoMTh+HIifbWTWQFAZhmL4nvMGIn8/k2eCbdM7XKOqzmey7b3YnfGjjsmjNfio7siLSZ 26fw== X-Gm-Message-State: AO0yUKWB6AMRhk1UtcQMO23kSu4GlQhLivm7hJGL+g3iJQ8/OC3Tjx0s 6iB2bcbjgVP9AQZxLB7pfWlLtEhN+Fvo7YubY0kRR1jTKg== X-Google-Smtp-Source: AK7set/WdHeUJ6o86eESiRyJOp9Yty4yfKfgbYnrrPkrpuA+Hcc/XS44gtwzKhdT2CqY6xj7s++Nxw/C4eNmnfRN93A= X-Received: by 2002:a0c:ac0f:0:b0:56b:ec94:3230 with SMTP id l15-20020a0cac0f000000b0056bec943230mr1502529qvb.40.1676130237273; Sat, 11 Feb 2023 07:43:57 -0800 (PST) List-Id: User questions List-Archive: https://lists.freebsd.org/archives/freebsd-questions List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-questions@freebsd.org X-BeenThere: freebsd-questions@freebsd.org MIME-Version: 1.0 References: In-Reply-To: From: Scott Ballantyne Date: Sat, 11 Feb 2023 10:43:47 -0500 Message-ID: Subject: Re: remove double quote character from file names To: Michael Schuster Cc: Per olof Ljungmark , freeBSD Mailing List Content-Type: multipart/alternative; boundary="00000000000063dc5805f46e7b15" X-Rspamd-Queue-Id: 4PDZdp0pYLz41H6 X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N --00000000000063dc5805f46e7b15 Content-Type: text/plain; charset="UTF-8" Remove the first echo command to actually do any changes. Untested. for f in $(find . -type f -name '*"*'); do echo mv $f $(echo $f | tr -d '"'); done On Sat, Feb 11, 2023 at 10:23 AM Michael Schuster wrote: > > > On Sat, Feb 11, 2023, 15:59 Per olof Ljungmark wrote: > >> Hi all, >> >> A little help on the way, I need to find and remove the double quote (") >> character from all files in a directory structure containing hundreds of >> thousands of files. >> >> I am sure plenty of you have done this before... I've gotten as far as >> >> find . -type f -name '*"*' -exec rename 's|"|in|g' {} \; >> find: rename: No such file or directory >> >> The find part works but not renaming so I'm missing something there. >> > > The usual utility to rename a file is "mv" (no quotes :-)) > > Does that help? > >> >> Thanks, >> Per >> >> >> --00000000000063dc5805f46e7b15 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Remove the= first echo command to actually do any changes. Untested.
=C2=A0<= /div>
for f in $(find . -type f -name '*"*'); do echo mv $= f $(echo $f | tr -d '"'); done

=

= On Sat, Feb 11, 2023 at 10:23 AM Michael Schuster <michaelsprivate@gmail.com> wrote:
<= blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-l= eft:1px solid rgb(204,204,204);padding-left:1ex">


On Sat, Feb 11, 2023, 15:59 Per olof Ljungmark &= lt;peo@nethead.se&g= t; wrote:
Hi all= ,

A little help on the way, I need to find and remove the double quote ("= ;)
character from all files in a directory structure containing hundreds of thousands of files.

I am sure plenty of you have done this before... I've gotten as far as<= br>
find . -type f -name '*"*' -exec rename 's|"|in|g'= ; {} \;
find: rename: No such file or directory

The find part works but not renaming so I'm missing something there.

The usual= utility to rename a file is "mv" (no quotes :-))=C2=A0

Does that help?=C2=A0

Thanks,
Per


--00000000000063dc5805f46e7b15--