I have many files with pattern name:
N.apple(d).log
e.g. 001.apple(d).log
, 002.apple(d).log
, etc.
The problem is when I am trying to do something with the files in a bash script, there is always an error 'No such file or directory' even with escaped brackets:
for i in $(ls my_folder); do file=$(echo $i | sed 's/(/\\(/g' | sed 's/)/\\)/g') ; head -1 my_folder/$file; done
Thanks for any tips