#!/bin/sh if getopts x o; then opt=-$o shift else opt="" fi if ! [[ -d $1 ]]; then printf '%s\n' >&2 "supply directory argument (got '$1')" exit 2 fi cd "$1" || exit $? shift if [[ -n "$opt" ]]; then fileset "$@" | ${FILESET_SHELL:-sh} $opt else fileset "$@" | ${FILESET_SHELL:-sh} fi