Date: Sat, 11 Feb 2023 10:43:47 -0500 From: Scott Ballantyne <boyvalue@gmail.com> To: Michael Schuster <michaelsprivate@gmail.com> Cc: Per olof Ljungmark <peo@nethead.se>, freeBSD Mailing List <freebsd-questions@freebsd.org> Subject: Re: remove double quote character from file names Message-ID: <CAESeg0xnUiFnvRkRGnHAO5TKq-HMyygM0afTNZqHc7zrwV%2BFZQ@mail.gmail.com> In-Reply-To: <CADqw_gK_3htmJZicOLLODS-MZJUTwV%2BfttBzVEqsP3KztDk10A@mail.gmail.com> References: <d83c93ad-0eac-d41a-c7db-79a1e1bc62d8@nethead.se> <CADqw_gK_3htmJZicOLLODS-MZJUTwV%2BfttBzVEqsP3KztDk10A@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
--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 <michaelsprivate@gmail.com> wrote: > > > On Sat, Feb 11, 2023, 15:59 Per olof Ljungmark <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 >> >> >> --00000000000063dc5805f46e7b15 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr"><br clear=3D"all"><div><div dir=3D"ltr" class=3D"gmail_sig= nature" data-smartmail=3D"gmail_signature"><div dir=3D"ltr"><div>Remove the= first echo command to actually do any changes. Untested.</div><div>=C2=A0<= /div><div>for f in $(find . -type f -name '*"*'); do echo mv $= f $(echo $f | tr -d '"'); done<br></div></div></div></div><br>= </div><br><div class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr">= On Sat, Feb 11, 2023 at 10:23 AM Michael Schuster <<a href=3D"mailto:mic= haelsprivate@gmail.com">michaelsprivate@gmail.com</a>> wrote:<br></div><= 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"><div dir=3D"auto"><div dir= =3D"auto"><br></div><br><div class=3D"gmail_quote" dir=3D"auto"><div dir=3D= "ltr" class=3D"gmail_attr">On Sat, Feb 11, 2023, 15:59 Per olof Ljungmark &= lt;<a href=3D"mailto:peo@nethead.se" target=3D"_blank">peo@nethead.se</a>&g= t; wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0p= x 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi all= ,<br> <br> A little help on the way, I need to find and remove the double quote ("= ;) <br> character from all files in a directory structure containing hundreds of <b= r> thousands of files.<br> <br> I am sure plenty of you have done this before... I've gotten as far as<= br> <br> find . -type f -name '*"*' -exec rename 's|"|in|g'= ; {} \;<br> find: rename: No such file or directory<br> <br> The find part works but not renaming so I'm missing something there.<br= ></blockquote></div><div dir=3D"auto"><br></div><div dir=3D"auto">The usual= utility to rename a file is "mv" (no quotes :-))=C2=A0</div><div= dir=3D"auto"><br></div><div dir=3D"auto">Does that help?=C2=A0</div><div c= lass=3D"gmail_quote" dir=3D"auto"><blockquote class=3D"gmail_quote" style= =3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding= -left:1ex"> <br> Thanks,<br> Per<br> <br> <br> </blockquote></div></div> </blockquote></div> --00000000000063dc5805f46e7b15--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAESeg0xnUiFnvRkRGnHAO5TKq-HMyygM0afTNZqHc7zrwV%2BFZQ>