I want use complex command as fallback value, something like this, but do not treat ls -sh
as single string.
"${@:-ls -sh}"
Try
[ -n "${@:+X}" ] || set -- ls -sh
"$@"
[ -n "${@:+X}" ]
.set -- ls -sh
sets the positional parameters so $1
has the value 'ls'
and $2
has the value '-sh'
.