7

split array element with special character

view full story
linux-howto

http://serverfault.com – I would like to split each of the array element by the ~ character so that I can operate on each segment individually. Here is the code I tried myself #!/bin/bash array=('CRITICAL ~ First_run ~ Build stability: 3 out of the last 4 builds failed. ~ 25', 'CRITICAL ~ Mangesh_Testing ~ Build stability: All recent builds failed. ~ 0', 'CRITICAL ~ MKS_Integrity ~ Build stability: All recent builds failed. ~ 0', 'OK ~ MKS_TEST ~ Build stability: No recent builds failed. ~ 100', 'CRITICAL ~ Rest_api_testing ~ ~ no score', 'CRITICAL ~ Second_job ~ ~ no score', 'OK ~ Team_test ~ Build stability: No (HowTos)