mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: support default values in string expansion
- syntax as per Bourne/Korn shell
${parameter:-defValue}
If parameter is unset or null, the \c defValue is substituted.
Otherwise, the value of parameter is substituted.
This commit is contained in:
@ -40,8 +40,9 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
string test
|
||||
(
|
||||
" $HOME kjhkjhkjh \" \\$HOME/tyetyery ${FOAM_RUN} \n ; hkjh ;$ with "
|
||||
" $(DONOTSUBST) some other ${USER} entries "
|
||||
" $HOME kjhkjhkjh \" \\$HOME/tyetyery $; ${FOAM_RUN} \n $; hkjh;"
|
||||
" $(DONOTSUBST) some other <${USER}> with '${__UNKNOWN:-some default}'"
|
||||
" value "
|
||||
);
|
||||
|
||||
dictionary dict;
|
||||
|
||||
Reference in New Issue
Block a user