2 You can still quote the variable
source | link

Because you're using quotes in the command, rm thinks you want a filename with a literal * character, it's not expanding that as a wildcard. Try it without the quotes to match all files ending with .txt instead:

rm $TEMP_DIR"$TEMP_DIR"/*.txt

Because you're using quotes in the command, rm thinks you want a filename with a literal * character, it's not expanding that as a wildcard. Try it without the quotes to match all files ending with .txt instead:

rm $TEMP_DIR/*.txt

Because you're using quotes in the command, rm thinks you want a filename with a literal * character, it's not expanding that as a wildcard. Try it without the quotes to match all files ending with .txt instead:

rm "$TEMP_DIR"/*.txt
1
source | link

Because you're using quotes in the command, rm thinks you want a filename with a literal * character, it's not expanding that as a wildcard. Try it without the quotes to match all files ending with .txt instead:

rm $TEMP_DIR/*.txt