fork download
  1. #!/bin/bash
  2. in=FOO_123_BAR.bazquux
  3. perl -pe 's|^FOO_([0-9]+)_BAR\.(.+)$|"FOO=" . ($1 + 1) . " BAR=" . $2|e' <<< "$in"
  4.  
Success #stdin #stdout 0s 4992KB
stdin
Standard input is empty
stdout
FOO=124 BAR=bazquux