gpt-4o-mini-2024-07-18· OpenAI
WildChat-4.8M (AI2)
Fix errors and bugs in the given code, without changing its intended functionality. ONLY…
- User
Fix errors and bugs in the given code, without changing its intended functionality. ONLY return the fixed code and nothing else. Enclose the entire code in a single code block.
proxy() { echo "param: # -eq 0 ]; then echo "http_proxy=https_proxy" echo "ftp_proxy=socks_proxy" echo "all_proxy=1" == "off" ]; then echo "off" unset http_proxy https_proxy ftp_proxy socks_proxy all_proxy elif [[ " ]]; then echo "port: 1" # export https_proxy="127.0.0.1:1" # export socks_proxy="127.0.0.1:1" elif [[ " ]]; then echo "proxy: 1" export https_proxy="1" export socks_proxy="1" fi }
- Assistant
proxy() { echo "param: $1" if [ $# -eq 0 ]; then echo "http_proxy=$http_proxy" echo "https_proxy=$https_proxy" echo "ftp_proxy=$ftp_proxy" echo "socks_proxy=$socks_proxy" echo "all_proxy=$all_proxy" elif [ "$1" == "off" ]; then echo "off" unset http_proxy https_proxy ftp_proxy socks_proxy all_proxy elif [[ "$1" =~ ^[0-9]+$ ]]; then echo "port: $1" export http_proxy="127.0.0.1:$1" export https_proxy="127.0.0.1:$1" export ftp_proxy="127.0.0.1:$1" export socks_proxy="127.0.0.1:$1" export all_proxy="127.0.0.1:$1" elif [[ "$1" =~ ^([0-9]{1,3}\.){3}[0-9]{1,3}:[0-9]+$ ]]; then echo "proxy: $1" export http_proxy="$1" export https_proxy="$1" export ftp_proxy="$1" export socks_proxy="$1" export all_proxy="$1" fi }