String/text split by specific delimiter

 

.

 

#-------------------------
# Var definition
myText="split-me-now-please!";
IFS="-"; # delimiter #  IFS stands for "Internal Field Separator". This is the delimiter used when text is split


#-------------------------
# Splitting
read -a chunks <<< "$myText"; 


#-------------------------
# Display
echo "${chunks[1]}";  # echo specific element
echo "${chunks[@]}";  # echo all array
printf '%s ' "${chunks[*]}"; # echo all array

sitemap_410_gone.html