Hacker News new | past | comments | ask | show | jobs | submit login

Python (assuming that the last line ends with a newline):

  import sys
  open(sys.argv[2], "w").writelines(sorted(open(sys.argv[1])))



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: