IN PLACE edit syntax help needed

Discussion in 'Perl Misc' started by Randy Harris, Feb 23, 2004.

  1. Randy Harris

    Randy Harris Guest

    I've tried every syntax combination that I can think of. Would someone
    kindly tell me the correct syntax.

    E:\Documents>perl -i -p -e s/(var showPartFileIcon)=true/$1=false/i rrh.html
    Substitution pattern not terminated at -e line 1.

    E:\Documents>perl -i -p -e 's/(var showPartFileIcon)=true/$1=false/i
    rrh.html'
    Can't find string terminator "'" anywhere before EOF at -e line 1.

    E:\Documents>perl -i -p -e 's/(var showPartFileIcon)=true/$1=false/i'
    rrh.html
    Can't find string terminator "'" anywhere before EOF at -e line 1.

    E:\Documents>perl -i -p -e 's/(var showPartFileIcon)=true/$1\=false/i'
    'rrh.html'
    Can't find string terminator "'" anywhere before EOF at -e line 1.

    E:\Documents>perl -i -p -e 's/(var showPartFileIcon)\=true/$1\=false/i'
    'rrh.html'
    Can't find string terminator "'" anywhere before EOF at -e line 1.

    E:\Documents>perl -i -p -e 's/(var showPartFileIcon)\=true/$1\=false/i;'
    'rrh.html'
    Can't find string terminator "'" anywhere before EOF at -e line 1.

    E:\Documents>perl -i -p -e 's/(var showPartFileIcon)\=true/$1\=false/i'
    'rrh.html;'
    Can't find string terminator "'" anywhere before EOF at -e line 1.

    Thanks in advance
    Randy Harris, Feb 23, 2004
    #1
    1. Advertising

  2. Randy Harris

    Sam Holden Guest

    On Mon, 23 Feb 2004 04:32:00 GMT, Randy Harris <> wrote:
    > I've tried every syntax combination that I can think of. Would someone
    > kindly tell me the correct syntax.
    >
    > E:\Documents>perl -i -p -e s/(var showPartFileIcon)=true/$1=false/i rrh.html
    > Substitution pattern not terminated at -e line 1.


    perl -i -p -e "s/(var showPartFileIcon)=true/$1=false/i" rrh.html

    I'm assuming that's a place holder argument of some sort, not much
    point capturing a constant string (though I guess it saves some typing
    and possible typos)...

    [snip examples using ']

    The dos/windows command shell uses double quotes not single quotes for
    argument quoting. Under unix the above won't work since the $1 will be
    interpreted as a shell variable.

    Surely your Operating System came with some sort of documention?

    --
    Sam Holden
    Sam Holden, Feb 23, 2004
    #2
    1. Advertising

  3. Randy Harris

    Joe Smith Guest

    Randy Harris wrote:

    > I've tried every syntax combination that I can think of. Would someone
    > kindly tell me the correct syntax.
    >
    > E:\Documents>perl -i -p -e s/(var showPartFileIcon)=true/$1=false/i rrh.html
    > Substitution pattern not terminated at -e line 1.


    C:\>perl -i.bak -p -e "s/(var showPartFileIcon)=true/$1=false/i" rrh.html

    or, if you've installed a better command-line shell from www.cygwin.com,

    C:\>\cygwin\cygwin.bat
    $ perl -pi.bak -e 's/(var showPartFileIcon)=true/$1=false/i' rrh.html

    -Joe
    Joe Smith, Feb 25, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. dba56
    Replies:
    0
    Views:
    584
    dba56
    Jul 7, 2006
  2. David Haynes

    Help needed in finding the right place to start

    David Haynes, Aug 9, 2006, in forum: ASP .Net Security
    Replies:
    1
    Views:
    102
    Joe Kaplan \(MVP - ADSI\)
    Aug 10, 2006
  3. Laurent Julliard

    [Q] In place edit mode activation?

    Laurent Julliard, Jul 9, 2008, in forum: Ruby
    Replies:
    1
    Views:
    84
    Joel VanderWerf
    Jul 10, 2008
  4. khan
    Replies:
    7
    Views:
    593
  5. Nene

    in place edit.

    Nene, Nov 2, 2009, in forum: Perl Misc
    Replies:
    1
    Views:
    98
Loading...

Share This Page