Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Suppose for the sake of argument my password below is abc123@

I need to authenticate my linux machine through a corporate proxy to get patches and updates... normally I'd use this:

export HTTP_PROXY='http://<Americas\Username>:<Password>@proxy.foo.com'
export http_proxy='http://<Americas\Username>:<Password>@proxy.foo.com'

However, when I substitute a real password ending with @ and then run aptitude update, I get...

[mpenning@netwiki ~]$ sudo -E aptitude update
Err http://mirror.anl.gov squeeze Release.gpg
  Could not resolve '@proxy.foo.com'
Err http://mirror.anl.gov/debian/ squeeze/main Translation-en
  Could not resolve '@proxy.foo.com'

I have tried escaping the password with \@, escaping both with \@\@, double characters (@@), and nothing seems to get this to proxy correctly; I never had a problem until I changed my password recently.

What is the right way to escape my password in bash?

share|improve this question
add comment

1 Answer 1

up vote 8 down vote accepted

You could try URL-encoding your password. @ should be replaced by %40.

Tackling Special Characters in Proxy Passwords on Linux indicates this should work, but looking around other people seem not to get that to work (and I have no way of testing this).

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.