The condensation of octylamine (I) with 4-bromopyridine by heating at 180 C gives (4-octylamino)piridine (III), which is then allowed to react with 1,10-dichlorodecane by heating 120-80 C.