Loading ...
Sorry, an error occurred while loading the content.

49554Re: >> help with scripting vim

Expand Messages
  • Julius Plenz
    Apr 22 1:21 PM
      * lists@... <lists@...> [2004-04-22 21:59]:
      > Here's what I need to do:
      >
      > open file test.txt with vim
      > search for 192.168.1.1 and replace with 192.168.1.2
      > save the file and exit vim

      You don't want to do any other action in vim? Why dont you then use
      sed? See how easy it is:

      home/julius,1% cat test
      Test, test, 192.168.1.1, test
      Test, 192.168.1.1, test...
      Test, 192.168.1.2, Test.
      home/julius,1% sed 's/192\.168\.1\.1/192.168.1.2/' test
      Test, test, 192.168.1.2, test
      Test, 192.168.1.2, test...
      Test, 192.168.1.2, Test.

      Julius
      --
      Julius Plenz, <jp@...> Surf, Mail, Smile! www.cvmx.de/ <><
      http://plenz.com/ Please don't Cc me in your replies, thanks
      #129455376 3993 FD19 2AF0 E21E 5D74 E963 144C 5EE9 186D CA0D
      gpg --verbose --keyserver subkeys.pgp.net --recv-key 0x186DCA0D
    • Show all 9 messages in this topic