fork(4) download
  1. #!/bin/bash
  2. test="$(echo -e "123456\ntest\r\n123456789\n\n\nup to here")"
  3. reg="123456(.*)up"
  4. if [[ $test =~ $reg ]]; then
  5. echo ${BASH_REMATCH[1]};
  6. fi
Success #stdin #stdout 0s 19672KB
stdin
Standard input is empty
stdout
test
 123456789