sed

sed How to replace multiple spaces ...

sed How to replace multiple spaces in a string from command line [GNU sed]


echo "one      two       three   four  " | sed "s/^ *//;s/ *$//;s/ \{1,\}/ /g"
OUTPUT: one two three four

»

sed replace every words beginning with ...

sed: replace every words beginning with

$ echo "some words removethisword removethiswordalso more words" |sed 's/remove.[a-zA-Z0-9]*//g'
OUTPUT: some words more words

»
Syndicate content