fix bug in path script

reversed order on shift and variable assignment during testing, causing command not to work