If PATHNAME is a subdirectory or file under BASEDIR: print to stdout the subpathname portion. Example:
mbfl_file_subpathname /a/b/c /a -> ./b/c
Both PATHNAME and BASEDIR must be full (normalised) pathnames for this function to work. If PATHNAME is recognised as subpathname of BASEDIR: the return code is zero; else the return code is one.
The function variant _var
stores the result in the variable _RV, rather than print it;
Result variables.
mbfl_file_subpathname /a /a -| ./ mbfl_file_subpathname /a/b/c /a/ -| ./b/c mbfl_file_subpathname /a/b/c /a -| ./b/c mbfl_file_subpathname /a/b/c /d error→ no match local _RV mbfl_file_subpathname_var _RV /a/b/c /a "$_RV" ⇒ ./b/c
Return true if the first character in PATHNAME is a slash (/
); else return false.
Return true if PATHNAME is a directory according to mbfl_file_is_directory()
and an
absolute pathname according to mbfl_file_is_absolute()
.
Return true if PATHNAME is a file according to mbfl_file_is_file()
and an absolute
pathname according to mbfl_file_is_absolute()
.
Return true if the first character in PATHNAME is not a slash (/
); else return
false.
Return true if PATHNAME is a directory according to mbfl_file_is_directory()
and an
relative pathname according to mbfl_file_is_relative()
.
Return true if PATHNAME is a file according to mbfl_file_is_file()
and an relative
pathname according to mbfl_file_is_relative()
.
This document describes version 3.0.0-devel.9 of Marcos Bash Functions Library.