sed

  1. jeltoesolnce

    Solved sed: 1: "/^\s*$/d": RE error: trailing backslash (\)

    Hello. May be, somebody know how fix that bug? Thanks.
  2. HoshiYamazaki

    Shell Binutils 2.36 compilation fails due to sed/sh error

    mv -f .deps/libz_a-uncompr.Tpo .deps/libz_a-uncompr.Po gcc -DPACKAGE_NAME=\"zlib\" -DPACKAGE_TARNAME=\"zlib\" -DPACKAGE_VERSION=\"1.1.4\" -DPACKAGE_STRING=\"zlib\ 1.1.4\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"zlib\" -DVERSION=\"1.1.4\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1...
  3. T

    Shell sed: rename(): Not a directory

    Hi! Why does sed exaust "sed: rename(): Not a directory" called sed -i ~ 's/^\#\+\(PermitRootLogin\) .*$/\1 yes/g' /etc/ssh/sshd_config The manual states: -i extension Edit files in-place similarly to -I, but treat each file independently from other files. In...
  4. quamenzullo

    Solved Correct syntax for the 'a' function of FreeBSD's sed?

    I'd liked to use the 'a' function of sed to append something after a given line in a file. For instance, I want to add "ListenAddress xx.xx.xxx.xxx" after the line that begins with "#ListenAddress" in a copy of sshd_config: Using sh I do: # IP=xx.xx.xxx.xxx # sed -E -i ""...
  5. Basil Hendroff

    Shell Handling of special characters in variables

    Letcl is a Linux shell script that checks Let's Encrypt certificates issued for a domain. I've managed to modify it to run on FreeBSD and FreeBSD embedded systems like FreeNAS. The commands the script uses that are syntactically different between Linux and FreeBSD platforms are date and sed. For...
  6. C

    sed usage

    When I set up FreeBSD, I followed an online guide that used sed to modify a few conf files. One was like this: # sed -i 's/datasize-cur=768M/datasize-cur=4096M/' /etc/login.conf But now while going through a book on sed, I try this on a regular file and get an error. $ sed -i 's/MA/Mass/'...
  7. 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?..
  8. 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...
  9. 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...
Back
Top