You really should keep follow-up questions in the same thread as the original. Start a new thread when you have a completely new topic to discuss.
I just posted a reply in your last thread about this:
Also, please use [code][/code]
tags around your code, to preserve formatting and to improve readability. Thanks.
Anyway, another trick is to use the read built-in.
read file < <( ls 1S )
The above code uses bash's process substitution
. It would have to be modified for other shells.
Note also that this assumes that the filename you want sits on the first line. As the link I gave in the other thread points out, newlines are legal characters in *nix file names, so it is possible for it to only grab a partial file name. The technique I posted before doesn't have that problem.