Stewart Stremler wrote: > begin quoting John H. Robinson, IV as of Sun, Mar 05, 2006 at 02:08:39PM > -0800: > [snip] > > Yep. That is the way to turn a sh array into a sh scalar. That is the > > problem, people do not often quote their variable names, causing the > > problems that people experience when there are spaces in variable names. > > s/variable names/variable values/
That is what I meant, thank you. > Of course, if spaces are okay in filenames, why aren't they okay in > variable names? That seems an odd inconsistency! Not at all. The shell does not dictate the underlying filesystem. In the typical UNIX filesystem (UFS) the only two illegal characters are the solidus, and the null. Nor does the underlying filesystem dictate the limitations of the shell. Take, for example, the legal length of a varible name in bash, and compare it to the legal length of a filename on an EXT3 filesystem: $ a12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890=261 $ echo :$a1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789: :$a12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890: :$a123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901: :: :261: :: $ touch a12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 touch: creating `a12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890': File name too long Do not apply filesystem limitations to shell grammar limitations, or vice-versa. -john -- [email protected] http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-list
