This the only one in shell
That are the only one in shell
This is the shell
---
--
what I need is to search each line that starts with "This" and also
line
contains "shell" then replace shell with word "fish"
unfortunately I get this to work your help will be appricated in
advance..
Here is the code:
file=$1
replace=$2
sed -i.backup -e "s/\(^This\)\(..*$\)\(shell\)/\(^This\)\(..*$\)\1$
{replace}/" $file
Taking a little extra liberty to help insure "This" and "shell" are
whole words:
sed -e '/^This /s/ shell/ fish/'
Of course, "This is a shellfish." would come out "This is a fishfish."
But I expect you're really doing something not quite the same as you
represent.
Or is this a homework assignment?