As @rit1010 mentioned, parameters’ values are accessed using the syntax << parameters.parameter_name >>. However, it is not possible to assign a value directly to a parameter.
What you need to use, in this case, is the env_var_name parameter type. You can then assign a value to the corresponding environment variable, and it’ll be passed on to the env_var_name parameter that refers to it.
The parameter value will then have to be accessed using the following syntax: ${<< parameters.parameter_name >>}
Yes you will get an error as the text the circleci parser replaces an instance of <<something.something>> that it recognizes with its real value before the shell is executed so
so if << pipeline.number>> is recognized as having the value of 10 by the circleci parser
What is being executed by bash in your example will be echo “pipeline.number: ${10}”
All you should need to enter is echo “pipeline.number: <<pipeline.number>>”
If you are seeing an error from within bash it is normally easy to debug as the pipeline report on the dashboard will show the exact shell script that is to be executed after the circleci parser has made its modifications/substitutions.
@rit1010, thanks for your response! If I use this: echo “pipeline.number: <<pipeline.number>>”, I don’t get any error. But it does not interpolate the variable. It just prints: pipeline.number