Type: Bug
Task Name: Bash
Environment
-
Server - Azure Pipelines
-
Agent - Private:
- OS: Red Hat Enterprise Linux Server release 7.4 (Maipo)
- Agent version: 2.141.1
Issue Description
When echo "##vso[task.setvariable variable=variable]$value" is used as a part of script in Bash task type some unexpected trailing ' may appear in the value of variable. Appearance of trailing ' is a fully random process, but I usually get them in the part of my variables.
To produce and show appearance of trailing ' in value of variables I set two variables: build.producedArtifactName and build.producedArtifactPath, as could be seen below, I work with this variables in the same style: use some bash commands to set values and expose them using ###vso set.variable, in next Tasks I echo this variables and use them as an input for Task, as could be seen on screenshots, trailing ' appeared in value of variable build.producedArtifactName and didn't for build.producedArtifactPath that makes me think that problem came from the side of Bash V3 module.
Here simple bash script sets two variables and uses ###vso for variables setting:

As it could be seen in log, set variables don't have any ' symbols:

Next, it's used simple bash script to echo variables which were set via ###vso:

As a result output for first variable absolutely normal, but in second variable trailing ' appeared:

If variable set via ###vso is used in other types of tasks like Publish Build Artifacts same behaviour is faced:

As a result drop artifact also has trailing ' in it's name:

Type: Bug
Task Name: Bash
Environment
Server - Azure Pipelines
Agent - Private:
Issue Description
When
echo "##vso[task.setvariable variable=variable]$value"is used as a part of script in Bash task type some unexpected trailing'may appear in the value of variable. Appearance of trailing'is a fully random process, but I usually get them in the part of my variables.To produce and show appearance of trailing
'in value of variables I set two variables:build.producedArtifactNameandbuild.producedArtifactPath, as could be seen below, I work with this variables in the same style: use some bash commands to set values and expose them using###vso set.variable, in next Tasks I echo this variables and use them as an input for Task, as could be seen on screenshots, trailing'appeared in value of variablebuild.producedArtifactNameand didn't forbuild.producedArtifactPaththat makes me think that problem came from the side of Bash V3 module.Here simple bash script sets two variables and uses

###vsofor variables setting:As it could be seen in log, set variables don't have any

'symbols:Next, it's used simple bash script to echo variables which were set via

###vso:As a result output for first variable absolutely normal, but in second variable trailing

'appeared:If variable set via

###vsois used in other types of tasks like Publish Build Artifacts same behaviour is faced:As a result drop artifact also has trailing

'in it's name: