Hi. I'm new to bash and I'm trying to write a simple script that needs to convert a string into an array with whitespace as a delimiter.
However when i try to run the script it gives an error of "unexpected:(" or something like that. i'm away from my work station now so I'm not sure of the exact error.
My script goes something like:
#!/bin/bash
string="this is a sentence."
array=( $string )
The error occurs at the 3rd line but when I run it in terminal it doesn't give any error.
Any help would be appreciated. thanks!




