#!/bin/bash

ROOT=$1

LINKS=`find ${ROOT} -type l`

for link in ${LINKS}; do
  if [ -d ${link} ]; then
    echo "dir: ${link}"
    mv ${link} ${link}.sym
    mkdir ${link}
    cp -LcdpR ${link}.sym/* ${link}/
  elif [ -f ${link} ]; then
    echo "file: ${link}"
    mv ${link} ${link}.sym
    cp -Lcp ${link}.sym ${link}
  else
    echo "unknown: ${link}"
  fi
done
 
repl_links.sh                            21,0-1      All
"repl_links.sh" 21L, 367C