1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

HELP! LOL [ -bash: !--: event not found ]

Discussion in 'Programming' started by sundaybrew, Jun 29, 2016.

  1. #1
    Hi

    I am Having TROUBLE

    HOW DO I?

    MAKE THIS WORK ;)

    I am trying to mass replace text, but I have the string wrong,. Can someone help?

    perl -pi -w /Users/admin/Desktop/mm/<!-- Added by -->/<!-- Added by Joseph -->/g;' ~/Desktop/*.htm


    -bash: !--: event not found

    admins-iMac-2:~ admin$


    I am looking for the BEST way to do this basically

    http://stackoverflow.com/questions/...ch-and-replace-in-text-files-on-mac-and-linux

    thank you
     
    Last edited: Jun 29, 2016
    sundaybrew, Jun 29, 2016 IP
  2. PoPSiCLe

    PoPSiCLe Illustrious Member

    Messages:
    4,623
    Likes Received:
    725
    Best Answers:
    152
    Trophy Points:
    470
    #2
    Do you have a GUI? If so, install a simple text-editor, like Notepad++ or Sublime or something like that, and do the multi-search/replace there instead? Provides checks (find, instead of replace) so you can see that you find what you're really after, you can do search/replace on regex, do it on multiple files without actually loading the files into the editor and so on and so forth.
     
    PoPSiCLe, Jun 29, 2016 IP
    sundaybrew likes this.
  3. sundaybrew

    sundaybrew Numerati

    Messages:
    7,294
    Likes Received:
    1,260
    Best Answers:
    0
    Trophy Points:
    560
    #3

    Is 11,700 HTML files......

    I tried with Sublime and it crashed my 8 gig iMac.....

    I am now using KOMODO 10 ( fingers crosses )

    ( Yikes )
     
    sundaybrew, Jun 29, 2016 IP
  4. PoPSiCLe

    PoPSiCLe Illustrious Member

    Messages:
    4,623
    Likes Received:
    725
    Best Answers:
    152
    Trophy Points:
    470
    #4
    Why... 11700? For one site? (you could however do them in batches, ive done search/replace in sublime with ~2k files without it crashing, however that was win 10/16GB RAM)
     
    PoPSiCLe, Jun 30, 2016 IP
  5. sundaybrew

    sundaybrew Numerati

    Messages:
    7,294
    Likes Received:
    1,260
    Best Answers:
    0
    Trophy Points:
    560
    #5

    its a 15 year old 11,000 STATIC HTML website ;)
     
    sundaybrew, Jun 30, 2016 IP
  6. PoPSiCLe

    PoPSiCLe Illustrious Member

    Messages:
    4,623
    Likes Received:
    725
    Best Answers:
    152
    Trophy Points:
    470
    #6
    Then... Toss it. Why suffer? :-D

    That should've been rewritten 11500 pages ago
     
    PoPSiCLe, Jun 30, 2016 IP
  7. sundaybrew

    sundaybrew Numerati

    Messages:
    7,294
    Likes Received:
    1,260
    Best Answers:
    0
    Trophy Points:
    560
    #7

    At first - I was like, well agreed, then after thinking for a few nights, I was like hmmmmm, its a 15 year old site in HTML - its kinda nice owning a "classic" website :) brings back so many memories ;)

    This site was gifted to me by a friend, who had a mutual friend that built this site by hand . ALL 11,000 pages, so its just a fun thin to own and to mess with, like pulling out an old nintendo game LOL
     
    sundaybrew, Jul 1, 2016 IP
  8. Andrey Stroganov

    Andrey Stroganov Peon

    Messages:
    7
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    3
    #8
    Hello,

    You can use rpl utility for fast, recursive and easy replacement in files. It can be installed by apt or download rpm from site http://www.laffeycomputer.com/rpl.html
     
    Andrey Stroganov, Jul 25, 2016 IP
    deathshadow likes this.
  9. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,998
    Best Answers:
    253
    Trophy Points:
    515
    #9
    I'll second RPL as being better suited to this task.

    Even so, it REALLY might be time to at least leverage SOME server side processing, if for no other reason that simplifying and unifying things like template handling. Even a "poor mans" setup could work wonders on not just maintaining existing pages, but on adding new ones.
     
    deathshadow, Jul 27, 2016 IP