Python v3, Git
- Clone the project in the home directory
cd ~/
git clone https://github.com/razvanvancea/cli-weather-script.git
- Open the .bashrc file
nano ~/.bashrc
- Add the following aliases (in the following script, feel free to replace 'Bucharest' with a different city)
alias wb='python3 ~/cli-weather-script/get_weather.py Bucharest'
alias weather='python3 ~/cli-weather-script/get_weather.py'
- Save and close the file (e.g. for nano editor: CTRL+X, then press Y and Enter)
- Use the following command to reload the .bashrc file
source ~/.bashrc
Return the weather of the chosen location (you chose it in the 'wb' alias step - .bashrc file) via CLI:
wb
Return specific location weather via CLI (the location name needs to be passed as option):
weather Berlin