script=/deploy FOO=BAR,ABC=XYZ,ENV=PROD
if [[ $input_script == *"="* ]]; then
parsed=`echo $input_script | sed 's/.*deploy//'`
IFS=', ' read -r -a array <<< $parsed
for element in "${array[@]}"
do
new=`echo $element | cut -d'=' -f1`
sed -i "" '/'"$new"'/d' .env
echo $element >> .env
done
fi
1条答案
按热度按时间xwbd5t1u1#
我能够做到这一点: