Fwd: arrays

2016-08-04 Thread David Henderson
-- Forwarded message -- From: David Henderson <dhender...@digital-pipe.com> Date: Thu, 4 Aug 2016 14:41:25 -0400 Subject: Re: arrays To: Jody Lee Bruchon <j...@jodybruchon.com> Thanks for the response Jody! I understand that BB is POSIX compliant, but didn't realize

Re: arrays

2016-08-04 Thread David Henderson
Thanks for the continued replies Jody :) I would love to, but I'm not very effective at that low level of programming. More of a shell and web-based programmer... Rob Landley, do you have any plans on implementing arrays in the toolbox shell? Thanks, Dave On 8/4/16, Jody Lee Bruchon &l

Re: arrays

2016-08-04 Thread David Henderson
So I'm trying to process the attached storage devices and their partitions (which get stored in arrays since the data is referenced multiple times). Since I don't know what any one particular user will have, I can't create individual variables for this and use arrays. I'm still looking for help

arrays

2016-08-02 Thread David Henderson
Good morning all! I have a script that uses arrays, but I can't seem to figure out what's going on with /bin/sh in handling them. Is there a specific way to initialize them or use them with busybox? Thanks, Dave ___ busybox mailing list busybox

Re: bash-like arrays with busybox / ash

2009-03-14 Thread walter harms
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

bash-like arrays with busybox / ash

2009-03-12 Thread Guenter
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

Re: bash-like arrays with busybox / ash

2009-03-12 Thread Roy Marples
Guenter wrote: 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

Re: bash-like arrays with busybox / ash

2009-03-12 Thread Guenter
Hi Roy, Roy Marples schrieb: You can use arrays with any shell with a little thought #!/bin/ash url='http://' set -- `wget -q -O - $url` i = 0 for file; do echo $i - $file i=$(($i + 1)) done DISCLAIMER: The above was typed directly into an email and not actually tested

Re: bash-like arrays with busybox / ash

2009-03-12 Thread Roy Marples
Guenter wrote: Here's what I have now, and this works basically, though still need to understand the set construct: set -- one two three Sets the position parameters $1 $2 and $3 to one two three respectively set -- hello world foo bar $1=hello world $2=foo $3=bar somefunc() { echo $1

Re: bash-like arrays with busybox / ash

2009-03-12 Thread Denys Vlasenko
On Thursday 12 March 2009 01:09:19 pm Guenter wrote: 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

Re: bash-like arrays with busybox / ash

2009-03-12 Thread Paul Smith
On Thu, 2009-03-12 at 15:56 +, Roy Marples wrote: one thing I didnt find yet in any docu: how can I catch if a string is entered instead of a number with read? if ! printf %d $n /dev/null 21; then echo You didn't enter a number exit 1 fi Alternatively: case $n in

Busybox shell and the arrays

2008-06-24 Thread GNULinuxSlackware
Hello, I am using busybox and my shell scripts use arrays declarations like this : array=(abc def ghi) but the busybox shell isn't bash, I am on ash and it seems to doesn't support array declaration. Is there a solution to use array in a script with only the busybox shells and utilities? Can you

Re: Busybox shell and the arrays

2008-06-24 Thread Alexander Kriegisch
[ Re-send yesterday's unintended private answer to the list ] but the busybox shell isn't bash, I am on ash and it seems to doesn't support array declaration. Exactly. No arrays, you can only try to work around it with available ash constructs, depending on what you want to do. There is also