We can use an internal field separator (IFS) variable to parse an array. Let’s use an example script, where first we define a string with colon-separated. Then we will use IFS to separate values based on a delimiter.

Advertisement

Let’s execute this script and check for results.

./myscript.sh 
Output:
orange grapes banana apple
Share.

2 Comments

Exit mobile version