Jenkins pipeline consistent syntax single quotes, double quotes, and escape character syntax and Linux shell in.
apostrophe'
In all special characters between single quotes loses its special meaning
Double quotes"'
In most of the special characters between the double quotes loses its special meaning, except for the following exceptions:
$ No dollar value is used to extract variables\ To escape the backslash characterExample 1: I have $ 100 print
echo 'I have $100'
echo "I have \$100"
Example 2: Printing PATH environment variable
echo "PATH = ${PATH}"
Example 3: Print It's a dog.
echo "It's a dog"
Example 4: View python process ID
sh "ps -ef | grep python | grep -v grep | awk \'{print \$2}\'"
Example 5: execute multiple commands
sh """
whoami
pwd
ls -ltra
"""
or
sh '''
whoami
pwd
ls -ltra
'''
In Jenkins pipeline, if no special characters, single and double quotes is the same, if you want to execute multiple lines of command, with three single quotes or three double quotes.
If there are special characters that require interpretation, use double quotes.
If necessary escaped with\Escapes.
today encountered a strange bug, there is a button on a table, the code that is returned by the js I passed to the function onClick event inside a parameter on the page, these "details" butt...
1. Single quotation marks, double quotation marks (suitable for processing strings with relatively simple format) For example, if we want to output "hello world" on the screen, we can start ...
The following two commands although the execution result is the same, the processing process is different, and this article is read and thinking about where they are different. Normal mode ( \ ...
Why can't 80% of the code farmers can't do architects? >>> Both PHP single quotes and dual quotes can modify string type data, if the modified string contains variables (Example $...
Q1 Symbols in single quotes will not be escaped Variables cannot be quoted in single quotes in Linux, use''''You can use single quotes to quote variables. Q2 use=Assignment will cause escape character...
Since it can be written like this, it happened by chance (the guess should be ES6) ...
In golang, strings are implemented in byte arrays at the bottom, and double quotes or backquotes are used in golang to represent strings. The backquotes are output as they are and are not escaped.Inse...
Single quotes '' in Python, double quotes "", triple quotes """ """, or ''' ''' can be used to contain strings, three quotes can contain strings of multiple lin...
Single quotes are used to escape, double quotes are used to enclose strings, and triple quotes are used for free line breaks. It does not matter if you use single and double quotation marks for string...
Special symbol apostrophe ' ' Double quotes " " Do not quote Anti-quotes `` apostrophe ' ' What you have come here, eat spit The command and scripting inside will not be executed You can see...