home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / unix / shell / 4593 < prev    next >
Encoding:
Internet Message Format  |  1992-11-08  |  927 b 

  1. Path: sparky!uunet!dtix!darwin.sura.net!zaphod.mps.ohio-state.edu!news.acns.nwu.edu!nucsrl!ddsw1!dattier
  2. From: dattier@ddsw1.mcs.com (DWT)
  3. Newsgroups: comp.unix.shell
  4. Subject: Re: Variable substitution using Korn sh
  5. Message-ID: <BxD8Bn.59t@ddsw1.mcs.com>
  6. Date: 7 Nov 92 21:42:58 GMT
  7. References: <140617@lll-winken.LLNL.GOV> <28300008@tisdec.tis.tandy.com>
  8. Organization: Contributor Account at ddsw1, Chicago, Illinois  60657
  9. Lines: 13
  10.  
  11. kevinl@tisdec.tis.tandy.com wrote in <28300008@tisdec.tis.tandy.com>:
  12.  
  13. | dirnam=$(eval echo $"$variable")
  14.  
  15. As harmless as the echo is, it being built into the Korn shell, 
  16.  
  17. eval dirnam=\$$variable
  18.  
  19. looks cleaner in my opinion.  If $variable contains a legal variable name
  20. (whose value in turn should be assigned to dirnam) it won't need any quoting.
  21.  
  22. David W. Tamkin   Box 59297   Northtown Station, Illinois  60659-0297
  23. dattier@ddsw1.mcs.com    CompuServe: 73720,1570    MCI Mail: 426-1818
  24.