#! /usr/bin/env bash

#- in order to save disc space, take files:
fileList="tair.labsea1979 qa.labsea1979 u10m.labsea1979 v10m.labsea1979 prate.labsea1979 flo.labsea1979 fsh.labsea1979 SSS_monthly.labsea1979"

#- from this dir:
fromDir="../../lab_sea/input"

#- 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
