Command Line not able to find files on remote server which include [ or ] in the filename

Advertisement

pault
Joined:
Posts:
2
Location:
Germany

Command Line not able to find files on remote server which include [ or ] in the filename

I was testing some of the scripting features of WinSCP and I noticed I'm unable to download any files that include [ or ].

I'm running WinSCP version 5.9.3 (Build 7136) but previously was using 5.7 with the same issue. I'm on Windows 10 and using SFTP.

Below is the output of two tests - same file just renamed the second time manually. I tried this repeatedly, including double quotes, the full path, etc and it will always return a "No file matching XXX found" error. I should note, if you try and download using wildcards preceding the [ or ], it is able to successfully download it (i.e. "get TVShow.S02E02.720p.HDTV.x264-FLEET*" will work)

C:\Program Files (x86)\WinSCP>winscp.com
winscp> open sftp://username:password@host.com/path/to/files/
Searching for host...
Connecting to host...
Authenticating...
Using username "username".
Authenticating with pre-entered password.
Authenticated.
Starting the session...
Session started.
Active session: [1] username@host.com
winscp> dir
-rw-rw----   1 username    username    1111708992 Feb  6 21:15:41 2017 TVShow.S02E01.720p.HDTV.x264-SVA[eztv].mkv
-rw-rw----   1 username    username    1012275713 Feb  6 21:16:05 2017 TVShow.S02E02.720p.HDTV.x264-FLEET[eztv].mkv
winscp>
winscp> get TVShow.S02E02.720p.HDTV.x264-FLEET[eztv].mkv
No file matching 'TVShow.S02E02.720p.HDTV.x264-FLEET[eztv].mkv' found.
winscp> exit

C:\Program Files (x86)\WinSCP>



C:\Program Files (x86)\WinSCP>winscp.com
winscp> open sftp://username:password@host.com/path/to/files/
Searching for host...
Connecting to host...
Authenticating...
Using username "username".
Authenticating with pre-entered password.
Authenticated.
Starting the session...
Session started.
Active session: [1] username@host.com
winscp> dir
-rw-rw----   1 username    username    1111708992 Feb  6 21:15:41 2017 TVShow.S02E01.720p.HDTV.x264-SVA.eztv.mkv
-rw-rw----   1 username    username    1012275713 Feb  6 21:16:05 2017 TVShow.S02E02.720p.HDTV.x264-FLEET[eztv].mkv
winscp>
winscp> get TVShow.S02E01.720p.HDTV.x264-SVA.eztv.mkv C:\Incoming\
TVShow.S02E01.720p.HDTV.x |        7804 KB | 1348.1 KB/s | binary |   0%
Terminated by user.
winscp>

Reply with quote

Advertisement

Advertisement

You can post new topics in this forum