Questions tagged [quoting]

The use of quotation marks (typically, `'` or `"`) to mark tokens as string literals or strings subject to interpolation, or to treat multiple whitespace-separated tokens as a single unit.

Use this tag for questions about the correct use of quotation marks in programming, with respect to:

  • how to use quotation marks to mark text as a literal not to be interpreted in any way.
  • how to use quotation marks to mark text as subject to string interpolation.
  • how to escape (encode) quotation marks inside text already enclosed in quotation marks.

Especially in shell programming, with respect to:

  • when what quotation marks are needed, and if quoting is needed at all, including quoting of individual characters with \.
  • how to use quoting to partition a list of tokens into distinct arguments that may have embedded whitespace.
  • when quotation marks are considered part of the input vs. recognized syntactically by the shell (quote removal).
589 questions
-2
votes
2 answers

bash scripting - if statement to check if statement returns data

I'm a beginner at shell scripting and I'm trying to run a simple script that uses the locate command to search for a file that the user enters. I'm trying to implement an if statement that returns true if any file with that name is found and prints…
-2
votes
1 answer

One parameter for multiple patterns - grep

I'm trying to search pdf files from terminal. My attempt is to provide the search string from terminal. The search string can be one word, multiple words with (AND,OR) or an exact phrase. I would like to keep only one parameter for all search…
lawsome
  • 165
  • 2
  • 8
-3
votes
2 answers

Quote tags in Hugo frontmatter (regex help!)

In the process of converting a blog from WordPress to Hugo, I find that I need to do a global search and replace for tags to convert them to a list of strings. Currently I have something like this: tags: owl, owl2, rdfs, rdf, snippets, vscode,…
Andrew Matthews
  • 3,006
  • 2
  • 29
  • 42
-3
votes
1 answer

bash function input $1 is only processing first word of string & formatting issue

My BASH function: json_format () { echo '{ "question": "';echo "$1";echo '",' } for: json_format ${questions[$Q_counter]} Is returning: { "question": " VM ", Instead of expected json format and string: { …
Matt
  • 49
  • 1
  • 10
1 2 3
39
40