I'm using a programming language that, inexplicably, doesn't have a "sort" command built in. However, it does let me send commands to the shell and get the output. So my idea is that I could send my data to the sort command in the Unix shell, and get back the sorted output.
But I don't know the syntax to feed it my data. I know how to use sort if the data is a file, and how to type in data to be sorted manually in the shell (type a bunch of lines and then CTRL-D to end the input), but I'm not sure how to pass data from a program. I couldn't find anything in the search engines about this.
Maybe I need to send a CTRL-D from my program as the final character of the data I'm sending? I'd be willing to try, but I don't know how to generate a CTRL-D as text that I could send....