first, very rough, basic solution with bash :)