Generates a unix command line for creating a directory.

    :param path: Directory path.
    :type path: unicode | str
    :param create_parent: Create parent directories, if necessary. Default is ``True``.
    :type create_parent: bool
    :param check_if_exists: Prepend a check if the directory exists; in that case, the command is not run.
      Default is ``False``.
    :type check_if_exists: bool
    :return: Unix shell command line.
    :rtype: unicode | str

def mkdir(path, create_parent=True, check_if_exists=False):
    """
    Generates a unix command line for creating a directory.

    :param path: Directory path.
    :type path: unicode | str
    :param create_parent: Create parent directories, if necessary. Default is ``True``.
    :type create_parent: bool
    :param check_if_exists: Prepend a check if the directory exists; in that case, the command is not run.
      Default is ``False``.
    :type check_if_exists: bool
    :return: Unix shell command line.
    :rtype: unicode | str
    """
    cmd = _format_cmd('mkdir', path, _p=create_parent)
    if check_if_exists:
        return 'if [[ ! -d {0} ]]; then {1}; fi'.format(path, cmd)
    return cmd