📜  更改 php 版本devilbox fish - Shell-Bash 代码示例

📅  最后修改于: 2022-03-11 14:49:43.391000             🧑  作者: Mango

代码示例1
function switch_php
    set input_file ~/devilbox/.env
    if grep 'PHP_SERVER='$argv $input_file
        sed -i 's/^PHP_SERVER/#PHP_SERVER/' $input_file
        sed -i 's/^#PHP_SERVER='$argv'/PHP_SERVER='$argv'/' $input_file
        grep '^PHP_SERVER*' $input_file
    else
        echo "There is no container for PHP " $argv
    end
end