logoalt Hacker News

tczMUFlmoNk • today at 7:00 PM • 2 replies • view on HN

    $ echo 'abc 126 def' >file
    $ vi file -c 's/126/84' -c 'wq'
    $ cat file
    abc 84 def
If you're going to be pedantic about something irrelevant, you have to at least be correct.

Replies

cristoperb • today at 7:03 PM

I guess it is valid in vi but not sed?

  $ sed 's/126/84' <file
  sed: -e expression #1, char 8: unterminated `s' command
asveikau • today at 7:38 PM

Most people would use sed rather than vi to do this.

➕ show 1 reply