Как я игнорирую прокси если не доступный? и хотел бы сделать сценарий удара для создания файлов, но сценарий пропустил некоторые части и не включал переменные.
$ cat > /etc/apt/detect-http-proxy <<- _EOF_
... all the contents of the file until this line ...
print_msg() {
# \x0d clears the line so [Working] is hidden
[ "$show_proxy_messages" = 1 ] && printf '\x0d%s\n' "$1" >&2
}
for proxy in "${try_proxies[@]}"; do
# if the host machine / proxy is reachable...
if nc -z ${proxy/:/ }; then
proxy=http://$proxy
print_msg "Proxy that will be used: $proxy"
echo "$proxy"
exit
fi
_EOF_
Таким образом, содержание того файла, когда я делаю кошку:
$ cat /etc/apt/detect-http-proxy
print_msg() {
# \x0d clears the line so [Working] is hidden
[ "" = 1 ] && printf '\x0d%s\n' "" >&2
}
for proxy in ""; do
# if the host machine / proxy is reachable...
if nc -z ; then
proxy=http://
print_msg "Proxy that will be used: "
echo ""
exit
fi
Как мы фиксируем это? И также комментарий в 2016, упомянутый Acquire::http::Proxy-Auto-Detect
. Как мы используем это?
lol извините нашел ответ... просто типом \
перед переменной \$proxy
Как насчет Acquire::http::Proxy-Auto-Detect
?