Preparation of compounds containing amino and hydroxy, amino and etherified hydroxy or amino and esterified hydroxy groups bound to the same carbon skeleton