Skip to content

Instantly share code, notes, and snippets.

View alucard001's full-sized avatar

Ellery Leung alucard001

View GitHub Profile
@alucard001
alucard001 / Sample.yml
Last active May 23, 2025 10:24
Given a section of CICD pipeline in Gitlab, what is the difference between `${vProj2}` and `$vProj2`?
# In a GitLab CI/CD pipeline (and in shell scripting), both `$vProj2` and `${vProj2}` are used for variable expansion,
# but there is a subtle difference:
# - **`$vProj2`**: Expands the variable `vProj2`. This is the simplest form and works when the variable name is immediately
# followed by a character that cannot be part of a variable name (like a space or punctuation).
# - **`${vProj2}`**: Also expands the variable `vProj2`, but the braces are used to clearly delimit the variable name.
# This is especially useful when you want to append characters directly after the variable name, e.g., `${vProj2}_suffix`,
# or when the variable name is followed by a character that could be interpreted as part of the name.