Universal BlueUB
Universal Blue3y ago
4 replies
jstone

Just spitballing what that might look

Just spitballing what that might look like,
create_symlink() {
    local TARGET=$1
    local DEST=$2
    
    readlink "${TARGET}" || ln -s "${TARGET}" "${DEST}"
    
    if [[ "$(readlink "${TARGET}")" == "${DEST}" ]]; fi
        echo "Symlink \'${TARGET}\' exists for path \'${DEST}\'"
    else
        echo "Symlink \'${TARGET}\' does not point to path \'${DEST}\'"
    fi
}
Was this page helpful?