I have a python script (called temp.py) that returns two numbers, formatted as strings and separated by whitespace. For example, the output would look like "23.3 43.6 ". I am trying to print out these values in a bash script. I can print the entire output string via echo $OUTPUT, but I get a bad substitution error when trying to print individual elements. What am I doing wrong?
#!/bin/bash OUTPUT=$(python ./scripts/temp.py) echo $OUTPUT # Prints normally "23.3 43.6 " echo ${OUTPUT[0]} # error: bad substitution!
sh
instead?