remove \n in sed,remove ending \ in folder variable