#!/bin/bash
a="2015-05-14 14:55:12.916395602 +0530Ttest_12345"
IFS='T' readarray -t ADDR <<< "$a"
echo "${ADDR[@]:1}"
I am trying to split the string a
into time and name using the delimiter T
.
On printing the first element in the result array ADDR
, it prints an empty string however.
How to convert the string with delimiter into array elements?
echo ${a%T*} ${a#*T}
is enough