I am creating a couple of temp. files in a script. After completing the script, I am using the rm command to delete these files. The files are getting deleted but I am getting "filename - cannot find file;no such file or directory" error in my bash shell terminal window.
I am using the following command to remove the files:
The rm command can handle multiple files on the command line. For example, you can tell it to remove 1.txt and 2.txt with
rm 1.txt 2.txt
Your code has spaces between "test" and the wildcard "*" so rm is trying to remove two different things, just like it would remove 1.txt and 2.txt in my example. In this case, it's trying to remove /cygdrive/c/test, and *.txt (all .txt files in the current directory). This is what you need to use instead: