The script exports http_proxy, prints “enabled” and exits. Curl started afterward from the original terminal still has its old environment.

Executing the script created a child process. Export makes a value available to that process's children; it does not send the value back into the parent shell. Putting the export inside bash -c or backticks does not reverse the relationship.

For an interactive switch, a function defined in the current shell can do the intended job:

proxy_on() {
    export http_proxy=http://proxy.example.net:8080
    export https_proxy="$http_proxy"
}

Replace the example endpoint with your HTTP service, or a candidate from the HTTP proxy list for permitted public requests. Call the function after loading its definition. A sourced shell file is another way to run assignments in the current shell rather than a new one.

Existing GUI applications and other terminals still keep their own environments. If the helper is intended to launch just one proxied command, keeping the change in that command's environment is often exactly the right scope.

Аффингæй хæстæг статьялтæ