Is !C: a valid environment variable?

Volker Quetschke quetschke@scytek.de
Thu Apr 1 19:18:00 GMT 2004


Hi!

If you start bash from a command prompt, e.g. by starting the
cygwin.bat you get funny environment variables:

bash-2.05b$ set | grep \!
!C:='C:\cygwin\bin'

When you exit bash and start it again from the same shell you can
even get:

bash-2.05b$ set | grep \!
!C:='C:\cygwin\bin'
!EXITCODE=00000000

But try to echo any of these, or define one with !.

bash-2.05b$ export !HELLO=hello
bash: !HELLO=hello: event not found

I think this special treatment is a bug, what is the prefered solution?

The special treatment is done in environ.cc:

   /* Current directory information is recorded as variables of the
      form "=X:=X:\foo\bar; these must be changed into something legal
      (we could just ignore them but maybe an application will
      eventually want to use them).  */

I'm asking because I have a programm that chokes on !<something>
environment variables, and he workaround I'm using is always starting
the shell via: C:\cygwin\bin\rxvt.exe -e /usr/bin/bash --login -i
from the desktop or logoing into that machine via ssh.

Volker

-- 
PGP/GPG key  (ID: 0x9F8A785D)  available  from  wwwkeys.de.pgp.net
key-fingerprint 550D F17E B082 A3E9 F913  9E53 3D35 C9BA 9F8A 785D
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 254 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20040401/953ff595/attachment.sig>


More information about the Cygwin mailing list