#!/bin/bash re="([0-9]+)(, )([0=9]+)" echo $1 file1=$1 while IFS= read -r line; do echo "The line is: $line" if [[ $line =~ $re ]]; then echo ${BASH_REMATCH[0]}; echo ${BASH_REMATCH[1]}; echo ${BASH_REMATCH[2]}; fi done
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)