My script code is:
var="/some/path"
cp "$var*" "/another/path"
Then it throws:
cp: cannot stat '/some/path/*': No such file or directory
I have tried this and got the same error:
cp "${var}*" "/another/path"
Finally, I solved this problem by:
cp "$var"* "/another/path"
This time the command executes successfully, but I'd like to know WHY.
Could you please give out an explanation ?