#!/bin/sh
ofile=''
archive=''
while getopts O:s: argname; do
    case ${argname} in
        O) ofile=${OPTARG} ;;
        s) archive=${OPTARG} ;;
        *) ;;
    esac
done
shift $((OPTIND-1))
if [ "$1" = "ls" -a "$2" = "-ld" ]; then
    if [ "$3" = "cosmo" ]; then
        echo 'lrwxrwxrwx    1 bweaver   bweaver           21 Aug 22  2014 cosmo@ -> /nersc/projects/cosmo' > ${ofile}
    elif [ "$3" = "/nersc/projects/cosmo" ]; then
        echo 'drwxrws---    6 nugent    cosmo            512 Dec 16  2016 cosmo' > ${ofile}
    elif [ "$3" = "test" ]; then
        echo 'drwxr-sr-x    3 bweaver   bweaver          512 Oct  4  2010 test' > ${ofile}
    elif [ "$3" = "desi/cosmos_nvo.tar" ]; then
        echo '-rw-rw----    1 bweaver   desi     29956061184 May 15  2014 cosmos_nvo.tar' > ${ofile}
    else
        echo "$@" > ${ofile}
    fi
else
    echo "$@" > ${ofile}
fi
