util.c: add get_realpath() and use it in calc_batch mode