Skip to main content
syntax fix
Source Link
Amandasaurus
  • 32.6k
  • 70
  • 199
  • 270

-z is a the best way.

Another options I've used is to set a variable, but it can be overridden by another variable eg

export PORT=${MY_PORT:-5432}

If the $MY_PORT variable is empty, then PORT gets set to 5432, otherwise PORT is set to the value of MY_PORT` gets set to 5432, otherwise PORT is set to the value of MY_PORT. Note the syntax include the colon and dash.

-z is a the best way.

Another options I've used is to set a variable, but it can be overridden by another variable eg

export PORT=${MY_PORT:-5432}

If the $MY_PORT variable is empty, then PORT gets set to 5432, otherwise PORT is set to the value of MY_PORT`. Note the syntax include the colon and dash.

-z is a the best way.

Another options I've used is to set a variable, but it can be overridden by another variable eg

export PORT=${MY_PORT:-5432}

If the $MY_PORT variable is empty, then PORT gets set to 5432, otherwise PORT is set to the value of MY_PORT. Note the syntax include the colon and dash.

Source Link
Amandasaurus
  • 32.6k
  • 70
  • 199
  • 270

-z is a the best way.

Another options I've used is to set a variable, but it can be overridden by another variable eg

export PORT=${MY_PORT:-5432}

If the $MY_PORT variable is empty, then PORT gets set to 5432, otherwise PORT is set to the value of MY_PORT`. Note the syntax include the colon and dash.