bin script, write to file