Skip to content

v0.4.9

Compare
Choose a tag to compare
@ryuichiueda ryuichiueda released this 11 Jul 00:07
· 1042 commits to main since this release
  • Implemented ${VAR:-word}, ${VAR:=word}, ${VAR:?word} and ${VAR:+word}.
### :- show a default string if A is not defined. ###
🍣 echo ${A:-not defined}
not defined
### := show a default string and substitute it to A if A is not defined. ###
🍣 echo ${A:=not defined}
not defined
🍣 echo $A
not defined
### :? show a string as an error message if A is not defined. ###
🍣 echo ${A:?not defined}
sush: A: not defined
### :+ show a string if A IS defined. ###
🍣 A= ; echo ${A:+set}

🍣 A=aaa ; echo ${A:+set}
set
  • Fixed a bug at empty string substitution
🍣 A=
🍣 (commands were ignored on the previous versions)