代碼以下json
mapping_file=mapping.txt json_file=user.json cat ${mapping_file} | while read line do OLD_IFS="$IFS" IFS=" " arr=($line) sed -i "s/${arr[0]}/${arr[1]}/g" ${json_file} done
代碼解釋:數組