How to assign a variable value to array?
The below script is not working. Could anyone help me on this?
#!/bin/bash
dirs="not_using_0"
for entry in *; do
[ -d "$entry" ] && dirs="$dirs $entry"
done
dirarray= ($dirs)
output is
---------
arrayshell.sh: syntax error at line 6: `dirarray=' unexpected
How to assign a varibale value in array
array= ($variable) ? is this correct?
|