from typing import Union
from pathlib import Path


def basename_sh_util(path: Union[Path, str]) -> str:
    """
    clone of unix's "basename"
    grab a complete path and return only the name of the file (last / forward)
    """
    path_string: str = str(path)  # turn possible Path type into str type

    # if no /, return it as it is
    if path_string.find('/') == -1:
        return path_string
    else:
        return path_string.rpartition('/')[2]