ask_derectory(){
if [ $# -ge 2 ]; then
_MSG=$2
else
_MSG="Input Directory"
fi
if [ $1 -eq 1 ]; then
echo -n "$)_MSG (Blank is Cancel.) : "
elif [ $1 -eq 2 ]; then
echo -n "$_MSG[$HOME] : "
else
echo -n "$_MSG : "
fi
while read _DIRNAME; do
if [ ! "$_DIRNAME" ]; then
if [ $1 -eq 1 ]; then
echo "*** Canceled."
return 1
elif [ $1 -eq 2 ]; then
_DIRNAME=$HOME
return 0
fi
elif [ -d "$_DIRNAME" ]; then
return 0
fi
echo -n "Input Directory : "
done
}
$ . f_askdircrt.sh
$ ask_directory_create 0 abc 1
abc :
$ ask_directory_create 1
Input Directory(Blank is Cancel) :