September 2018
Beginner
186 pages
4h 30m
English
You cannot combine the preceding parameter expansion forms into one expansion; "${myvar:-foo#.ext}" does not do what you might hope. You could use a temporary variable instead, to run them one at a time:
#!/bin/bash
temp="${myvar:-foo}"
printf '%s\n' "${temp#.ext}"
Read now
Unlock full access