fork(1) download
  1. #!/bin/bash
  2. s='libstuff-example1 (>= 6.3.2),
  3. libpackage-example2 (>= 5.2.1),
  4. libtest-example3 (>= 5.2.1)'
  5.  
  6. val=$(grep -Po 'libpackage-.* \K[0-9.]+' <<< "$s")
  7. echo "$val"
Success #stdin #stdout 0s 4880KB
stdin
Standard input is empty
stdout
5.2.1