Paul Barbaux
Paul Barbaux

Reputation: 1

make a bash function for creating alias with parameter

I want to make a curl function like

function Meteo () {curl http://wttr.in/ "$1";}

but doesn't work he doesn't find the city,

but I have tried with huge city like Paris .

link to image: https://i.sstatic.net/ld6WL.jpg .

but when I did for example curl http://wttr.in/paris its working

Upvotes: 0

Views: 77

Answers (1)

Rod Elias
Rod Elias

Reputation: 746

function Meteo() {
    curl http://wttr.in/"$1"
}

Notice there isn't any extra space between the URL and "$1" variable.

Upvotes: 1

Related Questions