File size: 453 Bytes
3a3c68a |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
#!/bin/bash
# Check if a base directory was provided as an argument
if [ "$#" -gt 1 ]; then
echo "Usage: $0 <base_directory>"
exit 1
elif [ "$#" -eq 1 ]; then
BASE_DIR="$1"
else
BASE_DIR="GRID-dataset"
fi
# Loop from s1 to s34
for i in {1..34}; do
# Check if the directory exists before attempting to move files
if [[ -d "${BASE_DIR}/s${i}/s${i}" ]]; then
mv "${BASE_DIR}/s${i}/s${i}"/* "${BASE_DIR}/s${i}/"
fi
done |