#!/bin/bash # Base directory base_dir=lip/GRID_lips # Loop through each speaker directory for i in {1..34} do # Format the speaker directory, ensuring it is in the form s1, s2, ..., s34 speaker_dir=$(printf "s%d" $i) # Source and destination paths src="$base_dir/$speaker_dir/video/mpg_6000/*" dest="$base_dir/$speaker_dir/" vid_dir="$base_dir/$speaker_dir/video" mpg_dir="$vid_dir/mpg_6000" # Move the files and folders from source to destination mv $src $dest rmdir $mpg_dir rmdir $vid_dir # Echo the action echo "Moved files from $src to $dest" done echo "All files moved successfully."