Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5945379
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T16:40:24+00:00 2026-05-22T16:40:24+00:00

The following code runs into error: for i in {190..208}; do curl -k -F

  • 0

The following code runs into error:

for i in {190..208}; do curl -k -F 'act=upload' -F 'apk=@apks/apk_${i}.apk' -F 'comment=md5: `md5 apks/apk_$i.apk`' https://username:password@myhost.com/; done

The server has an self-signed cert, so, I tried to turn off the ssl with -k.
reponse:

curl: (26) SSL: unable to obtain common name from peer certificate
curl: (26) SSL: unable to obtain common name from peer certificate
curl: (26) SSL: unable to obtain common name from peer certificate
......
curl: (26) SSL: unable to obtain common name from peer certificate

But, if I change my command to:

for i in {190..208}; do echo "curl -k -F 'act=upload' -F 'apk=@apks/apk_${i}.apk' -F 'comment=md5: `md5 apks/apk_$i.apk`' https://username:password@myhost.com/" >> tmp.sh; done

bash tmp.sh

It works without any warning.

I have no idea why.

Thank you.

P.S.
Some info.

logan $ uname -a
Darwin Logans-MacBook.local 10.7.0 Darwin Kernel Version 10.7.0: Sat Jan 29 15:17:16 PST 2011; root:xnu-1504.9.37~1/RELEASE_I386 i386
logan $ /usr/bin/curl --version
curl 7.19.7 (universal-apple-darwin10.0) libcurl/7.19.7 OpenSSL/0.9.8l zlib/1.2.3
Protocols: tftp ftp telnet dict ldap http file https ftps 
Features: GSS-Negotiate IPv6 Largefile NTLM SSL libz 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T16:40:24+00:00Added an answer on May 22, 2026 at 4:40 pm

    Others have mentioned using “” instead of ” to correctly expand the ${i} variable.

    However, this shouldn’t have an effect on curl’s SSL checking. To answer your general question about “why does bash behave differently with A and B”, try comparing the output seen with set -x. This shows exactly what is being executed by the shell, after variable substitution and quote processing. A short example:

    $ set -x
    $ echo -k "My shell is ${SHELL}" 'and my homedir is ${HOME}'
    + echo -k 'My shell is /bin/bash' 'and my homedir is ${HOME}'
    -k My shell is /bin/bash and my homedir is ${HOME}
    

    If you compare bash’s output with the “+”-prefixed lines, you should spot how the shell is interpreting the line in both command-line and tmp.sh.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The following code converts a PDF page into a JPEG. It runs as expected
Since when did: //echo [$sql][$result][$rows][$e]<BR>; cause an error? The code following this comment gets
i've got the following code which runs a bat file. the bat file then
The following piece of code runs fine when parallelized to 4-5 threads, but starts
I have the following jQuery code which runs when I'm clicking an option in
I have the following SQL code that runs against a Change Request database. Each
I was using the following code to readn in an xml file into my
I have some code that allows users to upload file attachments into a varbinary(max)
Not sure what is going on. When I perform the following code... it runs
I have the following php code that runs after validation: try { if (isset($filtered)

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.