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 ...
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
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. ...
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 ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
search-and-replace × 26linux × 9
sed × 7
regex × 4
replace × 4
bash × 3
regular-expressions × 3
strings × 3
mac-osx × 2
find × 2
text × 2
apache-2.2 × 1
windows × 1
ssh × 1
powershell × 1
reverse-proxy × 1
logging × 1
ldap × 1
redirect × 1
mod-rewrite × 1
unix × 1
sql-server-2008 × 1
scripting × 1
ansible × 1
command-line-interface × 1