I was just writing a bash script to execute and I tried to cp some files from within the script; eg
cp "myfolder/*.*" "otherfolder"
and it complained that "myfolder/." could not be found. Then I tried this to be more specific
cp "myfolder/*.ini" "otherfolder"
still complaining.
then I tried
cp "myfolder/${*}.ini" "otherfolder"
still complaining; all this did was put the command line arguments in this place with .ini suffix.
cp "myfolder/{*}.ini" "otherfolder"
Still no success. So just ended putting in the full file names for each file and it worked. But is there a way to use the asterisk in a bash file to refer to all files in the directory? Or can anybody see what I'm doing wrong?
Thanks.
cp myDirectory/*
is enough. – z.h. Sep 02 '18 at 14:04