I have a directory with a huge number of files. I want to write a bash script to -
- Enter that directory
- Find out which of them are Perl scripts (but none of them have a .pl extension)
- Add a line at the top of each of the line (I intend to add a new shebang) If not a Perl script, do nothing
I am unable to search for the Perl scripts, tried using grep but not getting the proper command. Also, the third step is also where I am stuck.