fork(2) download
  1. #!/bin/bash
  2. s='<icon height="36" width="36" density="ldpi" src="res/icon/android/ldpi.png"/>'
  3. grep -Eo "[^\"'=[:space:]]+\.(jpe?g|png|gif)" <<< "$s"
  4.  
  5. rx="src=([\"'])([^\"']+\.(jpe?g|png|gif))\1"
  6. if [[ "$s" =~ $rx ]]; then
  7. echo "${BASH_REMATCH[2]}";
  8. fi;
Success #stdin #stdout 0s 4188KB
stdin
Standard input is empty
stdout
res/icon/android/ldpi.png
res/icon/android/ldpi.png