I am trying to launch a script to echo (as a test) the file name of files in a different directory but get the "No such file or directory" error. It looks like it is appending the whole directory of where I'm echoing from to the file name I'm trying to redirect to but how do I fix that. Thank you.
for filename in /data/logs/2017/jan/201701*
do
echo $filename > /home/bishopm/${filename%.gz}
done
Getting the following errors for each file trying to echo:
./data_collector.sh: line 5: /home/bishopm//data/logs/2017/jan/20170131: No such file or directory