[tex-live] re: shell expansion of tilde

Nelson H. F. Beebe beebe at math.utah.edu
Thu Jan 24 00:34:03 CET 2008


Werner LEMBERG <wl at gnu.org> asks about the behavior of shell expansion
exhibited by this test, and wants to know if this is a bug in bash:

	$ export MT_TFMDESTDIR='~/bin'

	$ eval FOO=\"$MT_TFMDESTDIR\"

	$ echo $FOO
	~/bin

	$ eval FOO="$MT_TFMDESTDIR"

	$ echo $FOO
	/u/sy/beebe/bin

	$ eval FOO=$MT_TFMDESTDIR

	$ echo $FOO
	/u/sy/beebe/bin

I've made this experiment with bash (3.2.33(1)), ksh (Version M
1993-12-28 o+), pdksh (PD KSH v5.2.14 99/07/13.2), and zsh (4.1.1),
and get identical behavior.  

Unix shell variable expansion is arcane and horribly complex: see the
flow chart on p. 165 of Classic Shell Scripting, and the accompanying
description.

-------------------------------------------------------------------------------
- Nelson H. F. Beebe                    Tel: +1 801 581 5254                  -
- University of Utah                    FAX: +1 801 581 4148                  -
- Department of Mathematics, 110 LCB    Internet e-mail: beebe at math.utah.edu  -
- 155 S 1400 E RM 233                       beebe at acm.org  beebe at computer.org -
- Salt Lake City, UT 84112-0090, USA    URL: http://www.math.utah.edu/~beebe/ -
-------------------------------------------------------------------------------


More information about the tex-live mailing list