-
Notifications
You must be signed in to change notification settings - Fork 120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
convmv error #871
Comments
Hi, |
I'm using a-Shell in Apple Vision Pro, and there's no error message. This caused confusion until I found out that it does not actually work. My latest shell script using convmv is as below: #!/usr/bin/env sh
convmv -f utf8 -t utf-8-strict --nfc --notest --exec "mv #1 #2.convmv" ./*.*
# Loop through all files with the *.convmv pattern
for file in *.*.convmv; do
# Check if the file exists to avoid errors
if [ -e "$file" ]; then
# Create the new filename by removing the .convmv part
new_name="${file%.convmv}"
# Rename the file
mv "$file" "$new_name"
echo "Renamed: $new_name"
fi
done |
I'm sorry, but you need to walk me through the steps more slowly, and with greater details. I don't currently understand enough to see what your problem is. Your first message mentionned an issue with the (Also, when you're posting shell scripts in your answer, it's easier to understand if you enclose them within "```sh" (shell script) "```" . It will prevent the sh comments ( |
I believe that convmv with —replace option tries to rename the original file into newly encoded file name, but a-Shell seems to interpret the two names are identical. An example of the convmv command is the 2nd line of the shell script above, except that it uses —exec option instead of —replace option, and the remaining part of the shell script is a solution that I’ve found: using —exec option instead of —replace and rename the original file into newly encoded file name plus additional extension ‘.convmv’ My issues are thus solved with this shell script, but please aware that a-Shell does not differentiate the original file name and the newly encoded file name, unlike as in standard macOS or linux terminal. |
Thank you for the explanations, I understand better now. I'm still trying to reproduce the issue (in order to, maybe, fix it). Could you provide me with an example of a file name where Just to be clear, the command you want to run is: convmv -f utf8 -t utf-8-strict --nfc --notest --replace <filename> and there were no error messages at all? |
Below is a file name that I’ve downloaded from Youtube into my local storage and renamed with Files app: 2024년 외국 영화 Top 10 [Qbu2jjEoo7g].webm |
Apology. I’ve just tried the command with —replace option again, and there is indeed the error message which is the same as you and the file are just deleted. |
Thank you for all the help and explanations. I was able to reproduce your problem:
Since calls to the Perl functions Short version: iOS internal system calls tend to convert non-strict-UTF8 characters in file names into their strict UTF8 version, which affects the behaviour of several functions ( |
convmv error
Hi. convmv is a perl script which can be found at:
https://github.com/skangas/home-bin/blob/master/convmv
This is a file renaming tool and at first it seemed to work fine in a-Shell, but I noticed that --replace option does not actually work.
The best solution for now that I found is to use --exec "pbcopy mv #1 #2.new" option instead of using --replace and manually run the command which is copied to the clipboard. FYI, --exec "pbcopy mv #1 #2" did not work because mv command did not recognize the difference of the two file names.
Now I'm wondering if you can look into the perl code and identify what causes the problem in a-Shell.
For your convenience, please find below a part of the entire code:
The text was updated successfully, but these errors were encountered: