New Bash function to sort a file in-place (almost)
Updated sortfile function to operate safely on temp files, and accept multiple arguments