Horje
bash script: replace . with : Code Example
bash replace substring
echo [string] | sed "s/[original]/[target]/g"
bash script: replace . with :
#To replace the first occurrence of a pattern with a given string,
#use ${parameter/pattern/string}:

#!/bin/bash
firstString="I love Suzi and Marry"
secondString="Sara"
echo "${firstString/Suzi/$secondString}"    

# prints 'I love Sara and Marry'

#To replace all occurrences, use ${parameter//pattern/string}:

message='The secret code is 12345'
echo "${message//[0-9]/X}"           
# prints 'The secret code is XXXXX'


#(This is documented in the Bash Reference Manual, ยง3.5.3 "Shell Parameter Expansion".)




Shell

Related
how to create a bash script Code Example how to create a bash script Code Example
extract a tar.xz in linux Code Example extract a tar.xz in linux Code Example
react native run android shows deprecated items Code Example react native run android shows deprecated items Code Example
unzip tar.xz linux Code Example unzip tar.xz linux Code Example
how to undo a git stash Code Example how to undo a git stash Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
15