A process for preparing compounds of the formula I ##STR1## wherein either (i) each of R.sub.1 and R.sub.2 independently represents H or an organic group, or (ii) NR.sub.1 R.sub.2 is a heterocyclic ring or (iii) R.sub.2 is H and R.sub.1 is ##STR2## wherein each of R.sub.6 and R.sub.7 independently represents H or an organic group, m is 1 or 2, n is 0-3, X is O, S, NH, NR.sub.8, CHNO.sub.2 or CHSO.sub.2 R.sub.4 wherein R.sub.8 and R.sub.4 are organic groups and R.sub.3 represents an organic group is characterized by the following reaction sequence: ##STR3## There are also provided new compounds of the formula I wherein n is 0 and m is 2 and pharmaceutical compositions containing them. These compounds and their pharmaceutically acceptable acid addition salts are active as anti-ulcer agents.