>x="hello"
>y="${x/e/z}"
Expected Output:
>echo $y
>hzllo
Actual Output:
>echo $y
>sh: y="${x/e/z}": The specified substitution is not valid for this command.
Note: I am using an older version of bash. Is there any other way around this? I just want to be able to remove the last 3 characters of a string:
x="file.txt.gz"
I want to create a new variable that is just "file.txt"
I have tried:
y=${x::-3}
Still gives same error as before.