Domanda

I want to create an alias to get a file using cURL which prompts for the:

  • URL
  • output path
  • username and password of a proxy

How would I be able to do this interactively rather than hardcoding everything?

È stato utile?

Soluzione

The following works as expected:

alias proxyget='read userid?"Userid: "; read passwd?"Password: "; read url?"URL: "; read local?"Local: "; curl -x 1.2.3.4:8080 -U $userid:$passwd  $url -o $local;'

References

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top