You want one download to use a different proxy, then everything to return to normal. There is no need to edit your shell startup file and hope you remember to undo it.

For an external command in a POSIX-style shell, put the assignment before the command:

https_proxy=http://proxy.example:8080 curl https://example.com/

Use the HTTP endpoint intended for that download; the HTTP proxy list offers candidates for permitted public routes. The assignment is supplied to that command's environment. Its child processes can inherit the value, but the assignment does not replace the parent shell's existing value after the command exits.

The client still decides what to read

Shell syntax creates an environment; it does not force a network route. Use the variable names that the application supports. Existing bypass variables, explicit command options, or the application's own configuration may still affect the result.

The Bash environment documentation explains the command-prefix behavior. Commands that are shell functions, special builtins, or shell syntax can have additional scope rules, so the simple example above deliberately uses an external program.

For several commands, use a subshell

(
  export http_proxy=http://proxy.example:8080
  export https_proxy=http://proxy.example:8080
  command-one
  command-two
)

The parenthesized group runs with its own shell environment. Replace the illustrative command names with the programs you intend to run. This pattern avoids the fragile sequence of saving an old value, overwriting it, and restoring it by hand after every possible failure.

Keep secrets out of examples copied into shell history. Also remember that sudo can filter the environment; a variable visible to the outer command is not automatically passed through every privilege boundary. Temporary scope and actual proxy selection remain separate questions.

Allakkat attuumassuteqartut