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...
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 ""...
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...
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/'...
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?..
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...
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...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.