Skip to content

Instantly share code, notes, and snippets.

@TheDiscordian
Created July 21, 2024 17:47
Show Gist options
  • Save TheDiscordian/a0d0866dd57c331ba1ef7ce919e862fc to your computer and use it in GitHub Desktop.
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.
#!/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