#! /usr/bin/env bash

#- In order to save disc space, take binary input files
#- from this dir:
fromDir="../input.natl_box"

fileList=`( cd $fromDir ; echo kf_* POLY3.COEFFS data.kpp )`

#echo 'fileList=' $fileList

#- and do a symbolic link in the current directory
#   (if the file does not already exist)
if test -d $fromDir ; then
  lnkList='files:'
  for xx in $fileList
  do
    if test -r ${fromDir}/$xx ; then
      if test ! -r $xx ; then
        lnkList=${lnkList}" "$xx
        ln -sf ${fromDir}/$xx .
      fi
    fi
  done
  echo ' link' $lnkList "from dir:" $fromDir
else
  echo " Error:" $fromDir "not a directory"
fi
