Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to retreive weather for 4 cities ?? #151

Open
graememilne opened this issue Oct 27, 2023 · 2 comments
Open

How to retreive weather for 4 cities ?? #151

graememilne opened this issue Oct 27, 2023 · 2 comments

Comments

@graememilne
Copy link

Is it possible to show weather for say 4 cities ??
If so what is the command for it ,Please

@chicks-net
Copy link

I don't think so. You could be the command into a file 4 times and you've got a script!

@graememilne
Copy link
Author

Found this sh script which might help someone.................

#!/bin/bash

locations=(
"London,UK"
"Manchester,UK"
"Birmingham,UK"
"Glasgow,UK"
"Edinburgh,UK"
"Bristol,UK"
# Add more airports as needed
)

for location in "${locations[@]}"
do
echo "Weather for $location"
ansiweather -l "$location"
echo
done

Save the script in a file, for example, weather_uk.sh, and then make it executable:

sudo chmod +x weather_uk.sh

Run the script:
./weather_uk.sh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants