Can I set up my own sub-environment?

Cristian Ionescu-Idbohrn cristian.ionescu-idbohrn at axis.com
Mon Feb 7 19:06:58 UTC 2011


On Mon, 7 Feb 2011, Sven-Göran Bergh wrote:

[snip]

>  - arrays, does not exists in ash

But you can generate array lookalike stuf like this:

	for i in $(seq 0 9); do
		eval foo_$i=$i
	done

	for i in $(seq 0 9); do
		eval bar=\$foo_$i
		echo foo_$i=$bar
	done

>  - pushd & popd, not in ash

But you can do simple:

	cd /foo
	cd -

>  - for (( expr1; expr2; expr3 ))..., not in ash

But a 'while' loop is often a good replacement.

>  - parameter expansion, some more in bash than in ash

Yes.  But there are ways to get around that too.

> These are no big obsticles. Once you know about them it is easy to use
> alternative solutions.

Right.

> What I miss most in ash is probably arrays.

See above.


Cheers,

-- 
Cristian


More information about the busybox mailing list