Substitutions
WARNING: Please update your bookmarks! The content of this site has been moved to http://dille.name where it will be updated as needed. This page will remain unchanged.
Setting default values:
- Return on unset value:
VAR=${VAR:-blarg} - Assign on unset value:
${VAR:=blarg}
Substituting substring:
- First occurence:
${FILE/urs/usr} - All occurences:
${FILE//urs/usr} - At end of string:
${FILE/%.jpg/.png} - At front of string:
${FILE/#${HOME}/~/}
Command substitutions:
- Either:
`pwd` - Or:
$(pwd)
- Either:
`basename \`pwd\`` - Or:
$(basename $(pwd))



