fork(3) download
  1. #!/bin/bash
  2. var="Warning message:
  3. * checking for file ‘./DESCRIPTION’ ... OK
  4. * preparing ‘analysis’:
  5. * checking DESCRIPTION meta-information ... OK
  6. * cleaning src
  7. * checking for LF line-endings in source and make files and shell scripts
  8. * checking for empty or unneeded directories
  9. Removed empty directory ‘analysis/.idea/inspectionProfiles’
  10. Removed empty directory ‘analysis/.idea/snapshots’
  11. * creating default NAMESPACE file
  12. * building ‘analysis_0.1.tar.gz’"
  13.  
  14. regex='building ‘([^’]*)’'
  15.  
  16. if [[ "${var}" =~ $regex ]]; then
  17. pkgname="${BASH_REMATCH[1]}"
  18. echo "${pkgname}"
  19. else
  20. echo "sad face"
  21. fi
Success #stdin #stdout 0s 19704KB
stdin
Standard input is empty
stdout
analysis_0.1.tar.gz