fix bug

1.fix same olddir bug
2.tuncate history file
3.export os name