Questions tagged [search-and-replace]
25 questions
0
votes
1 answer
SED not working with complicated string
I have a file that starts like this:
[global]
pid = /var/run/php-fpm/php-fpm.pid
error_log = /var/log/php5-fpm.log
and want to replace
error_log = /var/log/php5-fpm.log
with
error_log = /var/log/php-fpm/error.log
I want to use a script for that…
![](../../users/profiles/195651.webp)
TheNiceGuy
- 85
- 1
- 7
0
votes
1 answer
Find and replace text (multichars) in .js files on Linux
I have many .js files named the same (got.js) where i just need to find and replace some text on them. The text to find is:
\x72\x6Fx75\x6E
And is to be replaced with: \x72\x6F\x75\x6E (just a \ in the middle)
I have tried SED with find, exactly…
![](../../users/profiles/198831.webp)
Kleidi
- 15
- 6
0
votes
1 answer
find and replace text from urls in csv data feed Debian 7
My server OS is Debian 7.
I want to add id say 'xyz' to the below URLs
example.com/abc.html?id=White
example.com/abc.html?id=Black
Then URLs should look like
example.com/abc.html?id=White&trackId=xyz
example.com/abc.html?id=Black&trackId=xyz
In…
![](../../users/profiles/185394.webp)
Hrishi
- 67
- 7
0
votes
3 answers
Change URL in Source with reverse proxy?
sometimes we make copies of live sites on another server to test new features. A lot of CMS systems hardcode the URL in the database, so it is not possible to just use another URL.
On our local systems, we just use the hosts file to redirect the…
![](../../users/profiles/211417.webp)
Josef
- 381
- 3
- 9
0
votes
0 answers
sed behaviour depending on the file I apply it to
I have one file called test1.xml withe the following content:
Hello how are you doing?
And am trying to apply the following sed search and replace:
sed -i 's/Hello //g' test1.xml
And the file remains the same!!!
I am copying the content of that…
![](../../users/profiles/831451.webp)
Milos Cuculovic
- 401
- 2
- 8
- 21
0
votes
1 answer
Regular Expression in EMEditor
I am trying to make a simple find > replace regular expression. This does work fine in https://regexr.com/ to find this comment below. However the editor I use is EMEditor that i try to make a find and replace trough files and subdirectories.…
![](../../users/profiles/616676.webp)
TAPIO
- 1
0
votes
1 answer
Find and Replace using Regular Expression
I try to find a way to find and replace using EMEditor and a Regular Expression. I try to applu this for the item below:
![](../../users/profiles/592412.webp)
Thom
- 31
- 1
- 3
-1
votes
3 answers
sed replace text - escape characters
I have a mysqldump file in which I want to replace the following text
![](../../users/profiles/76570.webp)
George Tasioulis
- 1,969
- 2
- 16
- 17
-1
votes
1 answer
sed linux replace complex link
I am having this challenge to pass a link from a variable:
InstallLocation=/opt/software/software.properties
ReplaceeVar=http://localhost:1234/ab/cd/{company}/{employee}/
sed -i "s/Change_This_Url/"${ReplaceeVar}"/g" "$InstallLocation"
Built url…
-2
votes
1 answer
Mass search / replace string from ssh?
I am in the process of selling a network of 60 sites, they all have adsense with the same publisher id (google_ad_client="pub-xxxxxxxxxxxxxxxx") in all the files in the /home/ folder.
How can I do a mass search/replace from ssh to change my id to…
![](../../users/profiles/66366.webp)
jejasmin
- 11
- 1
- 4