Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

curl manpage says -Q '*... works for FTP. It seems to also work for SFTP. Is this intentional? #4017

Closed
Ben-Voris opened this issue Jun 12, 2019 · 1 comment

Comments

@Ben-Voris
Copy link

I did this

https://curl.haxx.se/docs/manpage.html says that -Q will abort if a command fails. Later, it says "When speaking to an FTP server, prefix the command with an asterisk (*) to make curl continue even if the command fails as by default curl will stop at first failure." For my use case, an asterisk does the same using SFTP and it does for FTP.

For reasons I won't go into, I must remove a file before transferring a new file, so, my command looks like this:

curl -s -T file1 sftp://user@host/tmp/file1 -Q '*rm /tmp/file1'

If /tmp/file1 does not exist, I can see the attempted unlink and that the transfer is done.

I expected the following

I hope that this is not an accident and that it is intentional that -Q '*... means the same for SFTP as it does for FTP. In other words, can I depend that putting a * in front of rm will ignore any error.

curl/libcurl version

curl 7.64.1 (x86_64-pc-cygwin) libcurl/7.64.1 OpenSSL/1.1.1b zlib/1.2.11 libidn2/2.0.4 libpsl/0.18.0 (+libidn2/2.0.2) libssh/0.8.7/openssl/zlib nghttp2/1.37.0
Release-Date: 2019-03-27
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp scp sftp smb smbs smtp smtps telnet tftp
Features: AsynchDNS Debug GSS-API HTTP2 HTTPS-proxy IDN IPv6 Kerberos Largefile libz Metalink NTLM NTLM_WB PSL SPNEGO SSL TLS-SRP TrackMemory UnixSockets

operating system

Cygwin running under Windows 10
CYGWIN_NT-10.0 3.0.7(0.338/5/3) 2019-04-30 18:08 x86_64 Cygwin

@bagder
Copy link
Member

bagder commented Jun 12, 2019

It's very much on purpose. The documentation should be updated to match reality.

bagder added a commit that referenced this issue Jun 12, 2019
@bagder bagder closed this as completed in 9dd731c Jun 13, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Sep 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

Successfully merging a pull request may close this issue.

2 participants