issue #35 - convert root check logic from bash/ksh syntax