Sample Header Ad - 728x90

Why does curl -n fail in one script but not others?

0 votes
1 answer
1181 views
Why does curl -n fail in one script but not others? curl 7.67.0 running on MacOS High Sierra The following code in one script: host="ftp.xxxxxx.com/public_html/" /opt/local/bin/curl -n -T $file $host -v Gives me this: > USER xxxx PASS xxxxxxxxxx > USER anonymous PASS ftp@example.com 0 0 0 0 0 0 0 0 --:--:-- 0:00:05 --:--:-- 0< 530 Login authentication failed * Access denied: 530 Both scripts are bash scripts and located in the same directory of the same machine. There is only one .netrc file. Obviously it is OK as one script uses it with success. The curl code and host variable are the same. In fact, the code in the first script was copied directly from the second script. How do I figure out why one curl command can use the .netrc file but the other can’t? There must be something in the second script that causes the curl failure, but I have no idea what it might be.
Asked by Buadhai (257 rep)
Dec 29, 2019, 06:37 AM
Last activity: Dec 29, 2019, 06:51 AM