Subject: RE: Bourne shell question
To: Daniel Eggert <danieleggert@mac.com>
From: Thomas, Phil <Phil.Thomas@hp.com>
List: netbsd-help
Date: 12/20/2002 10:12:09
>=20
> Yes - I spotted the 'eval' free version just after sending the mail.
> (had to go off for a bit).
>=20
> Of course, if you need it to run on an AT&T /bin/sh you can do:
>=20
> index()
> {
> shift $1
> echo $1
> }
>=20
> set -- x
> while
> p=3D`index $# $partitions`
> q=3D`index $# $paths`
> [ -n "$aa" -a -n "$bb" ]
> do
> echo $p $q
> set -- $* x
> done
>=20
How about slightly simpler...
#!/bin/sh
partitions=3D"ld0a ld0b ld1a"
paths=3D"/a /b /c"
set -- $paths
for p in $partitions; do
echo "$p:$1"
shift
done
--
Phil T
phil.thomas@hp.com