tags:

views:

137

answers:

2

This is driving me nuts. Everything in single quotes is supposed to be assigned as is, yet if I do the following:

TEST=' .* '

echo $TEST

I get a bunch of garbage on the screen listing all "dot" files in the current directory...

Any help would be appreciated.

+17  A: 
echo "$TEST"

If you don't quote the variable, it is expanded on the second command line.

Juliano
+1  A: 

It actually assigns ".*" to TEST. It only expands to the file listing when you echo it.

Jeremy Cantrell