Relative Content

Tag Archive for regexsed

Replace string which contains asterisk with sed [duplicate]

This question already has answers here: Sed replace asterisk symbols (5 answers) Closed 15 hours ago. I’m trying to comment out a line via sed command. sudo sed -i “s|Include /etc/ssh/sshd_config.d/*.conf|#Include /etc/ssh/sshd_config.d/*.conf|” /etc/ssh/sshd_config Why the command above does not work? What am I missing here? I get no errors, but the line is not commented […]

Replace string which contains asterisk with sed [duplicate]

This question already has answers here: Sed replace asterisk symbols (5 answers) Closed 15 hours ago. I’m trying to comment out a line via sed command. sudo sed -i “s|Include /etc/ssh/sshd_config.d/*.conf|#Include /etc/ssh/sshd_config.d/*.conf|” /etc/ssh/sshd_config Why the command above does not work? What am I missing here? I get no errors, but the line is not commented […]

Replace string which contains asterisk with sed [duplicate]

This question already has answers here: Sed replace asterisk symbols (5 answers) Closed 15 hours ago. I’m trying to comment out a line via sed command. sudo sed -i “s|Include /etc/ssh/sshd_config.d/*.conf|#Include /etc/ssh/sshd_config.d/*.conf|” /etc/ssh/sshd_config Why the command above does not work? What am I missing here? I get no errors, but the line is not commented […]

Replace string which contains asterisk with sed [duplicate]

This question already has answers here: Sed replace asterisk symbols (5 answers) Closed 15 hours ago. I’m trying to comment out a line via sed command. sudo sed -i “s|Include /etc/ssh/sshd_config.d/*.conf|#Include /etc/ssh/sshd_config.d/*.conf|” /etc/ssh/sshd_config Why the command above does not work? What am I missing here? I get no errors, but the line is not commented […]

Replace string which contains asterisk with sed [duplicate]

This question already has answers here: Sed replace asterisk symbols (5 answers) Closed 15 hours ago. I’m trying to comment out a line via sed command. sudo sed -i “s|Include /etc/ssh/sshd_config.d/*.conf|#Include /etc/ssh/sshd_config.d/*.conf|” /etc/ssh/sshd_config Why the command above does not work? What am I missing here? I get no errors, but the line is not commented […]

Replace string which contains asterisk with sed [duplicate]

This question already has answers here: Sed replace asterisk symbols (5 answers) Closed 15 hours ago. I’m trying to comment out a line via sed command. sudo sed -i “s|Include /etc/ssh/sshd_config.d/*.conf|#Include /etc/ssh/sshd_config.d/*.conf|” /etc/ssh/sshd_config Why the command above does not work? What am I missing here? I get no errors, but the line is not commented […]

Why isn’t sed matching a space with the s character class? [duplicate]

This question already has answers here: sed (in bash) works with [ t] but not with s? (2 answers) Closed 19 mins ago. I’m writing a script to update some config files. One of the config file lines looks like this: hosts: [localhost] I’m using to do the substitutions which is working fine, but that […]

Half of a string using regex

I’m looking to capture groups of equal size, but there’s more than just one unary character in my string (eg the usual (.*)1 trick doesn’t work because the second half is different from the first)