From owner-freebsd-questions Sat May 10 08:19:36 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id IAA07748 for questions-outgoing; Sat, 10 May 1997 08:19:36 -0700 (PDT) Received: from iceberg.anchorage.net. (root@iceberg.anchorage.net [207.14.72.150]) by hub.freebsd.org (8.8.5/8.8.5) with SMTP id IAA07741 for ; Sat, 10 May 1997 08:19:32 -0700 (PDT) Received: from aak.anchorage.net (ai-129 [207.14.72.129]) by iceberg.anchorage.net. (8.6.11/8.7.3) with SMTP id GAA25512 for ; Sat, 10 May 1997 06:17:03 -0800 Date: Sat, 10 May 1997 07:09:50 -0800 (AKDT) From: Steve Howe X-Sender: abc@aak.anchorage.net To: freebsd-questions Subject: getopts Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-questions@freebsd.org X-Loop: FreeBSD.org Precedence: bulk after pondering what use "getopts" was over "manual" parsing, i finally realized "getopts" can deal with option globbing, ie, i can pass "script -abc" to while getopts abc i; do case $i in a) blah, blah b) blah, blah c) blah, blah esac done my questions is: how can i set the positional parameters to $1=a, $2=b, $3=c, etc. is this replacement for getopt(1) supposed to get rid of the idea of positional parameters? i can do a) a=$i b) b=$i c) c=$i but this seems tedious, and i still don't have "shiftable" variables ... i tried various versions of "set -- `getopts abc i` $*", etc. but i can only end up with "$1 = -abc" ... ------------------------------------------------------------------------- Sleep: a sign a caffeine deprivation ... http://www.anchorage.net/~un_x -------------------------------------------------------------------------