0

Both show the sorted file without changing the original file, so what is the difference?

1 Answers1

1

The differences are:

With

sort < filename

the parent shell opens filename, and connects it to sort's STDIN I/O stream. sort runs, sees no command line filenames, and simply reads STDIN and sorts.

With

sort filename

sort notices a command line parameter, opens filename, and sorts.

waltinator
  • 4,865