Skip to main content

Rename collection of selected files...deleted all but one!

“change the file extension for the selected files from .jpg to .jpeg” and Confirm moved all files to the trash and left a single file with the correct new file extension.

The command it suggested (and which I Confirmed) was:

for FILE_NAME in $SPACE_SEPARATED_FILE_NAMES; do mv "$FILE_NAME" "${FILE_BASENAME}.jpeg"; done

…which looks like it should have worked.

I now have 779 image files in the trash (including the correctly renamed one) - all with the old .jpg extension - and a single lonely correctly named file in the original folder.

I’m thinking this might be a bug…

Status: Completed4 comments

Log in to comment and vote

Comments4

  • joethephish

    Team•

    Feb 6

    1. I’ve shipped “Substage Predicts” which would’ve made this worst case scenario clear if it was about to happen accidentally

    2. I’ve improved prompting significantly so that this should be less likely to be generated as a command by AI

  • Julian Daniel

    •

    Apr 23, 2025

    Hmmmmm…I AM running Google Drive backup on the folder I used. I wonder if that had anything to do with the file trashing…?

  • Julian Daniel

    •

    Apr 22, 2025

    GPT-4.1-mini

  • joethephish

    Team•

    Apr 22, 2025

    Eeesh that’s not good at all, sorry about this!

    Did you find the files in the trash then? I’m quite surprised, since that command doesn’t seem to mention trash at all.

    I have some ideas for how to improve the safety of the mv command, but I think the problem here is that it shouldn’t have explicitly written a for loop at all, since that’s supposed to be done by Substage itself.

    What AI model were you using?