bash command for this code need help
-
Folder location /home/pi/RetroPie/roms
containsstreetf1.zip
ssfx2.zip
turbo2.zip
mgaman.zip
shnobi.zip
tkken.zip
donkey.zip
suprman.zipFolder location /opt/retropie/configs/all/emulationstation/downloaded_images/
contains filesstreetf1.zip
ssfx2.jpg
turbo2.jpg
mgaman.jpg
shnobi.jpg
tkken.jpgScan and compare both locations path and if the .zip has missing images then move the .zip files to new created folder in same path.
#!/bin/bash file1="/home/pi/RetroPie/roms" file2="/opt/retropie/configs/all/emulationstation/downloaded_images/" if cmp -s "$file1" "$file2"; then printf 'The file "%s" is the same as "%s"\n' "$file1" "$file2" #if title.zip and image.jpg title matches then ignore it else printf 'The file "%s" is different from "%s"\n' "$file1" "$file2" #if title.zip and image title not match then create a folder and move all .zip files with missing images. fi
this path /home/pi/RetroPie/roms contains alot of .zip so i need something to loop through both path and do the work.
-
@kok00 hmmm you compare a zipped rom file with a image file. Very interesting ...
You know this won't work.This would be better
https://github.com/meleu/share/blob/master/images-cleaner.sh -
it will work only compare the title and not extension?
-
@kok00
cmp
does not care of file names, it compares content
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.