Date: Sat, 11 Feb 2023 13:00:09 -0500 From: Scott Ballantyne <boyvalue@gmail.com> To: Per olof Ljungmark <peo@nethead.se> Cc: questions@freebsd.org Subject: Re: remove double quote character from file names Message-ID: <CAESeg0w9u96AiGrvip8yTpaEMZyU93Fpx83-nwe1ysW586o--A@mail.gmail.com> In-Reply-To: <e752f769-b5a5-9763-448f-fe599a853553@nethead.se> References: <d83c93ad-0eac-d41a-c7db-79a1e1bc62d8@nethead.se> <CADqw_gK_3htmJZicOLLODS-MZJUTwV%2BfttBzVEqsP3KztDk10A@mail.gmail.com> <CAESeg0xnUiFnvRkRGnHAO5TKq-HMyygM0afTNZqHc7zrwV%2BFZQ@mail.gmail.com> <e752f769-b5a5-9763-448f-fe599a853553@nethead.se>
next in thread | previous in thread | raw e-mail | index | archive | help
--0000000000001cef6f05f470639e Content-Type: text/plain; charset="UTF-8" On Sat, Feb 11, 2023 at 11:43 AM Per olof Ljungmark <peo@nethead.se> wrote: > 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. You must have spaces in the filenames. You can deal with that using IFS. > > > --0000000000001cef6f05f470639e Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr"><div dir=3D"ltr"><div dir=3D"ltr" class=3D"gmail_signature= "><div dir=3D"ltr"><br></div></div></div><br><div class=3D"gmail_quote"><di= v dir=3D"ltr" class=3D"gmail_attr">On Sat, Feb 11, 2023 at 11:43 AM Per olo= f Ljungmark <<a href=3D"mailto:peo@nethead.se">peo@nethead.se</a>> wr= ote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px= 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 2/11/23 = 16:43, Scott Ballantyne wrote:<br> > <br> > Remove the first echo command to actually do any changes. Untested.<br= > > for f in $(find . -type f -name '*"*'); do echo mv $f $(e= cho $f | tr -d <br> > '"'); done<br> <br> Produced=C2=A0 "No such file or directory" errors.</blockquote><d= iv><br></div><div>You must have spaces in the filenames. You can deal with = that using IFS.</div><div><br></div><blockquote class=3D"gmail_quote" style= =3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding= -left:1ex">=C2=A0<br></blockquote><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> <br> </blockquote></div></div> --0000000000001cef6f05f470639e--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAESeg0w9u96AiGrvip8yTpaEMZyU93Fpx83-nwe1ysW586o--A>