#!/bin/sh #useage: sh testcase.sh -d /tmp/ -r file set -x while getopts dr: opt do echo "OPT: $opt"; # output: OPT: d done