Re: Quick sed question -- thanks



2006-04-24, 12:23(-07), mail4newsgroups@xxxxxxxxx:
[...]
I suck so bad at sed, I won't even try to take this any further because
I suck so much at it. Basically I am in need of a sed statement by
which I can change one line in a script. I am using ksh (on solaris).


Line to change:
#set -x

What to change to:
typeset -ft $(typeset +f); PS4='[$LINENO] '; export PS4


This is my lame attempt, of course it would not work because of the $,
#, ; signs, spaces and all that.

$ sed -e 's/#set -x/typeset -ft $(typeset +f); PS4='[$LINENO] '; export
PS4/g' script.sh > script.sh.tmp
sed: Function s/#set -x/typeset -ft $(typeset +f); PS4=[1] cannot be
parsed.
[...]

If you find ksh default debug tracing sucks, you could try
running your script with zsh in ksh emulation mode. It provides
with much more helpful debugging output.

--
Stéphane
.



Relevant Pages

  • Re: VG mirroring
    ... Host level migration of EMC frames for HPUX. ... hpux.vgclean - Per volume group clean-up script. ... Initialize the tables by running "ksh hpux.start". ... Look at inq.*.txt to see what devices come from what frame. ...
    (comp.unix.admin)
  • Re: [Long] about ksh93 (Was: Bourne Shell Programming on Windows)
    ... :>: Are you saying that David Korn is an unitiated or ignorant ksh ... :> won't be called in a script. ... :> in every shell. ... that should be teached in every shell programming book. ...
    (comp.unix.shell)
  • Re: vi horizontal split screen
    ... I'm an old ksh hacker, but bash will do fine. ... I started on the SysV R2 Bourne shell, and used csh for a better ... Several ksh improvements were designed to make it faster and more efficient at processing scripts, and one way to do that was substitute built-ins for external commands called from the script. ...
    (comp.editors)
  • Re: A couple of scripting queries
    ... This gets you /usr/local/bin/date, which is gnu date. ... ksh and bash definitely do and probably other newer bourne shells like ... in the script, ... I don't think you actually need any arrays anyways. ...
    (comp.unix.sco.misc)
  • Re: Ksh output garbled/out-of-sync
    ... is starting to look like a problem withksh. ... affected systems and running the test script). ... It turned to be a bug in ksh. ...
    (comp.unix.solaris)