Created
July 21, 2024 17:47
-
-
Save TheDiscordian/a0d0866dd57c331ba1ef7ce919e862fc to your computer and use it in GitHub Desktop.
Simple script I used to copy files in a list from one directory to another.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Check if the correct number of arguments is passed | |
if [ "$#" -ne 1 ]; then | |
echo "Usage: $0 <roms_list_file>" | |
exit 1 | |
fi | |
roms_list_file=$1 | |
destination_directory="arcade_filtered" | |
# Create the destination directory if it does not exist | |
mkdir -p "$destination_directory" | |
# Read the roms list file and copy each corresponding zip file | |
while IFS= read -r rom; do | |
cp "arcade/$rom.zip" "$destination_directory" | |
done < "$roms_list_file" | |
echo "Copying completed." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment