Skip to main content
Brackets without any qualification usually refer to `[`, these are braces (or curly brackets)
Source Link

The command echo $BUILDNUMBER_ is going to print the value of variable $BUILDNUMBER_ which is not set (underscore is a valid character for a variable name as explicitly noted by Jeff Schaller)

You just need to apply braces (curly brackets) around the variable name or use the most rigid printfprintf tool:

echo "${BUILDNUMBER}_"
printf '%s_\n' "$BUILDNUMBER"

PS: Always quote your variables.

The command echo $BUILDNUMBER_ is going to print the value of variable $BUILDNUMBER_ which is not set (underscore is a valid character for a variable name as explicitly noted by Jeff Schaller)

You just need to apply brackets around the variable name or use the most rigid printf tool:

echo "${BUILDNUMBER}_"
printf '%s_\n' "$BUILDNUMBER"

PS: Always quote your variables.

The command echo $BUILDNUMBER_ is going to print the value of variable $BUILDNUMBER_ which is not set (underscore is a valid character for a variable name as explicitly noted by Jeff Schaller)

You just need to apply braces (curly brackets) around the variable name or use the most rigid printf tool:

echo "${BUILDNUMBER}_"
printf '%s_\n' "$BUILDNUMBER"

PS: Always quote your variables.

deleted 5 characters in body
Source Link
ilkkachu
  • 147.9k
  • 16
  • 268
  • 441

The command echo $BUILDNUMBER_ is going to print the value of variable $BUILDNUMBER_ which is null - not set (underscore is a valid character for a variable name as explicitly noted by Jeff Schaller)

You just need to apply brackets around the variable name or use the most rigid printf tool:

echo "${BUILDNUMBER}_"
printf '%s_\n' "$BUILDNUMBER"

PS: Always quote your variables.

The command echo $BUILDNUMBER_ is going to print the value of variable $BUILDNUMBER_ which is null - not set (underscore is a valid character for a variable name as explicitly noted by Jeff Schaller)

You just need to apply brackets around the variable name or use the most rigid printf tool:

echo "${BUILDNUMBER}_"
printf '%s_\n' "$BUILDNUMBER"

PS: Always quote your variables.

The command echo $BUILDNUMBER_ is going to print the value of variable $BUILDNUMBER_ which is not set (underscore is a valid character for a variable name as explicitly noted by Jeff Schaller)

You just need to apply brackets around the variable name or use the most rigid printf tool:

echo "${BUILDNUMBER}_"
printf '%s_\n' "$BUILDNUMBER"

PS: Always quote your variables.

added 90 characters in body
Source Link
George Vasiliou
  • 8.1k
  • 3
  • 24
  • 43

The command echo $BUILDNUMBER_ is going to print the value of variable $BUILDNUMBER_ which is null - not set. (underscore is a valid character for a variable name as explicitly noted by Jeff Schaller)

You just need to apply brackets around the variable name or use the most rigid printf tool:

echo "${BUILDNUMBER}_"
printf '%s_\n' "$BUILDNUMBER"

PS: Always quote your variables.

The command echo $BUILDNUMBER_ is going to print the value of variable $BUILDNUMBER_ which is null - not set.

You just need to apply brackets around the variable name or use the most rigid printf tool:

echo "${BUILDNUMBER}_"
printf '%s_\n' "$BUILDNUMBER"

PS: Always quote your variables.

The command echo $BUILDNUMBER_ is going to print the value of variable $BUILDNUMBER_ which is null - not set (underscore is a valid character for a variable name as explicitly noted by Jeff Schaller)

You just need to apply brackets around the variable name or use the most rigid printf tool:

echo "${BUILDNUMBER}_"
printf '%s_\n' "$BUILDNUMBER"

PS: Always quote your variables.

Source Link
George Vasiliou
  • 8.1k
  • 3
  • 24
  • 43
Loading