I use the following construct in a shell script (using dash, but I think in that case there is no difference to bash):

```
for FIELD in `echo "select column_with_varchar_type from table" | mysql MYDATABASE`
do
    echo "FIELD: $FIELD"
done

```

This works fine for normal strings, but it fails for an entry where star ("\*") is in column\_with\_varchar\_type, then dash expands this to use all files in the current working directory which is of course completely wrong.

Is there a way to prevent the shell expansion or replace the star with something else in the mysql-query?

Clarification: I do NOT want to select all columns "select \*", but I want to select all entries of one column and one of these entries is a string that is a star. The input to the query **does not contain any stars** and is fine, the problem lies in the output of the query.

For example, if the table contains the strings "aaa", "bbb" and "\*", a typical output may be:

```
FIELD: aaa
FIELD: bbb
FIELD: Makefile
FIELD: src
FIELD: some_other_file_that_happens_to_be_in_the_working_directory.txt

```

So I get the strings "aaa" and "bbb" (correct), but "\*" is missing and is replaced with whatever garbage is in the working directory.