From nobody Mon Feb 13 13:57:06 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 4PFm9j0W5jz3r6SL for ; Mon, 13 Feb 2023 13:57:13 +0000 (UTC) (envelope-from mike@sentex.net) Received: from smarthost1.sentex.ca (smarthost1.sentex.ca [IPv6:2607:f3e0:0:1::12]) (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 RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smarthost1.sentex.ca", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PFm9h2rbKz49G9 for ; Mon, 13 Feb 2023 13:57:12 +0000 (UTC) (envelope-from mike@sentex.net) Authentication-Results: mx1.freebsd.org; dkim=none; spf=pass (mx1.freebsd.org: domain of mike@sentex.net designates 2607:f3e0:0:1::12 as permitted sender) smtp.mailfrom=mike@sentex.net; dmarc=none Received: from pyroxene2a.sentex.ca (pyroxene19.sentex.ca [199.212.134.19]) by smarthost1.sentex.ca (8.16.1/8.16.1) with ESMTPS id 31DDv554080258 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=FAIL); Mon, 13 Feb 2023 08:57:05 -0500 (EST) (envelope-from mike@sentex.net) Received: from [IPV6:2607:f3e0:0:4:14f:1666:9353:81f8] ([IPv6:2607:f3e0:0:4:14f:1666:9353:81f8]) by pyroxene2a.sentex.ca (8.16.1/8.15.2) with ESMTPS id 31DDv5mm065099 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NO); Mon, 13 Feb 2023 08:57:05 -0500 (EST) (envelope-from mike@sentex.net) Message-ID: <2e9d1a3d-f826-6dd0-9992-25c7d990c666@sentex.net> Date: Mon, 13 Feb 2023 08:57:06 -0500 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 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.7.2 Subject: Re: remove double quote character from file names Content-Language: en-US To: Per olof Ljungmark , freebsd-questions@freebsd.org References: From: mike tancsa In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.84 X-Spamd-Result: default: False [-3.40 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-1.000]; R_SPF_ALLOW(-0.20)[+ip6:2607:f3e0::/32]; MIME_GOOD(-0.10)[text/plain]; RCVD_IN_DNSWL_LOW(-0.10)[199.212.134.19:received]; ASN(0.00)[asn:11647, ipnet:2607:f3e0::/32, country:CA]; MLMMJ_DEST(0.00)[freebsd-questions@freebsd.org]; MIME_TRACE(0.00)[0:+]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_ALL(0.00)[]; R_DKIM_NA(0.00)[]; RCPT_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; FREEFALL_USER(0.00)[mike]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; DMARC_NA(0.00)[sentex.net]; TO_DN_SOME(0.00)[]; ARC_NA(0.00)[] X-Rspamd-Queue-Id: 4PFm9h2rbKz49G9 X-Spamd-Bar: --- X-ThisMailContainsUnwantedMimeParts: N On 2/11/2023 9:58 AM, 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. > I know lots of a good suggestions already on this thread, but something to keep in mind for future considerations is the port sysutils/detox. Its very handy for situations like this and ones much more convoluted.     ---Mike