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

-- 
Bob Krzaczek, Chester F. Carlson Center for Imaging Science, RIT
phone +1-585-4757196, email [email protected], icbm 43.08586N 77.67744W
_______________________________________________
ast-users mailing list
[email protected]
http://lists.research.att.com/mailman/listinfo/ast-users

Reply via email to