tech question

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • klinton
    So Fucking Banned
    • Apr 2003
    • 8766

    #1

    tech question

    how to search all html files on server for one code line and then mass edit to remove that line ?
    .......... ehh... thx
  • HorseShit
    Too lazy to set a custom title
    • Dec 2004
    • 17513

    #2

    Comment

    • klinton
      So Fucking Banned
      • Apr 2003
      • 8766

      #3
      yes. thank you. that was very nice of you. you are so funny

      Comment

      • Swish
        Confirmed User
        • Mar 2006
        • 1421

        #4
        find / -type f -name *.html -exec grep -l "search_text" {} \; | perl -pi -e 's/search_text//g'

        You'll have to regex escape the search_text but that's how I would do it.

        If you want to make a backup of the files before changing them make it 'perl -pi.bak -e' for that part instead which will copy the chaged file and add '.bak' to the name


        Naughty America - Director of Technology
        It's a CELEBRATION bitches!! For the hottest content promote Naughty America!
        swish at naughtyamerica dot com | ICQ: 226 737 620 | See Who I Am At AdultWhosWho.com!

        Comment

        • Swish
          Confirmed User
          • Mar 2006
          • 1421

          #5
          Make sure your file are backed up anyway before trying this obviously in case you fuck something up ;


          Naughty America - Director of Technology
          It's a CELEBRATION bitches!! For the hottest content promote Naughty America!
          swish at naughtyamerica dot com | ICQ: 226 737 620 | See Who I Am At AdultWhosWho.com!

          Comment

          • klinton
            So Fucking Banned
            • Apr 2003
            • 8766

            #6
            Originally posted by Swish
            find / -type f -name *.html -exec grep -l "search_text" {} \; | perl -pi -e 's/search_text//g'

            You'll have to regex escape the search_text but that's how I would do it.

            If you want to make a backup of the files before changing them make it 'perl -pi.bak -e' for that part instead which will copy the chaged file and add '.bak' to the name

            Thx ! I will try it...
            i need to get rid off iframe malware......

            Comment

            • Cyber Fucker
              Hmm
              • Sep 2005
              • 12642

              #7
              Originally posted by Justin
              Hey, this was a tech question, I don't really want to watch this dirty ass pic in all threads... It's already enough of this kind of stuff in sigs and avatars

              Comment

              • who
                So Fucking Banned
                • Aug 2003
                • 19593

                #8
                Originally posted by Swish
                find / -type f -name *.html -exec grep -l "search_text" {} \; | perl -pi -e 's/search_text//g'

                You'll have to regex escape the search_text but that's how I would do it.

                If you want to make a backup of the files before changing them make it 'perl -pi.bak -e' for that part instead which will copy the chaged file and add '.bak' to the name
                Sir, you assume too much.

                Comment

                Working...