I need to replace the whole line with sed if it matches a pattern. For example if the line is \'one two six three four\' and if \'six\' is there, then the whole
sed
This might work for you (GNU sed):
sed -e '/six/{c\fault' -e ';d}' file
or:
sed '/six/{c\fault'$'\n'';d}' file