Date: Sat, 11 Feb 2023 17:43:07 +0100 From: Per olof Ljungmark <peo@nethead.se> To: questions@freebsd.org Subject: Re: remove double quote character from file names Message-ID: <e752f769-b5a5-9763-448f-fe599a853553@nethead.se> In-Reply-To: <CAESeg0xnUiFnvRkRGnHAO5TKq-HMyygM0afTNZqHc7zrwV%2BFZQ@mail.gmail.com> References: <d83c93ad-0eac-d41a-c7db-79a1e1bc62d8@nethead.se> <CADqw_gK_3htmJZicOLLODS-MZJUTwV%2BfttBzVEqsP3KztDk10A@mail.gmail.com> <CAESeg0xnUiFnvRkRGnHAO5TKq-HMyygM0afTNZqHc7zrwV%2BFZQ@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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
> <michaelsprivate@gmail.com <mailto:michaelsprivate@gmail.com>> wrote:
>
>
>
> On Sat, Feb 11, 2023, 15:59 Per olof Ljungmark <peo@nethead.se
> <mailto:peo@nethead.se>> 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
>
>
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?e752f769-b5a5-9763-448f-fe599a853553>
