sed

  1. aragats

    Solved sed: negation of a range is broken?

    I would expect the same output of the following two commands, but the first one looks wrong to me: % echo abc^ABC.123 | sed 's/[^A-z0-9]/_/g' abc^ABC_123 % echo abc^ABC.123 | sed 's/[^[:alnum:]]/_/g' abc_ABC_123By the way, gsed does the same. Am I missing something?..
  2. W

    Other Vim and sed not recognizing escape characters

    I hope I am putting this in the area. I am running FreeBSD 10.3 x86_64 ZFS with fully encrypted HDD. I want to put a CR-LF after every uppercase Q followed by a number, i.e. Q4, Q75, Q453, In vim, I have tried: :%s/Q[0-9]+/&\r/g As well as several variations. :%s/Q\d\d\d/&\r/g Vim...
  3. K

    FreeBSD 11.0 new sed behaviour

    Hello. Al of a sudden sed began to act differently on FreeBSD 11 On FreeBSD 11.0 following script (<------> - tab character) # cat file SEARCHED_LINE #cat testscript.sed #!/bin/sh sed -E -i '.orig' \ <------>-e '/^SEARCHED_LINE/ a\ <------>line1\ line2\ <------>\<------>line3' \ file...
Top