So here is my problem when using code:
for i in filename.txt
do
<operations>
done
Operations are being made on both file contents as well as filename itself, why is that happening?
Just to be clear I alread got 2 solutions that solve this problem, but I still can't understand why is that happening. One of the solutions that have worked for me:
for i in $(cat filename.txt)
do
tar -czf ${i}.tar $i
rm -R $i
gzip $i.tar
done