I want to create with sed the following:
for example each word in the file that have the "ssss..." Should be replaced (all word) with target string as gggg
echo "duwdbnhb ssssssmnfkejfnei" | sed s'/ssssss*/gggg/g'
duwdbnhb ggggmnfkejfnei
should be:
duwdbnhb gggg
remark - string could be with couple of "s" strings ( for example ss or sss or ssssss )
example:
echo "duwdbnhb sssmnfkejfnei" | sed s'/s*/gggg/g'
duwdbnhb gggg
echo "duwdbnhb sssmnfdej3434bjhhji" | sed s'/s*/gggg/g'
duwdbnhb gggg
echo "blabla sssssololo" |sed 's/s*.[^ ]*/gggg/g' blabla gggg
However if your 'sssss' will occur not only at begin of a word, you may use
echo "blabla onetwosssssololo" |sed 's/[^ ]*s*.[^ ]*/gggg/g' blabla gggg