$var does not appear to be passed to command in bash file
by abasel from LinuxQuestions.org on (#52ZQ7)
I have the following script
Code:#!/bin/bash
read -p "Country Code e.g. US, NZ, UK: " country_var
echo protonvpn c --cc $country_var
sudo protonvpn c -cc $country_var
echo ""
read -n 1 -s -r -p "Press any key to continue"At the command line of I type "sudo protonvpn c -cc US" it works just fine.
The first echo command confirms that the correct code is being passed.
However, when I run the script, it displays the usage instructions i.e. its as if I am not entering the country code.


Code:#!/bin/bash
read -p "Country Code e.g. US, NZ, UK: " country_var
echo protonvpn c --cc $country_var
sudo protonvpn c -cc $country_var
echo ""
read -n 1 -s -r -p "Press any key to continue"At the command line of I type "sudo protonvpn c -cc US" it works just fine.
The first echo command confirms that the correct code is being passed.
However, when I run the script, it displays the usage instructions i.e. its as if I am not entering the country code.