When using a Bash script to retrieve files that have spaces in their names from sftp, you can escape the spaces in the file names by adding a backslash () before each space.
For example, if the file you want to retrieve is named "file with spaces.txt", you would use the following command:
sftp username@server:/path/to/file\ with\ spaces.txt /local/path/
Alternatively, you can enclose the entire file name in quotes:
sftp username@server:"/path/to/file with spaces.txt" /local/path/
Both of these methods will retrieve the file with spaces in the name from sftp and save it to the specified local path.
Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss
Asked: 2023-05-12 13:57:25 +0000
Seen: 12 times
Last updated: May 12 '23
How can I transfer .avi video files to Unity?
How to access HTML files stored on Google Drive?
What is the process for opening e57 files in C#?
Why are the files I uploaded not visible on the Windows Android Emulator?
What is the process for utilizing environment variables in the package.json script through .env?
How can I install Beegfs on Ubuntu 22.04?
How can a .zip file from GitHub be loaded into Google Colab?