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

  • SEARCH
  • Home
  • 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 8060673
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T10:04:23+00:00 2026-06-05T10:04:23+00:00

I have the following command cmd ‘asdf a’sdf’ I need to surround the arguments

  • 0

I have the following command

cmd '"asdf" "a'sdf"'

I need to surround the arguments with single quotes only. cmd doesnt work with double quotes for some reason I dont know. The above command doesnt work because the single in the middle terminates the first single quote. If I escape, to the following

cmd '"asdf" "a\'sdf"'

It still doesnt work. How do I get this working?

  • 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-06-05T10:04:24+00:00Added an answer on June 5, 2026 at 10:04 am

    According to the bash man page:

       Enclosing  characters in single quotes preserves the literal value
       of each character within the quotes.  A single quote may not occur
       between single quotes, even when preceded by a backslash.
    

    So the answer is, you can’t include a single quote within a single-quoted string no matter how you try. But depending on how your script is set up you may be able to use '\'', which will end the first single quote, escape the second, and start another single-quoted string with the third.

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

Sidebar

Related Questions

I get the following error on cmd.ExecuteNonQuery . ExecuteNonQuery requires the command to have
I have the following SQL command that I need to save as a csv
I have the following code: public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[]
I have the following sql command with an Inner join: SqlCommand cmd = new
I have installed MsysGit on Windows. The following command invoked from the cmd.exe command-line
i have the following code: def cmds(cmd): cmd= Popen(cmd, shell=True, stdout=PIPE) lines = command.stdout.read().splitlines()
I have a program launching a website via the following command. cmd start /max
I have found the following command in AWK useful in Vim :'<,'>!awk '{ print
I have the following awk command which works perfectly: awk 'BEGIN { ORS =
In command line I have run the following command: C:> set _NT_SYMBOL_PATH=srv c:\symbols http://msdl.microsoft.com/download/symbols

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.