Linux Shell Parameter Expansion Cheat Sheet
1. Basic Syntax and Common Operators Category Syntax Description Example (var=”hello”) Basic Expansion <span>${param}</span> Get the value of a variable, equivalent to $param but safer. <span>${var}</span> -> hello Indirect Expansion <span>${!param}</span> Get the value of a variable whose name is the value of param. <span>foo=bar; var=foo; echo ${!var}</span> -> bar Get Length <span>${#param}</span> Get the … Read more