Pointless csh puzzle

matt at prism.UUCP matt at prism.UUCP
Fri Jul 19 07:13:00 AEST 1985



Here's a pointless little csh puzzle:  In the c-shell, it is possible to set
and environment variable whose name consist of more than one word, in the
obvious way:  

	% setenv "FOO BAR" quux

The printenv builtin will show it residing happily in the environment.  Now
for the puzzle:  can anyone find a way to GET TO the value of this variable,
using only csh builtins?  In other words, is there an <expression> such that

	% echo <expression>

will print "quux" on the screen, where <expression> is formed only from csh
commands? 

As a bonus question, can anyone figure out how to successfully invoke the
Bourne shell (sh) after doing the above setenv?  (Without using unsetenv!)  

-----------------------------------------------------------------------------
 Matt Landau            {cca, datacube, ihnp4, inmet, mit-eddie, wjh12}...
 Mirror Systems, Inc.                                   ...mirror!prism!matt
-----------------------------------------------------------------------------
 "Replace this mandolin with your wombat..."



More information about the Comp.unix.wizards mailing list