bash-like arrays with busybox / ash
walter harms
wharms at bfs.de
Sat Mar 14 11:23:40 UTC 2009
Guenter schrieb:
> Hi all,
> I just suprisingly found that latest busybox 1.13.3 seems not yet
> support arrays like bash does, f.e. something like:
>
> #!/bin/ash
> url='http://....'
> files=(`wget -q -O - $url`)
> for ((i=0; i<${#files[*]}; i++)); do
> echo "$i - ${files[$i]}"
> done
>
> returns:
> ./getlist: line 3: syntax error: "(" unexpected
>
> are there any plans to implement arrays soon?
no, except you are doing it.
For your priblem it will be more easy to rewrite it, like (untested!):
for FILE in $( wget -q -O - $url )
do
echo $FILE
done
re,
wh
More information about the busybox
mailing list