Answers for "sed -i replace by space"

2

sed replace number of variable length

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
0

sed replace with variable

sed -i "s/$var1/ZZ/g" "$file"
Posted by: Guest on August-03-2021

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language