在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