I always get a bad substitution
error when I use Parameter Transformation in a script
#!/usr/bin/env bash
abc=abc
echo ${abc@U}
result
line 3: ${abc#U}: bad substitution
However, it works fine in interactive mode
> abc=abc
> echo ${abc@U}
ABC
I'm aware of the Bash: How to use operator parameter expansion ${parameter@operator}? question but there is no answer.
How can I use parameter transformation in a script?