Considering the following input and output:
infile | outfile
1 3 5 2 4 | 1 2 3 4 5
2 4 5 | 2 4 5
4 6 2 1 | 1 2 4 6
Is there a
The question is more subtle than it seems. You appear to be asking whether there is a quicker way to perform the sort, and you are getting a lot of (elegant!) answers with Perl and awk and so on. But your question seems to be whether you can do a quicker sort with shell built-ins, and for that, the answer is no.
Obviously, sort is not a shell built-in, and neither is tr. There isn't a built-in that does what sort does, and the built-ins that might substitute for "tr" are not likely to help you here (it would take as much work to manipulate, say, bash's IFS variable to remove the call to tr as to just live with the tr).
Personally, I would go with Perl. Note that if your data set is large or funky, you have the option of changing Perls default sorting algorithm using the sort pragma. I don;t think you will need it for sorting a file of integers, but maybe that was just an illustration on your part.