#!/bin/bash

# Iterate over every subdirectory of the current directory
for d in */ ; do
  # Skip if not a directory
  [ -d "$d" ] || continue

  # Path to the directory to rename
  src="$d/hist.1850_2100"
  dst="$d/hist.1850_2005"

  if [ -d "$src" ]; then
    echo "Renaming in $d: hist.1850_2100 -> hist.1850_2005"
    mv "$src" "$dst"
  else
    echo "No hist.1850_2100 in $d, skipping."
  fi
done
