Reputation: 13
I'm trying code a bash script to swith between php version, but I'm getting the following message error:
Which PHP version would you like to enable?
php5.6
Module php5.6 already disabled
Module php7.1 already disabled
Module php7.2 already disabled
Enabling...
ERROR: Module does not exist!
My code:
#!/bin/bash
echo "Which PHP version would you like to enable?";
read $version;
sudo a2dismod php5.6;
sudo a2dismod php7.1;
sudo a2dismod php7.2;
echo "Enabling...";
sudo a2enmod "$version";
systemctl restart apache2;
Upvotes: 0
Views: 1526
Reputation: 88583
I suggest to remove $
from read $version
.
Do not use $
when assigning content to a variable.
Upvotes: 1