linux - Distinguish directory name or path to the directory -
i have shell script takes directory-name or path directory command-line, , create directory. if want identify argument valid path or directory-name, how can achieve this? if directory-name passed directory created in location script being executed, , if path directory created on path. distinction necessary script.
thanks , regards.
dir=$(dirname -- "$1") if test "$dir" != '.'; echo 'path' else echo 'directory' fi
Comments
Post a Comment