I am having this "problem" with wildcards and I just cant figure out why it is like that.

following example:

```
#!/bin/bash
basefolder=/tmp/
rm $basefolder"processed/*.txt*"

```

this leads to an error message "cant find /tmp/processed/*.txt*" for rm.
this is of course not correct, because there are files in this folder and when i just copy and past the folder from the error message it deletes it correctly.

same applies for for loops

```
#!/bin/bash
basefolder=/tmp/
for file in $basefolder"processed/*.txt*"
...

```

will not work, my workaround is the following

```
#!/bin/bash
basefolder=/tmp/
filepattern=$basefolder"processed/*.txt*"
for file in $filepattern
...

```

another way would be to set the basefolder just /tmp and then use $basefolder/processed/*.txt* (that would work), but i am more curious why this problem even exists.

can anyone give me an explanation?