Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

bash replace substring in string

#!/bin/bash
firstString="I love Suzi and Marry"
secondString="Sara"
echo "${firstString/Suzi/$secondString}"    
# prints 'I love Sara and Marry'
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #bash #replace #substring #string
ADD COMMENT
Topic
Name
2+2 =