1) I run SSH session on the remote client to get files from the server.
2) There is a server and it keeps a very broad directory structure.
3) I've got a list of thousands path-names to the files on the server. Yet they are only a small fracture of the whole content of the server. So, the files are to be fetched one-by-one, not by directories, no wild cards.
Task: get all files by the list and place them on the client machine with all the relative paths created on the client.
The problem I've encountered is that the sftp cannot write a file in the non-existed dir:
get -p /q/w/e/r/t/y/file /base/q/w/e/r/t/y/file
does not create all the sequence of q/w/e/r/t/y/ in the /base/ (not even the 1-st subdirectory)
Note: the solution may be for a single file too. I'll try to make batch after it.
Not important note: actually, I don't need those paths - but there may be files with the same names and they should not conflict on the new place. So the idea of draining all files in one plain directory is not acceptable.