How can you insert [CTRL-v] in sed script - Unix

This is a discussion on How can you insert [CTRL-v] in sed script - Unix ; Hi, Trying to insert the esc sequence of ^V in a sed script but the shell does not pick up the sequence. Is there an octal equivalent that can be used instead ? Example : sed -e "s/Transform\(.*\)/ReplyTransform\1\2^MSRequestTransform\1\2/g" This replaces ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: How can you insert [CTRL-v] in sed script

  1. How can you insert [CTRL-v] in sed script


    Hi,

    Trying to insert the esc sequence of ^V in a sed script but the shell
    does not pick up the sequence. Is there an octal equivalent that can be
    used instead ?


    Example :

    sed -e "s/Transform\(.*\)/ReplyTransform\1\2^MSRequestTransform\1\2/g"


    This replaces any occurence of Transform with RequestTransform and
    ReplyTransform. It works fine if I use ^V (not shown on the script)
    from vi and use
    :%s/Transform\(.*\)/ReplyTransform\1\2^MSRequestTransform\1\2/g (^V
    before ^M not showing)

    But how can this be included in a script ?

    Thanks in advance,

    - Nataraj Dasgupta.


  2. Re: How can you insert [CTRL-v] in sed script

    \026

    "xbsd" wrote in message
    news:1115841191.831836.325850@o13g2000cwo.googlegr oups.com...
    >
    > Hi,
    >
    > Trying to insert the esc sequence of ^V in a sed script but the shell
    > does not pick up the sequence. Is there an octal equivalent that can be
    > used instead ?
    >
    >
    > Example :
    >
    > sed -e "s/Transform\(.*\)/ReplyTransform\1\2^MSRequestTransform\1\2/g"
    >
    >
    > This replaces any occurence of Transform with RequestTransform and
    > ReplyTransform. It works fine if I use ^V (not shown on the script)
    > from vi and use
    > :%s/Transform\(.*\)/ReplyTransform\1\2^MSRequestTransform\1\2/g (^V
    > before ^M not showing)
    >
    > But how can this be included in a script ?
    >
    > Thanks in advance,
    >
    > - Nataraj Dasgupta.
    >




  3. Re: How can you insert [CTRL-v] in sed script

    In article <1115841191.831836.325850@o13g2000cwo.googlegroups. com>, xbsd wrote:
    >
    > Hi,
    >
    > Trying to insert the esc sequence of ^V in a sed script but the shell
    > does not pick up the sequence. Is there an octal equivalent that can be
    > used instead ?
    >
    >
    > Example :
    >
    > sed -e "s/Transform\(.*\)/ReplyTransform\1\2^MSRequestTransform\1\2/g"
    >
    >
    > This replaces any occurence of Transform with RequestTransform and
    > ReplyTransform. It works fine if I use ^V (not shown on the script)
    > from vi and use
    >:%s/Transform\(.*\)/ReplyTransform\1\2^MSRequestTransform\1\2/g (^V
    > before ^M not showing)
    >
    > But how can this be included in a script ?
    >
    > Thanks in advance,
    >
    > - Nataraj Dasgupta.


    Write your script with vi and use Ctrl-V Ctrl-M just as you did above...

    Kevin

    --
    Unix Guy Consulting, LLC
    Unix and Linux Automation, Shell, Perl and CGI scripting
    http://www.unix-guy.com

+ Reply to Thread