Answers for "how to replace a character in bash"

1

HOW TO REPLACE A CHARACTER FROM A STRING IN BASH

string="abc"
final=${string//[a]/b}

echo $final
Posted by: Guest on May-13-2021
0

bash replace string

#1) Open the file in vi or vim
#2) Run the replacement command in vi (or vim) as follows

# Replace all matching patterns
:s%/PatternToReplace/Replacement

# Replace one matching pattern at a time
:s/PatternToReplace/Replacement
Posted by: Guest on November-17-2021

Code answers related to "how to replace a character in bash"

Browse Popular Code Answers by Language