s4/scripting/ktpass: make shell code portable and eliminate another bash requirement