Re: remove double quote character from file names

From: Scott Ballantyne <boyvalue_at_gmail.com>
Date: Sat, 11 Feb 2023 18:46:46 UTC
Script started on Sat Feb 11 13:17:38 2023
$ touch \"f\"o\"o
$ touch \"bar\"
$ touch \"f\ o\ o\"
$ ls
"bar"           "f o o"         "f"o"o          typescript
$ for f in $(find . -type f -name '*"*'); do  mv $f $(echo $f | tr -d '"');
done
mv: rename ./"f to ./f: No such file or directory
mv: rename o to o: No such file or directory
mv: rename o" to o: No such file or directory
$ S="$IFS"
$ IFS="\n"
$ for f in $(find . -type f -name '*"*'); do mv $f $(echo $f | tr -d '"');
done
$ ls
bar             f o o           foo             typescript
$ IFS="$S"
$ exit
Script done on Sat Feb 11 13:21:41 2023

On Sat, Feb 11, 2023 at 1:00 PM Scott Ballantyne <boyvalue@gmail.com> wrote:

>
>
> 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.
>
>
>>
>
>>
>>