From nobody Sat Feb 11 16:43:07 2023 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 4PDby84FLsz3pM4v for ; Sat, 11 Feb 2023 16:43:12 +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) client-signature ECDSA (P-384)) (Client CN "ns1.nethead.se", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PDby76HGWz4Dnf for ; Sat, 11 Feb 2023 16:43:11 +0000 (UTC) (envelope-from peo@nethead.se) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=nethead.se header.s=NETHEADSE header.b=yICLm0jV; 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=1676133789; bh=UoraNgx8tFSezdI9lG4c0fa5aWZTsw4kjU6Gi4HZwGA=; h=Date:Subject:To:References:From:In-Reply-To; b=yICLm0jV6KRZm6WRBGciQbWEG8qGRQIZ3tYQmY7zgZViloD5YpQwLoyRNqp3cv6ez hGLUvkgIR4epcukQz3nT9ITscU5T0/ZIfuPLtJ2JfpbxjpwS8gE8Jisfo/favoCV7+ C+7tziMPWphMFYAEWA1y3Jaa3UkAzKvUSlqkv3Mg= Message-ID: Date: Sat, 11 Feb 2023 17:43:07 +0100 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 (X11; FreeBSD amd64; rv:102.0) Gecko/20100101 Thunderbird/102.5.1 Subject: Re: remove double quote character from file names Content-Language: en-US To: questions@freebsd.org References: From: Per olof Ljungmark In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spamd-Result: default: False [-3.99 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.99)[-0.993]; DMARC_POLICY_ALLOW(-0.50)[nethead.se,none]; R_SPF_ALLOW(-0.20)[+ip4:5.150.237.139:c]; R_DKIM_ALLOW(-0.20)[nethead.se:s=NETHEADSE]; MIME_GOOD(-0.10)[text/plain]; MLMMJ_DEST(0.00)[questions@freebsd.org]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_ZERO(0.00)[0]; ARC_NA(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; ASN(0.00)[asn:8473, ipnet:5.150.192.0/18, country:SE]; FROM_HAS_DN(0.00)[]; DKIM_TRACE(0.00)[nethead.se:+]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TO_DN_NONE(0.00)[]; MID_RHS_MATCH_FROM(0.00)[] X-Rspamd-Queue-Id: 4PDby76HGWz4Dnf X-Spamd-Bar: --- X-ThisMailContainsUnwantedMimeParts: N On 2/11/23 16:43, Scott Ballantyne wrote: > > 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 Produced "No such file or directory" errors. > 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 > >