0

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?

William Rusnack
  • 908
  • 8
  • 15

1 Answers1

0

Need bash version 5.1 or greater

William Rusnack
  • 908
  • 8
  • 15