1
我需要下面的shell腳本。用於從分隔值獲取有限值的Shell腳本
我有14個變量爲:
場景1 輸入:
a#@#b#@#c#@#d#@#e#@#f#@#g#@#e#@#f#@#g#@#h#@#i#@#j#@#k#@#l#@#m#@#n
場景2 輸入:
a#@#b#@#c#@#d#@#e#@#f#@#g#@#e#@#f#@#g#@#h#@#i#@#j#@#k#@#l#@#m#@#n#@#
欲輸出作爲
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
這裏op1
到op14
是變量,其中我必須存儲的值。
什麼是IFS ?? .. –
IFS是內部字段分隔符,用於與'read'內置命令分割線成單詞。 – dogbane
可以請你解釋一下這個部分''讀-a arr <<<「$ {input //#@#/#}」' –