sed -i "s/Durukan/DurukanBal" '/root/test.test'
sed -i 's|http://www.durukanbal.com/|https://www.durukanbal.com/|g' index.html
sed -i 's|^duru$|DurukanBal|g' test.txt
sed -i 's|DurukanDal$|DurukanBal|g' test.txt
cat test.txt
8.34.217.13 cds.rhel.updates.googlecloud.com
10.128.0.2 instance-1.c.testenvio1.internal instance-1 **want to add string here** # Added by Google
169.254.169.254 metadata.google.internal # Added by Google
sed -Ei -- 's/([[:blank:]]+instance-1[[:blank:]]+)(#.*)$/\1 193.53.245.139 durukanbal.com \2/' /root/test.txt
cat test.txt
hello
bye
sed -r 's/(^|$)/"/g' test.txt
"hello"
"bye"
sed -e 's/^/"/' -e 's/$/"/' test.txt
"hello"
"bye"
Categories: Bash language
161 Comments