Vladimir Kotal wrote:
> UVR wrote:
> > Vladimir Kotal wrote on Wed Jul 09 2008 at 13:55:08 GMT-0700 (PDT):
[snip] 
> Everything went fine except wflag test which failed.
> 
> The cosmetic problem was with 'print' function called via tet_infoline()
> function.
> In src/lib/ksh/common_funcs.ksh:tet_printfile() tet_infoline() is called
> like this:
> 
>           tet_infoline "---------------------------------------------------"
> 
> This leads to ksh93 print function being called with the above string.
> The shell then complains about the usage:
> 
> /opt/SUNWstc-tetlite/contrib/ctitools/bin/report_writer[47]: print:
> ---------------------------------------------------: unknown option
> 
> To illustrate the problem:
> 
> jack at opensolaris:/opt/SUNWstc-nc$ echo $SHELL
> /usr/bin/ksh93
> jack at opensolaris:/opt/SUNWstc-nc$ print "--"
> 
> jack at opensolaris:/opt/SUNWstc-nc$ print "---"
> -ksh93: print: ---: unknown option
> Usage: print [ options ] [string ...]
> jack at opensolaris:/opt/SUNWstc-nc$
> 
> I have fixed that by substituting first character of the long string
> with '='.

The issue is that "print" (and "printf") are looking for arguments and
are confused by an input string which starts with "-". You can avoid
this issue by using the POSIX end-of-options marker "--", e.g. $ print
-- "------------" # should work for both ksh88 and ksh93.

----

Bye,
Roland

-- 
  __ .  . __
 (o.\ \/ /.o) roland.mainz at nrubsig.org
  \__\/\/__/  MPEG specialist, C&&JAVA&&Sun&&Unix programmer
  /O /==\ O\  TEL <currently fluctuating>
 (;O/ \/ \O;)

Reply via email to