3

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 using a back-referenced regular expression. Use the replace module if you want to change multiple, similar lines I believe the dest parameter is used for ...


2

Thanks for the hint to mod_filter. It seems to work now! I had a problem with the fact, that the site uses both, the url with www. and the one without. My configuration is: <VirtualHost *:801> ServerName www.dev.domain1.com ServerAdmin office@domain2.com SetEnvIf X-Forwarded-Proto https HTTPS=on FilterProvider gzinflate ...


2

Apache does have a module for this - it's called mod_filter.


2

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

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. ReplaceeVar contains lots of slashes as well. The resulting command is sed -i "s/Change_This_Url/http://localhost:1234/ab/cd/{company}/{employee}//g" &...


1

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 switch to denote your command when using the -i switch. Use: sed -i-e"s#$search#$replace#" $file as already hinted by your error message. Writing truly ...


1

Assuming you just want to append trackId=xyz to the end of each URL: awk '{print $0 "&trackId=xyz"}' <in.txt >out.txt


1

[vagrant@localhost ~]$ sed -e '/"title2/,/}/{ s/replaceme/title2/; }' test "title" : { "Propertie1" : "xxxx", "Propertie2: "replaceme" } "title2" : { "Propertie1" : "xxxx", "Propertie2: "title2" } "title" : { "Propertie1" : "xxxx", "Propertie2: "replaceme" } "title2" : { "Propertie1" : "...


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