We could kill this with a thousand little cut
s, or just one blow from Awk:
awk -F'[/"]' '{ print $(NF-1); }'
Test:
$ echo '"thumbnailUrl": "http://placehold.it/150/adf4e1"' \
| awk -F'[/"]' '{ print $(NF-1); }'
adf4e1
Filter thorugh Awk using double quotes and slashes as field separators. This means that the trailing part ../adf4e1"
is separated as {..}</>{adf4e1}<">{}
where curly braces denote fields and angle brackets separators. The Awk variable NF
gives the 1-based number of fields and so $NF
is the last field. That's not the one we want, because it is blank; we want $(NF-1)
: the second last field.
"Golfed" version:
awk -F[/\"] '$0=$(NF-1)'