> Chris Quenelle wrote:
> > Roland Mainz wrote:
> > >>but the mixing of the grammars between dbx
> > >>and ksh is problematic.
> > >
> > > What do you mean here exactly ? Do you mean that "dbx" depends on ksh
> > > syntax in some cases or something else ?
> > 
> > In dbx some commands treat special characters one way, and some
> > treat them another way.
> > 
> >    print x > outfile
> > 
> > will compare the two variables 'x' and 'outfile'
> > (arguments to 'print' are treated as C/C++ syntax)
> > 
> >    regs > outfile
> > 
> > will dump the output of the regs command into the file 'outfile'
> > (arguments to 'regs' are treated as ksh syntax)
> > 
> > That's what I meant by the grammar mixes them together.
> 
> Mhhh... maybe that's something which could be done in ksh93... CC:'ing
> the ast-users mailinglist - maybe someone there has an idea how this
> behaviour could be emulated via ksh93... the tricky part is that '>' is
> actually a special shell symbol which is AFAIK interpreted before the
> command ("print") itself... ;-/
> 
> BTW: Is this a feature of the original "dbx" or was that added later by
> Sun ?
> 
> ----
> 
> Bye,
> Roland

What you would do is to write a dbx parser in ksh, something like

        while read -r
        do      case $REPLY in
                print*)         print -- $(( ${REPLY#print} ))
                ;;
                regs*)          eval "$REPLY"
                ;;
                ...
        done

David Korn
dgk at research.att.com

Reply via email to