In bash shell I am reading all the files in a folder as follows:
#!/bin/bash
FILES=MyFolder/*
for f in $FILES
do
echo "Started $f file..."
./$f > $f_july_15.txt
echo "Finished $f file..."
done
In line 6 I am trying to save the output of each file in a txt file that contains the name of the input file as follows: $f_july_15.txt. I noticed that the txt file does not get created at all, while the echo calls and the command ./$f get executed correctly. I played a little bit moving $f inside the name, but I can not get the name of the input file in the output file.
Can anyone please show me why this is happening and how I can solve this?