fix up the scripts and test on linux

(cherry picked from commit bf60c8abdeb5154dcabe54f5843fb46c20bf380c)