I have tried a lot but couldn't get the solution out of it. I have a simple script:
When executed like
$ . scp.sh
it produces the correct output with no errors, but when executed like:
./scp.sh: 4: ./scp.sh: Bad substitution
Any ideas why this is happening.
I was suggested to use bash mode and it works fine. But when I execute this same script through Python (changing the script header to bash), I am getting the same error.
I'm calling it from Python as: