fork download
  1. #!/bin/bash
  2. sed 's/-[0-9]*-[0-9]*$//' <<< "1234-5-8888-8978"
  3. sed 's/-[0-9]*-[0-9]*$//' <<< "1234-8888-8978"
Success #stdin #stdout 0s 19632KB
stdin
Standard input is empty
stdout
1234-5
1234