Skip to main content
added 5 characters in body
Source Link
cobbal
  • 70.5k
  • 20
  • 144
  • 157

Not possible in just grep I believe

for sed:

name=`echo $f | sed -E 's/([0-9]+_([a-z]+)_[0-9a-z]*)|.*/\1\2/'`

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"

Not possible in just grep I believe

for sed:

name=`echo $f | sed -E 's/([0-9]+_([a-z]+)_[0-9a-z]*)|.*/\2/'`

I'll take a stab at the bonus though:

echo "$name.jpg"
added 76 characters in body; added 1 characters in body
Source Link
cobbal
  • 70.5k
  • 20
  • 144
  • 157

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

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"
Source Link
cobbal
  • 70.5k
  • 20
  • 144
  • 157

Not possible in just grep I believe

I'll take a stab at the bonus though:

echo "$name.jpg"