Subject: Re: passing options through MAKEDEV to MAKEDEV.local
To: None <tech-userlevel@netbsd.org>
From: David Laight <david@l8s.co.uk>
List: tech-userlevel
Date: 09/02/2006 00:18:09
On Thu, Aug 31, 2006 at 10:20:35PM -0500, David Young wrote:
> +i=1
> +for opt; do
> +	[ $i -gt $((${OPTIND} - 1)) ] && break
> +	opts="$opts $opt"
> +	i=$(($i + 1))
> +done

So you want the first arguments?
if you don't need to worry about spaces in the options then:

get_opts() {
	opts="$*"
	shift $((OPTIND-1))
	opts="${opts:%$*}"
}

then
	get_opts "$*"

modulo 'off by one' errors.
The shell function is needed in order to get another set of
numbered parameters....

	David

-- 
David Laight: david@l8s.co.uk