bash script: replace . with :
echo [string] | sed "s/[original]/[target]/g"#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".)
Also in C++:
- linux change user password
- popwershell add local user
- linux du suppress errors
- install newman-reporter-htmlextra
- git error push declined due to email privacy restrictions
- sed replace with newline
- install tar.xz in ubuntu
- kill pid
- install juyptar
- bash if greater than
- git rename remote
- how to configure bluetooth on ubuntu command line
- linux show mail server
- git see all tracked files
- how completely remove kde
- how to run linux on windows10
- ubuntu dot to png
- install pyqt5
- ubuntu install vboxguest
- install bootstrap vue
- imagemagick add background to transparent png
- install postcss
- push image to docker hub
- clear cache yum centos 7