fork(1) download
  1. #!/bin/bash
  2. s='TEST-5.3.0.0-build1.x86_64.tar.gz'
  3.  
  4. package_folder=$(sed 's/\.[^.]*\.tar\.gz$//' <<< "$s")
  5. echo "${package_folder}"
  6.  
  7. s="${s/.x86_64.tar.gz/}"
  8. echo "$s"
Success #stdin #stdout 0.01s 5524KB
stdin
Standard input is empty
stdout
TEST-5.3.0.0-build1
TEST-5.3.0.0-build1