- Returns the last name component of a path, what is left in the string that is not 'dirname'.
notes:
- The result of this filter is different from the Unix basename program; where basename for C(/foo/bar/) returns C(bar), the basename filter returns an empty string (C('')).
options:
_input:
description:A path.
@ -15,7 +17,7 @@ DOCUMENTATION:
plugin:ansible.builtin.dirname
EXAMPLES:|
# To get the last name of a file path, like 'foo.txt' out of '/etc/asdf/foo.txt'
# To get the last name of a file path, like 'foo.txt' out of '/etc/asdf/foo.txt'.
- Returns the 'head' component of a path, basically everything that is not the 'basename'.
notes:
- The result of this filter is different from the Unix dirname program; where dirname for C(/foo/bar/) returns C(/foo), the dirname filter returns the full path (C(/foo/bar/)).
options:
_input:
description:A path.
@ -15,7 +17,7 @@ DOCUMENTATION:
plugin_type:filter
EXAMPLES:|
# To get the dir name of a file path, like '/etc/asdf' out of '/etc/asdf/foo.txt'
# To get the dir name of a file path, like '/etc/asdf' out of '/etc/asdf/foo.txt'.