[{"data":1,"prerenderedAt":74},["ShallowReactive",2],{"/2026/07/22-bash-parameter-expansion-syntax":3},{"id":4,"title":5,"body":6,"date":65,"description":43,"extension":66,"meta":67,"navigation":68,"path":69,"robots":70,"seo":71,"stem":72,"__hash__":73},"posts/2026/07/22 bash-parameter-expansion-syntax.md","22 Bash Parameter Expansion Syntax",{"type":7,"value":8,"toc":62},"minimark",[9,18,21,25,27,30,44,46,49,57,59],[10,11,13],"post-title",{":date":12},"date",[14,15,17],"h1",{"id":16},"bash-parameter-expansion-syntax","Bash Parameter Expansion Syntax",[19,20],"br",{},[22,23,24],"p",{},"I was in the middle of trying to understand a certain CI process and was wondering if there's a null-colaescing operator in bash. That's when I learned bash parameter expansion syntax.",[19,26],{},[22,28,29],{},"It's pretty simple, but powerful.",[31,32,33],"code-block",{},[34,35,40],"pre",{"className":36,"code":38,"language":39},[37],"language-text","${VARIABLE:-default_value}\n","text",[41,42,38],"code",{"__ignoreMap":43},"",[19,45],{},[22,47,48],{},"Basically, if VARIABLE is not defined, then it will use default_value. In the CI pipeline that I encountered, it is used as follow:",[31,50,51],{},[34,52,55],{"className":53,"code":54,"language":39},[37],"${PROJECT_PATH:-.}\n",[41,56,54],{"__ignoreMap":43},[19,58],{},[22,60,61],{},"So, if PROJECT_PATH is not defined, just default to the current directory.",{"title":43,"searchDepth":63,"depth":63,"links":64},2,[],"2026-07-22T00:00:00.000Z","md",{},true,"/2026/07/22-bash-parameter-expansion-syntax",null,{"title":5,"description":43},"2026/07/22 bash-parameter-expansion-syntax","BZAIlwbPv328fQ-NaHjStYW4mNKUSPgEnkV2L8N5M4I",1785167451284]