The string is setup like so:
href="
PART I WANT TO EXTRACT">[link]
The string is setup like so:
href="
PART I WANT TO EXTRACT">[link]
grep -o "PART I WANT TO EXTRACT" foo
Edit: "PART I WANT TO EXTRACT" can be a regex, i.e.:
grep -o http://[a-z/.]* foo
use awk
$ echo "href="PART I WANT TO EXTRACT">[link]" | awk -F""" '{print $2}'
PART I WANT TO EXTRACT
Or using shell itself
$ a="href="PART I WANT TO EXTRACT">[link]"
$ a=${a//"/}
$ echo ${a/&*/}
PART I WANT TO EXTRACT
Here's another way in Bash:
$ string="href="PART I WANT TO EXTRACT">[link]"
$ entity="""
$ string=${string#*${entity}*}
$ string=${string%*${entity}*}
$ echo $string
PART I WANT TO EXTRACT
This illustrates two features: Remove matching prefix/suffix pattern and the use of a variable to hold the pattern (you could use a literal instead).