我想将comp
的变量comp = "new_apple"
从“ apple”更新为“ new_apple”,但效果不佳
for comp in apple orange banana
do
if [ $comp == "apple" ];
then
echo "changing apple";
$comp = "new_apple";
fi;
echo $comp
done