Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

If gpg-agent is executed, it outputs data that can be processed by a shell directly, e.g.:

SSH_AUTH_SOCK=/tmp/ssh-apeOFqMF3292/agent.3292; export SSH_AUTH_SOCK;
echo Agent pid 3293;

Why is gpg-agent doing this? I've seen more programs doing it. Did shells in the past not support export var=val? Which shells do not support this alternative shell built-in?

I'm working with bash in Kubuntu.

share|improve this question
Just a guess but this is probably something bash supports but sh doesn't. – LawrenceC Jun 30 '11 at 21:58
@ultra: /bin/sh is a symlink to /bin/dash on my system which supports export var=val too. What shell are you talking about? – Lekensteyn Jun 30 '11 at 22:09
up vote 12 down vote accepted

The traditional Bourne shell didn't support combining them (although the System V one let you omit the ;; the 4.2BSD / SunOS shell didn't). It was added by the Korn shell (crossing the Bourne shell's export with csh's setenv) and subsequently adopted by other shells and by POSIX.2. Many commercial Unixes still ship the System V variant of the Bourne shell as /bin/sh, so retaining compatibility is a good idea for portability.

share|improve this answer

Your Answer


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.