It is currently Thu, 08 Jun 2023 14:12:12 GMT

Author Message
 Double expansion in csh
Sorry if this is a  FAQ, I looked there but could not find an
answer to my problem.

given the following in a csh:

set tmp1_dir = ( ab cd ef gh )
set tmp2_dir = ( ij kl mn op )

set tmps = ( tmp1 tmp2 )

foreach tmp ( $tmps )

  set tmp_dir = "$tmp"_dir
  echo $tmp_dir

  ** this gives me tmp1 and tmp2, I want to get the
     contents of both, ie $($tmp_dir) but for the life
     of me cannot figure out how to do the double expansion.

Any help would be very appreciated,
E-mail would be better, but I can't be picky.


Mark Haack
Software Engineer
Orlando, Florida

 Mon, 21 Sep 1998 03:00:00 GMT   
 Double expansion in csh

i think this is a situation for the eval builtin. eval tells the shell
to re-evaluate it's argument and parse it (including explansions) all
over again...

:: * * 800/652-2699 ::
::   pgp fingerprint:   E7 E8 1A 95 F2 06 6A D6   6A 11 44 D6 6A 6B 93 9B   ::
:: GCS v3.12: a--- C+++ UL++++ US+++ UB+++ P+ L+++>++++++ E+>+++ W+ N++ K+  ::
::            w+ O@ M- V- PS+ Y+ PGP++ t+ 5 X R- tv- b DI++ D+ G h+ r- z-   ::

 Mon, 21 Sep 1998 03:00:00 GMT   
   [ 2 post ] 

Similar Threads

1. double quote variable expansion

2. double substitution (expansion)

3. HELP! Double variable expansion question

4. Question on order of filename expansion of {a,b}/{c,d} in bash (or csh)

5. File name expansion in csh

6. wildcard expansion and symbolic links (csh, sh, ksh, bash)

7. Trivia question: CSH word expansion

8. wierd csh ~ file expansion problems

9. \ creates a double space in variables (csh)

10. double substitution in csh

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software