Not possible in just grep I believe
for sed:
name=`echo $f | sed -E 's/[0-9]+_([a-z]+)_[0-9a-z]*/\1/'`
I'll take a stab at the bonus though:
echo "$name.jpg"
Not possible in just grep I believe
for sed:
name=`echo $f | sed -E 's/[0-9]+_([a-z]+)_[0-9a-z]*/\1/'`
I'll take a stab at the bonus though:
echo "$name.jpg"