Find the answer to your Linux question:
Results 1 to 7 of 7
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined! legendbb's Avatar
    Join Date
    Mar 2007

    Cool Why ``double quote"" & `single quote'

    This has been my very old curiosity since beginning with Linux.

    Why so man documentation using "`" as the starting quote instead of just use regular " or '.

    Can someone offer me some hint?


  2. #2
    It's because they have different meanings:
    ' and " is quite equal ... it will just differ when you use variables inside the quotes.
    ' won't try to find a var-name in the text
    " var-names will be interpreted

    echo "Hello $var1 \n"
    Will show: Hello World
    \n may be interpreted as new line
    if you write:
    echo 'Hello $var1 \n'
    It will show: Hello $var1 \n

    The 3rd quote you mentioned is used very different ...
    I know you can quote a bash command within ` but I can't remember the meaning of it ... never used it.
    It is also used in SQL to quote names of database, tables or fields.

  3. #3
    Linux Guru
    Join Date
    Oct 2007
    Tucson AZ
    Are you referring to a backtick, the lower case symbol on the key to the left of the number one on a standard English keyboard?
    If so, take a look at the link below:

    Unix / Linux Bourne / Bash Shell Scripting Tutorial [ ]

    If that's not it, ignore.

  4. $spacer_open
  5. #4
    Yes, long story short, bash will:
    - execute the given command
    - put its output to the place of the backtick quotes.

    For example: ls `echo $HOME` will:
    - execute 'echo $HOME' - which typically is set to something like /home/username, in my case /home/zlatko
    - put it in place of quotes, so the whole line becomes "ls /home/username"

  6. #5
    Linux Engineer drl's Avatar
    Join Date
    Apr 2006
    Saint Paul, MN, USA / CentOS, Debian, Slackware, {Free, Open, Net}BSD, Solaris

    I interpret the OP's question as referring to the single left quote in documentation as opposed to in shell scripting.

    If so, I think the answer lies in one of the first applications of Unix - in the 1970s. It was to drive a typesetting machine to produce publication-quality documents. Hence the "screen" view of "roff" pages should resemble the final product. That was not easy on interactive devices available at the time, so some approximations needed to be accepted.

    Professional documentation used left curly quotes, but those didn't exist in the available character set, so the left single quote, in single and double forms, was used.

    You may be able to find out more details by looking for and through items like Documentor's Workbench, history of Unix, etc.
    At the time of the placement of the order for the PDP-11, it had seemed natural, or perhaps expedient, to promise a system dedicated to word processing. During the protracted arrival of the hardware, the increasing usefulness of PDP-7 Unix made it appropriate to justify creating PDP-11 Unix as a development tool, to be used in writing the more special-purpose system. By the spring of 1971, it was generally agreed that no one had the slightest interest in scrapping Unix. Therefore, we transliterated the roff text formatter into PDP-11 assembler language, starting from the PDP-7 version that had been transliterated from McIlroy's BCPL version on Multics, which had in turn been inspired by J. Saltzer's runoff program on CTSS. In early summer, editor and formatter in hand, we felt prepared to fulfill our charter by offering to supply a text-processing service to the Patent department for preparing patent applications. At the time, they were evaluating a commercial system for this purpose; the main advantages we offered (besides the dubious one of taking part in an in-house experiment) were two in number: first, we supported Teletype's model 37 terminals, which, with an extended type-box, could print most of the math symbols they required; second, we quickly endowed roff with the ability to produce line-numbered pages, which the Patent Office required and which the other system could not handle.

    Early Unix history and evolution
    Best wishes ... cheers, drl
    Welcome - get the most out of the forum by reading forum basics and guidelines: click here.
    90% of questions can be answered by using man pages, Quick Search, Advanced Search, Google search, Wikipedia.
    We look forward to helping you with the challenge of the other 10%.
    ( Mn, 2.6.n, AMD-64 3000+, ASUS A8V Deluxe, 1 GB, SATA + IDE, Matrox G400 AGP )

  7. #6
    Just Joined! legendbb's Avatar
    Join Date
    Mar 2007
    Sorry for not being clear enough in my original post, my curiosity limits in the domain of documentations.
    Thank you every one for your sharing, especially for drl as always hits my question perfectly.

  8. #7
    Linux Guru Cabhan's Avatar
    Join Date
    Jan 2005
    Seattle, WA, USA
    You may also be interested in TeX, which is a typesetting language used for producing very nice PDFs, and which is used for lots of mathematical and computer science papers, and which was originally released in 1978.

    In TeX, if you want to quote something, you need to tell it the difference between an opening quote and an ending quote so that it can curl them correctly in the final output. So you see the `a' pair and ``a'' pair a lot.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts