Answers for "sed replace variable value"

14

replace text with sed

sed -i 's/old-text/new-text/g' input.txt
Posted by: Guest on March-31-2020
1

sed replace number

Just use one of following commands for replacing a number of:
sed "s/[0-9]//" f.txt	#One single digit as 1
sed "s/[0-9]+//" f.txt #Further digits as 837, specifying match repetition "+"
sed "s/[0-9]+.[0-9]+]//" file.txt #Float type with decimals
Posted by: Guest on October-24-2020

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language