I need a shell script for the below.
I have 14 variables as:
scenario 1
input:
a#@#b#@#c#@#d#@#e#@#f#@#g#@#e#@#f#@#g#@#h#@#i#@#j#@#k#@#l#@#m#@#n
scenario 2
input:
a#@#b#@#c#@#d#@#e#@#f#@#g#@#e#@#f#@#g#@#h#@#i#@#j#@#k#@#l#@#m#@#n#@#
I want output as
op1 = a
op2 = b
op3 = c
op4 = d
op5 = e
op6 = g
op7 = f
op8 = h
op9 = i
op10 = j
op11 = k
op12 = l
op13 = m
op14 = n
Here op1 to op14 are variable in which i have to store the values.
First replace
#@#with a single, unique character delimiter e.g.#, then usereadto read it into an array. The elements of the array contain the characters. This is shown below.