Different behaviour on "ls" command
Hi to all of you.
I'm using WinSCP with script commands to list e get files from different FTP; simple-ones (in Unix/Linux
and also Windows server) and also SFTP.
I've found a different behaviour in ls command: the usual output of this command is like the following rows:
Searching for host...
Connecting to host...
Authenticating...
Using username "remotexxx".
Authenticating with pre-entered password.
Authenticated.
Starting the session...
Session started.
Active session: [1] remotexxx@sftp.xxx.com
failonnomatch off
confirm off
batch continue
reconnecttime 120
/wms/outbound
-r--r--r-- 0 user group 6394 May 11 11:55:00 2017 products_20170511095500_000001.csv
I've learned that to catch only the remote filenames I have to truncate the first 64 chars of the line; in the example above when the "product...*.csv" starts.
But in a Unix/Linux server I have to truncate the first 56 chars (9 less), because the output of ls command is like...
---------- 0 633344 May 16 7:00 XMOVIM-2017-05-16 06-00-42.xls
So... the lines from ls command, in different FTP-servers are different.
Here the 2 lines together...
-r--r--r-- 0 user group 6394 May 11 11:55:00 2017 products_20170511095500_000001.csv
---------- 0 633344 May 16 7:00 XMOVIM-2017-05-16 06-00-42.xls
I hope you undestood the problem.
Thanks
Bye
Rocco
I'm using WinSCP with script commands to list e get files from different FTP; simple-ones (in Unix/Linux
and also Windows server) and also SFTP.
I've found a different behaviour in ls command: the usual output of this command is like the following rows:
Searching for host...
Connecting to host...
Authenticating...
Using username "remotexxx".
Authenticating with pre-entered password.
Authenticated.
Starting the session...
Session started.
Active session: [1] remotexxx@sftp.xxx.com
failonnomatch off
confirm off
batch continue
reconnecttime 120
/wms/outbound
-r--r--r-- 0 user group 6394 May 11 11:55:00 2017 products_20170511095500_000001.csv
I've learned that to catch only the remote filenames I have to truncate the first 64 chars of the line; in the example above when the "product...*.csv" starts.
But in a Unix/Linux server I have to truncate the first 56 chars (9 less), because the output of ls command is like...
---------- 0 633344 May 16 7:00 XMOVIM-2017-05-16 06-00-42.xls
So... the lines from ls command, in different FTP-servers are different.
Here the 2 lines together...
-r--r--r-- 0 user group 6394 May 11 11:55:00 2017 products_20170511095500_000001.csv
---------- 0 633344 May 16 7:00 XMOVIM-2017-05-16 06-00-42.xls
I hope you undestood the problem.
Thanks
Bye
Rocco