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

Popular posts from this blog

c# - how to write client side events functions for the combobox items -

exception - Python, pyPdf OCR error: pyPdf.utils.PdfReadError: EOF marker not found -