Substring using sed or awk

I am trying to get a substring from a string stored in a variable. I tried sed with a bit help from this forum, but not successful. Here is my problem.

My string is: "REPLYFILE=myfile.txt"
And I need: myfile.txt (everything after the = symbol).

My string is: "myfile.txt.gz.20091120.enc
And I need: myfile.txt.gz (everything before string .gz, including .gz).

After my sed failed, I tried to get the position of the delimiting string thinking of using cut command. But failed at that as well.

As I am trying to learn sed and awk, any links to good tutorial is appreciated.
Thanks

cat abc.txt
REPLYFILE=myfile.txt
myfile.txt.gz.20091120.enc
REPLYFILE=myfile.txt.gz.20091120.enc
sed 's/.*=//g;s/\.gz.*//g' abc.txt

chk if this helps.

echo "myfile.txt.gz.20091120.enc" |sed 's/\(\.gz\).*/\1/' 

Using bash parameter substitution techniques:

1)
________________
${string##substring}
It deletes the "longest" match of $substring from 'front' of $string.
_________________

$ var="REPLYFILE=myfile.txt"

$ echo ${var##*=}
myfile.txt

or

$ echo $var | awk '{print $NF}' FS=\=
myfile.txt

2)
_________________________
${string%substring}
It deletes shortest match of $substring from 'back' of $string.
_________________________

$ var="myfile.txt.gz.20091120.enc"

$ echo ${var%gz*}
myfile.txt.

$ echo ${var%gz*}gz
myfile.txt.gz

Regards,
Jadu

Thanks for everyone's time. All solutions are working.

Or:

var=myfile.txt.gz.20091120.enc
echo ${var%.*.*}
-or-
echo ${var%%.[1-9]*}