problem solved. thanks a lot for the quick help. I wasn't aware of the ": problem" in getopts usage strings up to now.

j.

On Fri, 17 May 2013 18:00:02 +0200, <[email protected]> wrote:

Message: 5
Date: Fri, 17 May 2013 10:20:32 -0400
From: Bob Krzaczek <[email protected]>
To: [email protected]
Subject: Re: [ast-users] ksh /getopts question
Message-ID: <[email protected]>
Content-Type: text/plain; charset=us-ascii
On Fri, May 17, 2013 at 02:07:19PM +0200, j. van den hoff wrote:
consider a default value definition such as
defdest="HOST:/somedir"
and a getopts `opstring' containing
opstring+="[b:bck?The name of the backup destination.]:[dest:=$defdest]"
[...]
what this means, seemingly, is that `getopts' does not parse `opstring'
correctly if it contains `:'  on the rhs of the `:='.
You have to duplicate the colon to get it accepted as a literal colon, just like you do elsewhere in getopts usage strings. Using your example, one quick
and dirty way to approach it would be something like
 defdest="HOST:/somedir"
 optstring+="[b:bck?The name of the backup destination.]"
  optstring+=":[dest:=${defdest//:/::}]"
Cheers,
Bob
--


--
Using Opera's revolutionary email client: http://www.opera.com/mail/
_______________________________________________
ast-users mailing list
[email protected]
http://lists.research.att.com/mailman/listinfo/ast-users

Reply via email to