Problem with LS command

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

I have batch files setup to move data to and from a server using SFTP.
My batch files run the SFTP command and use a script (sftp [-b
batchfile]) to pull or push the file and also issue an LS command
before or after to verify that the file was available or made it over
to the server. I capture this output to a log file to review in case of
problems. This process works fine.

The problem I am having is that the LS command returns such a long
listing. It is difficult to find the file. I have tried to limit the
output by sending the LS command in my script like this but I get the
error message below.

sftp> LS somefile.txt
Can't ls: "/dir1/dir2/somefile.txt" is not a directory

When I issue the same command interactively in an SFTP session the
command works fine. It just fails when run within a script.

Some background, I am using OpenSHH client on Windows and connecting to
a V-Shell server on Windows.

Any help would be greatly appreciated.

Site Timeline