Quantcast
Channel: sed command - Replace string in file - Unix & Linux Stack Exchange
Browsing all 5 articles
Browse latest View live

Answer by Alessandro Dal Gobbo for sed command - Replace string in file

sed 's/patternFrom/patternTo/' file.txt • "s/" means substitute what follows: this substitution must now be applied to our file, by typing a single line command: • Commands can be applied by sed only...

View Article



Answer by mazs for sed command - Replace string in file

With sed : sed -E 's/(jvmRoute=)([a-zA-Z0-9"-])+/\1"VALUE10"/g' As you have not specified what can the original jvmRoute value be, i wrote the regex for the above example, but you can customize it for...

View Article

Answer by Kusalananda for sed command - Replace string in file

Your sed command won't change anything because your file does not contain any line that starts with the string jvmRoute. XML parsing should be done with an XML parser. XMLStarlet is a good command-line...

View Article

Answer by Ulrich Schwarz for sed command - Replace string in file

You don't have any lines starting with "jvmRoute". (^ means beginning of line, just omitting that should change the two occurences in your file.)

View Article

sed command - Replace string in file

I want to modify a value in my server.xml file: <?xml version='1.0' encoding='utf-8'?> <!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements....

View Article

Browsing all 5 articles
Browse latest View live




Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>
<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596344.js" async> </script>