psdlag-agn/scripts/fix_swapped_names.sh

13 lines
565 B
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/usr/bin/env bash
for analysis in analyses/*
do
# Grab and determine labels of analyses
ref_band=$(basename $analysis|sed 's|[^≻]*_≻_\([^≻_]*\)_[^_]*_[^_]*|\1|')
echo_band=$(basename $analysis|sed 's|\([^≻]*\)_≻_[^≻_]*_[^_]*_[^_]*|\1|')
timestep_str=$(basename $analysis|sed 's|[^≻]*_≻_[^≻_]*_\([^_]*\)_σ∊[CLM][MFC]|\1|')
err_str=$(basename $analysis|sed 's|[^≻]*_≻_[^≻_]*_[^_]*_\(σ∊[CLM][MFC]\)|\1|')
newname="${ref_band}_≺_${echo_band}_${timestep_str}_${err_str}"
mv $analysis analyses/$newname
done