在How to read multiple strings in a file as a different variables延續: -從文件中讀取多個字符串作爲不同的變量。
file.conf:
####
#xyz
key name
/usr/bin/ /text/abc/
value pswd
現在我想編寫一個腳本來有兩個變量像上面
script.sh
key="name" #key as variable
value="pswd" #value as variable
/usr/bin/=/text/abc/
請有關更多信息,請參閱上述鏈接。
變量名稱不能在'/ usr/bin /'中,因爲'/'在變量名稱中是不允許的。 – anubhava