4 votes
Accepted

How to use Ansible modules replace or inline instead shell command with SED

The replace and the lineinfile use the path parameter to mark The file to modify. lineinfile module is used to ensure[s] a particular line is in a file, or [to] replace an existing line ...
Henrik Pingel's user avatar
2 votes
Accepted

How do i use the {} operator in find execution inside exec

You could use a simple for loop to solve this. for f in $(find /var/www/ -path '*wp-admin/index.php'); do mv $f $(dirname $f)/index_disabled; done
hairlessbear's user avatar
1 vote

sed linux replace complex link

First, I don't know what all your quotes are for. Just put one set of quotes around the substitution command. You use slashes to delimit regular expression and replacement string in the sed command. ...
berndbausch's user avatar
  • 1,033
1 vote
Accepted

SED not working with complicated string

IIRC the -i switch is an extension to the original sed and probably therefore implemented slightly differently in different versions. BSD sed unlike GNU sed requires you to explicitly use the -e ...
HBruijn's user avatar
  • 80.3k

Only top scored, non community-wiki answers of a minimum length are eligible